ui: Fixed icons in setup dialogs blurry on high DPI screens

This commit is contained in:
Eberhard Graether
2017-02-14 13:39:01 +01:00
parent 78f8fdc552
commit 591f723b82
10 changed files with 102 additions and 77 deletions
@@ -3,17 +3,24 @@
#include <QMessageBox>
#include "qt/window/QtTextEditDialog.h"
#include "utility/ResourcePaths.h"
#include "utility/utilityString.h"
QtHelpButton::QtHelpButton(const QString& helpText, QWidget* parent)
: QPushButton("", parent)
: QtIconButton(
(ResourcePaths::getGuiPath() + "window/help.png").c_str(),
(ResourcePaths::getGuiPath() + "window/help_hover.png").c_str(),
parent)
, m_helpText(helpText)
{
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
setObjectName("helpButton");
setMouseTracking(true);
setToolTip("help");
leaveEvent(nullptr);
connect(this, SIGNAL(clicked()), this, SLOT(handleHelpPress()));
}
@@ -3,17 +3,17 @@
#include <QGridLayout>
#include <QLabel>
#include <QPushButton>
#include <QToolButton>
#include <QWidget>
#include "qt/element/QtIconButton.h"
#include "qt/window/project_wizzard/QtProjectWizzardWindow.h"
#include "settings/ProjectSettings.h"
class QtTextEditDialog;
class QtHelpButton
: public QPushButton
: public QtIconButton
{
Q_OBJECT
@@ -3,6 +3,9 @@
#include <QMessageBox>
#include <QPushButton>
#include "utility/ResourcePaths.h"
#include "qt/element/QtIconButton.h"
#include "qt/element/QtLocationPicker.h"
#include "settings/CxxProjectSettings.h"
@@ -59,9 +62,9 @@ void QtProjectWizzardContentBuildFile::populate(QGridLayout* layout, int& row)
m_picker->setFileFilter(filter);
m_picker->setRelativeRootDirectory(m_settings->getProjectFileLocation());
QPushButton* button = new QPushButton("", this);
button->setObjectName("refreshButton");
button->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
QPushButton* button = new QtIconButton(
(ResourcePaths::getGuiPath() + "window/refresh.png").c_str(),
(ResourcePaths::getGuiPath() + "window/refresh_hover.png").c_str());
button->setToolTip("refresh paths");
connect(button, SIGNAL(clicked()), this, SLOT(refreshClicked()));