Skip to content
Permalink
Browse files
Fix Windows XP runtime
  • Loading branch information
Wohlstand committed May 21, 2015
1 parent 2164606 commit 5aaa9172c5052a8c4bbc814febce9f1d26a5ca7f
Show file tree
Hide file tree
Showing 10 changed files with 148 additions and 107 deletions.
@@ -21,6 +21,7 @@
#include <QDesktopWidget>
#ifdef Q_OS_WIN
#include <QtWin>
#include <QSysInfo>
#endif

#include <common_features/app_path.h>
@@ -165,16 +166,19 @@ ConfigManager::ConfigManager(QWidget *parent) :
#ifdef Q_OS_WIN
this->setWindowIcon(QIcon(":/cat_builder.ico"));

if(QtWin::isCompositionEnabled())
if(QSysInfo::WindowsVersion>=QSysInfo::WV_VISTA)
{
this->setAttribute(Qt::WA_TranslucentBackground, true);
QtWin::extendFrameIntoClientArea(this, -1,-1,-1,1);
QtWin::enableBlurBehindWindow(this);
}
else
{
QtWin::resetExtendedFrame(this);
setAttribute(Qt::WA_TranslucentBackground, false);
if(QtWin::isCompositionEnabled())
{
this->setAttribute(Qt::WA_TranslucentBackground, true);
QtWin::extendFrameIntoClientArea(this, -1,-1,-1,1);
QtWin::enableBlurBehindWindow(this);
}
else
{
QtWin::resetExtendedFrame(this);
setAttribute(Qt::WA_TranslucentBackground, false);
}
}
#endif

@@ -21,6 +21,7 @@

#ifdef Q_OS_WIN
#include <QtWin>
#include <QSysInfo>
#endif

ConfigStatus::ConfigStatus(dataconfigs &conf, QWidget *parent) :
@@ -36,17 +37,20 @@ ConfigStatus::ConfigStatus(dataconfigs &conf, QWidget *parent) :
#ifdef Q_OS_WIN
this->setWindowIcon(QIcon(":/cat_builder.ico"));

if(QtWin::isCompositionEnabled())
if(QSysInfo::WindowsVersion>=QSysInfo::WV_VISTA)
{
this->setAttribute(Qt::WA_TranslucentBackground, true);
QtWin::extendFrameIntoClientArea(this, -1,-1,-1,-1);
QtWin::enableBlurBehindWindow(this);
ui->gridLayout->setMargin(0);
}
else
{
QtWin::resetExtendedFrame(this);
setAttribute(Qt::WA_TranslucentBackground, false);
if(QtWin::isCompositionEnabled())
{
this->setAttribute(Qt::WA_TranslucentBackground, true);
QtWin::extendFrameIntoClientArea(this, -1,-1,-1,-1);
QtWin::enableBlurBehindWindow(this);
ui->gridLayout->setMargin(0);
}
else
{
QtWin::resetExtendedFrame(this);
setAttribute(Qt::WA_TranslucentBackground, false);
}
}
#endif

@@ -22,6 +22,7 @@
#include <stdexcept>
#ifdef Q_OS_WIN
#include <QtWin>
#include <QSysInfo>
#endif

#include <common_features/app_path.h>
@@ -122,16 +123,19 @@ DevConsole::DevConsole(QWidget *parent) :
#ifdef Q_OS_WIN
this->setWindowIcon(QIcon(":/cat_builder.ico"));

if(QtWin::isCompositionEnabled())
if(QSysInfo::WindowsVersion>=QSysInfo::WV_VISTA)
{
this->setAttribute(Qt::WA_TranslucentBackground, true);
QtWin::extendFrameIntoClientArea(this, -1,-1,-1, -1);
QtWin::enableBlurBehindWindow(this);
}
else
{
QtWin::resetExtendedFrame(this);
setAttribute(Qt::WA_TranslucentBackground, false);
if(QtWin::isCompositionEnabled())
{
this->setAttribute(Qt::WA_TranslucentBackground, true);
QtWin::extendFrameIntoClientArea(this, -1,-1,-1, -1);
QtWin::enableBlurBehindWindow(this);
}
else
{
QtWin::resetExtendedFrame(this);
setAttribute(Qt::WA_TranslucentBackground, false);
}
}
#endif
if(!hasFocus()) setWindowOpacity(0.9);
@@ -20,6 +20,7 @@
#include <ui_savingnotificationdialog.h>
#ifdef Q_OS_WIN
#include <QtWin>
#include <QSysInfo>
#endif

SavingNotificationDialog::SavingNotificationDialog(bool showDiscardButton, DialogType dType, QWidget *parent) :
@@ -43,22 +44,25 @@ SavingNotificationDialog::SavingNotificationDialog(bool showDiscardButton, Dialo
}

#ifdef Q_OS_WIN
if(QtWin::isCompositionEnabled())
if(QSysInfo::WindowsVersion>=QSysInfo::WV_VISTA)
{
this->setAttribute(Qt::WA_TranslucentBackground, true);
QtWin::extendFrameIntoClientArea(this, -1,-1,-1,-1);
QtWin::enableBlurBehindWindow(this);
}
else
{
QtWin::resetExtendedFrame(this);
setAttribute(Qt::WA_TranslucentBackground, false);
}
if(QtWin::isCompositionEnabled())
{
this->setAttribute(Qt::WA_TranslucentBackground, true);
QtWin::extendFrameIntoClientArea(this, -1,-1,-1,-1);
QtWin::enableBlurBehindWindow(this);
}
else
{
QtWin::resetExtendedFrame(this);
setAttribute(Qt::WA_TranslucentBackground, false);
}

switch(dType)
{
case D_WARN: PlaySound(L"SystemAsterisk", NULL, SND_ASYNC);break;
case D_QUESTION: PlaySound(L"SystemQuestion", NULL, SND_ASYNC);break;
switch(dType)
{
case D_WARN: PlaySound(L"SystemAsterisk", NULL, SND_ASYNC);break;
case D_QUESTION: PlaySound(L"SystemQuestion", NULL, SND_ASYNC);break;
}
}
#endif
switch(dType)
@@ -38,6 +38,7 @@

#include "mainwindow.h"


int main(int argc, char *argv[])
{
CrashHandler::initCrashHandlers();
@@ -20,6 +20,7 @@
#include <ui_aboutdialog.h>
#ifdef Q_OS_WIN
#include <QtWin>
#include <QSysInfo>
#endif
#include <QFile>
#include <QTextStream>
@@ -38,16 +39,19 @@ aboutDialog::aboutDialog(QWidget *parent) :
#ifdef Q_OS_WIN
this->setWindowIcon(QIcon(":/cat_builder.ico"));

if(QtWin::isCompositionEnabled())
if(QSysInfo::WindowsVersion>=QSysInfo::WV_VISTA)
{
this->setAttribute(Qt::WA_TranslucentBackground, true);
QtWin::extendFrameIntoClientArea(this, -1,-1,-1, -1);
QtWin::enableBlurBehindWindow(this);
}
else
{
QtWin::resetExtendedFrame(this);
setAttribute(Qt::WA_TranslucentBackground, false);
if(QtWin::isCompositionEnabled())
{
this->setAttribute(Qt::WA_TranslucentBackground, true);
QtWin::extendFrameIntoClientArea(this, -1,-1,-1, -1);
QtWin::enableBlurBehindWindow(this);
}
else
{
QtWin::resetExtendedFrame(this);
setAttribute(Qt::WA_TranslucentBackground, false);
}
}
#endif

@@ -24,6 +24,7 @@
#include <QByteArray>
#ifdef Q_OS_WIN
#include <QtWin>
#include <QSysInfo>
#endif

#include <common_features/app_path.h>
@@ -49,17 +50,20 @@ AppSettings::AppSettings(QWidget *parent) :
#ifdef Q_OS_WIN
this->setWindowIcon(QIcon(":/cat_builder.ico"));

if(QtWin::isCompositionEnabled())
if(QSysInfo::WindowsVersion>=QSysInfo::WV_VISTA)
{
this->setAttribute(Qt::WA_TranslucentBackground, true);
QtWin::extendFrameIntoClientArea(this, -1,-1,-1,-1);
QtWin::enableBlurBehindWindow(this);
ui->gridLayout->setMargin(0);
}
else
{
QtWin::resetExtendedFrame(this);
setAttribute(Qt::WA_TranslucentBackground, false);
if(QtWin::isCompositionEnabled())
{
this->setAttribute(Qt::WA_TranslucentBackground, true);
QtWin::extendFrameIntoClientArea(this, -1,-1,-1,-1);
QtWin::enableBlurBehindWindow(this);
ui->gridLayout->setMargin(0);
}
else
{
QtWin::resetExtendedFrame(this);
setAttribute(Qt::WA_TranslucentBackground, false);
}
}
#endif

@@ -3,9 +3,13 @@

#ifdef Q_OS_WIN
#include <QtWinExtras>
#include <QSysInfo>
#include <WinBase.h>

void MainWindow::initWindowsThumbnail()
{
if(QSysInfo::WindowsVersion<QSysInfo::WV_VISTA) return;

pge_thumbbar = new QWinThumbnailToolBar(this);
pge_thumbbar->setWindow(this->windowHandle());

@@ -36,6 +40,7 @@ void MainWindow::initWindowsThumbnail()

void MainWindow::updateWindowsExtrasPixmap()
{
if(QSysInfo::WindowsVersion<QSysInfo::WV_VISTA) return;
QRect viewPort;

if(!LastActiveSubWindow){
@@ -82,6 +87,8 @@ void MainWindow::updateWindowsExtrasPixmap()

void MainWindow::drawWindowsDefaults()
{
if(QSysInfo::WindowsVersion<QSysInfo::WV_VISTA) return;

QPixmap defThumbPixmap(400,300);
QPixmap defLivePreviewPixmap(size());
QPainter defThumbPainter(&defThumbPixmap);
@@ -100,5 +107,4 @@ void MainWindow::drawWindowsDefaults()
pge_thumbbar->setIconicLivePreviewPixmap(defLivePreviewPixmap);
}


#endif
@@ -173,6 +173,10 @@ MainWindow::MainWindow(QMdiArea *parent) :

MainWindow::~MainWindow()
{
#ifdef Q_OS_WIN
if(pge_thumbbar)
delete pge_thumbbar;
#endif
delete ui;
}

0 comments on commit 5aaa917

Please sign in to comment.