added window always on top option

This commit is contained in:
fourtf
2017-12-17 16:45:15 +01:00
parent c7feec20d8
commit 1ca4fb46d6
10 changed files with 63 additions and 27 deletions
+11
View File
@@ -1,5 +1,6 @@
#include "widgets/basewidget.hpp"
#include "colorscheme.hpp"
#include "settingsmanager.hpp"
//#include <QApplication>
#include <QDebug>
@@ -28,6 +29,12 @@ BaseWidget::BaseWidget(BaseWidget *parent)
this->init();
}
BaseWidget::BaseWidget(QWidget *parent)
: QWidget(parent)
, colorScheme(*ColorScheme::instance)
{
}
float BaseWidget::getDpiMultiplier()
{
BaseWidget *baseWidget = dynamic_cast<BaseWidget *>(this->window());
@@ -60,6 +67,10 @@ void BaseWidget::initAsWindow()
this->dpiMultiplier = dpi.value() / 96.f;
}
#endif
if (SettingsManager::getInstance().windowTopMost.getValue()) {
this->setWindowFlags(this->windowFlags() | Qt::WindowStaysOnTopHint);
}
}
void BaseWidget::refreshTheme()