Changeset 150 in tspsg-svn for trunk


Ignore:
Timestamp:
Dec 21, 2010, 2:28:51 PM (14 years ago)
Author:
laleppa
Message:
  • Translucency effect is now available on all desktop platforms. No check for its support by window system is made at this moment. Blur is only available in Windows Vista or higher.
Location:
trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/globals.cpp

    r149 r150  
    2424#include "globals.h"
    2525
    26 #ifdef Q_WS_WIN32
     26#ifndef HANDHELD
    2727void toggleStyle(QWidget *widget, bool enable)
    2828{
     
    3333    }
    3434}
    35 #endif // Q_WS_WIN32
     35#endif // HANDHELD
  • trunk/src/globals.h

    r149 r150  
    5959// TSPSolver
    6060#include "tspsolver.h"
    61 #ifdef Q_WS_WIN32
    62     // Vista/7 Eyecandy
     61#ifndef HANDHELD
     62    // Eyecandy
    6363#   include "qtwin.h"
    64 #endif // Q_WS_WIN32
     64#endif // HANDHELD
    6565
    6666// DEFINES
     
    129129}
    130130
    131 #ifdef Q_WS_WIN32
     131#ifndef HANDHELD
    132132/*!
    133133 * \brief Enables or disables a mask for the \a widget.
     
    138138 */
    139139void toggleStyle(QWidget *widget, bool enable);
    140 #endif // Q_WS_WIN32
     140#endif // HANDHELD
    141141
    142142#ifndef DOXYGEN_EXCLUDE
  • trunk/src/mainwindow.cpp

    r149 r150  
    2525
    2626#ifdef Q_WS_WIN32
    27     #include "shobjidl.h"
     27#   include "shobjidl.h"
    2828#endif
    2929
     
    396396        if (untitled)
    397397            setFileName();
    398 #ifdef Q_WS_WIN32
     398#ifndef HANDHELD
    399399        if (QtWin::isCompositionEnabled() && settings->value("UseTranslucency", DEF_USE_TRANSLUCENCY).toBool())  {
    400400            toggleStyle(labelVariant, true);
     
    610610    connect(bb, SIGNAL(accepted()), dlg, SLOT(accept()));
    611611
    612 #ifdef Q_WS_WIN32
    613     // Adding some eyecandy in Vista and 7 :-)
     612#ifndef HANDHELD
     613    // Adding some eyecandy
    614614    if (QtWin::isCompositionEnabled())  {
    615615        QtWin::enableBlurBehindWindow(dlg, true);
    616616    }
    617 #endif // Q_WS_WIN32
     617#endif // HANDHELD
    618618
    619619    dlg->resize(450, 350);
     
    10301030void MainWindow::solverRoutePartFound(int n)
    10311031{
    1032 #ifdef Q_WS_WIN32
    10331032    tl->SetProgressValue(winId(), n, spinCities->value() * 2);
    1034 #else
    1035     Q_UNUSED(n);
    1036 #endif // Q_WS_WIN32
    10371033}
    10381034#endif // Q_WS_WIN32
     
    16611657    retranslateUi(false);
    16621658
    1663 #ifdef Q_WS_WIN32
    1664     // Adding some eyecandy in Vista and 7 :-)
     1659#ifndef HANDHELD
     1660    // Adding some eyecandy
    16651661    if (QtWin::isCompositionEnabled() && settings->value("UseTranslucency", DEF_USE_TRANSLUCENCY).toBool())  {
    16661662        toggleTranclucency(true);
    16671663    }
    1668 #endif // Q_WS_WIN32
     1664#endif // HANDHELD
    16691665}
    16701666
     
    16821678void MainWindow::toggleTranclucency(bool enable)
    16831679{
    1684 #ifdef Q_WS_WIN32
     1680#ifndef HANDHELD
    16851681    toggleStyle(labelVariant, enable);
    16861682    toggleStyle(labelCities, enable);
     
    16901686#else
    16911687    Q_UNUSED(enable);
    1692 #endif // Q_WS_WIN32
     1688#endif // HANDHELD
    16931689}
    16941690
  • trunk/src/qtwin.cpp

    r116 r150  
    103103            return isEnabled;
    104104    }
    105 #endif
    106105    return false;
     106#elif !defined(HANDHELD)
     107    //! \todo TODO: Check for trsnsparency support in other OSes.
     108    return true;
     109#else
     110    return false;
     111#endif
    107112}
    108113
     
    125130        bb.dwFlags = DWM_BB_ENABLE;
    126131        bb.hRgnBlur = NULL;
     132#endif
    127133        widget->setAttribute(Qt::WA_TranslucentBackground, enable);
    128134        widget->setAttribute(Qt::WA_NoSystemBackground, enable);
     135#ifdef Q_WS_WIN
    129136        hr = pDwmEnableBlurBehindWindow(widget->winId(), &bb);
    130137        if (SUCCEEDED(hr)) {
  • trunk/src/settingsdialog.cpp

    r149 r150  
    142142QVBoxLayout *vbox; // Layout helper
    143143
    144 #ifdef Q_WS_WIN32
     144#ifndef HANDHELD
    145145    if (QtWin::isCompositionEnabled()) {
    146146        cbUseTranslucency = new QCheckBox(bgWhite);
     
    152152        cbUseTranslucency->setCursor(QCursor(Qt::PointingHandCursor));
    153153    }
    154 #endif // Q_WS_WIN32
     154#endif // HANDHELD
    155155
    156156    cbSaveState = new QCheckBox(bgWhite);
     
    198198    box = static_cast<QBoxLayout *>(tabGeneral->layout());
    199199    box->insertWidget(box->indexOf(cbUseNativeDialogs) + 1, cbSaveState);
    200 #ifdef Q_WS_WIN32
     200#ifndef HANDHELD
    201201    if (QtWin::isCompositionEnabled())
    202202        box->insertWidget(box->indexOf(cbUseNativeDialogs) + 1, cbUseTranslucency);
    203 #endif // Q_WS_WIN32
     203#endif // HANDHELD
    204204
    205205    // Inserting label for hints to the bottom part (with grey bg)
     
    234234    cbSaveLastUsed->setChecked(settings->value("SaveLastUsed", DEF_SAVE_LAST_USED).toBool());
    235235    cbUseNativeDialogs->setChecked(settings->value("UseNativeDialogs", DEF_USE_NATIVE_DIALOGS).toBool());
    236 #ifdef Q_WS_WIN32
     236#ifndef HANDHELD
    237237    if (QtWin::isCompositionEnabled())
    238238        cbUseTranslucency->setChecked(settings->value("UseTranslucency", DEF_USE_TRANSLUCENCY).toBool());
    239 #endif // Q_WS_WIN32
     239#endif // HANDHELD
    240240#ifndef HANDHELD
    241241    cbSaveState->setChecked(settings->value("SavePos", DEF_SAVEPOS).toBool());
     
    353353    settings->setValue("SaveLastUsed", cbSaveLastUsed->isChecked());
    354354    settings->setValue("UseNativeDialogs", cbUseNativeDialogs->isChecked());
    355 #ifdef Q_WS_WIN32
     355#ifndef HANDHELD
    356356    if (QtWin::isCompositionEnabled()) {
    357357bool old = settings->value("UseTranslucency", DEF_USE_TRANSLUCENCY).toBool();
     
    362362        settings->setValue("UseTranslucency", cbUseTranslucency->isChecked());
    363363    }
    364 #endif // Q_WS_WIN32
    365 #ifndef HANDHELD
    366364    settings->setValue("SavePos", cbSaveState->isChecked());
    367365#endif // HANDHELD
  • trunk/src/settingsdialog.h

    r149 r150  
    5656    QSettings *settings;
    5757    QHBoxLayout *layoutCitiesLimit;
    58 #ifdef Q_WS_WIN32
     58#ifndef HANDHELD
    5959    QCheckBox *cbUseTranslucency;
    60 #endif // Q_WS_WIN32
     60#endif // HANDHELD
    6161    QCheckBox *cbCheck4Updates;
    6262    QSpinBox *spinUpdateCheckInterval;
Note: See TracChangeset for help on using the changeset viewer.