Changeset 92 in tspsg-svn for trunk/src/mainwindow.cpp


Ignore:
Timestamp:
Feb 23, 2010, 9:21:44 PM (15 years ago)
Author:
laleppa
Message:

+ Some Windows Vista and Windows 7 eyecandy with translucent windows thanks to http://labs.trolltech.com/blogs/2009/09/15/using-blur-behind-on-windows/ :-)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/mainwindow.cpp

    r91 r92  
    225225{
    226226QPrintPreviewDialog ppd(printer, this);
    227     connect(&ppd,SIGNAL(paintRequested(QPrinter *)),SLOT(printPreview(QPrinter *)));
    228     ppd.exec();
     227        connect(&ppd,SIGNAL(paintRequested(QPrinter *)),SLOT(printPreview(QPrinter *)));
     228        ppd.exec();
    229229}
    230230
     
    258258                        QApplication::restoreOverrideCursor();
    259259                }
     260        }
     261        if (sd.translucencyChanged() != 0) {
     262                toggleTranclucency(sd.translucencyChanged() == 1);
    260263        }
    261264}
     
    352355        txtAbout->moveCursor(QTextCursor::Start);
    353356
     357        bb->button(QDialogButtonBox::Ok)->setCursor(QCursor(Qt::PointingHandCursor));
     358
    354359        vb->addLayout(hb);
    355360        vb->addWidget(txtAbout);
     
    361366
    362367        connect(bb, SIGNAL(accepted()), dlg, SLOT(accept()));
     368
     369        // Adding some eyecandy in Vista and 7 :-)
     370        if (QtWin::isCompositionEnabled())  {
     371                QtWin::enableBlurBehindWindow(dlg, true);
     372        }
    363373
    364374        dlg->resize(410, 300);
     
    758768
    759769#ifdef Q_OS_WINCE
     770        menuBar()->setDefaultAction(menuFile->menuAction());
     771#endif // Q_OS_WINCE
     772
     773#ifdef Q_OS_WINCE
    760774        //! \hack HACK: A little hack for toolbar icons to have a sane size.
    761775        toolBar->setIconSize(QSize(logicalDpiX() / 4, logicalDpiY() / 4));
    762 #endif
     776#endif // Q_OS_WINCE
    763777
    764778        solutionText->document()->setDefaultFont(settings->value("Output/Font",QFont(DEF_FONT_FAMILY,DEF_FONT_SIZE)).value<QFont>());
     
    794808        retranslateUi(false);
    795809
    796         setCentralWidget(tabWidget);
     810        // Adding some eyecandy in Vista and 7 :-)
     811        if (QtWin::isCompositionEnabled() && settings->value("UseTranslucency", DEF_USE_TRANSLUCENCY).toBool())  {
     812                toggleTranclucency(true);
     813        }
    797814}
    798815
     
    809826#endif // QT_NO_PRINTER
    810827}
     828
     829void MainWindow::toggleTranclucency(bool enable)
     830{
     831        QtWin::enableBlurBehindWindow(this, enable);
     832        QtWin::enableBlurBehindWindow(tabWidget, enable);
     833
     834        if (QtWin::enableBlurBehindWindow(tabTask, enable))
     835                tabTask->setAutoFillBackground(enable);
     836        if (QtWin::enableBlurBehindWindow(tabSolution, enable))
     837                tabSolution->setAutoFillBackground(enable);
     838}
Note: See TracChangeset for help on using the changeset viewer.