From 31e2f133723e0e063be349194009f38247163b61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole-Andr=C3=A9=20Rodlie?= Date: Sun, 11 Aug 2024 01:47:26 +0200 Subject: [PATCH] HiDPI: try to fix issues on Windows (part deux) --- src/app/GUI/ColorWidgets/colorsettingswidget.cpp | 4 ++-- src/app/GUI/fillstrokesettings.cpp | 15 ++++++++++++--- src/ui/gradientwidgets/gradientwidget.cpp | 13 +++++++++---- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/app/GUI/ColorWidgets/colorsettingswidget.cpp b/src/app/GUI/ColorWidgets/colorsettingswidget.cpp index ea12d7302..e86cde521 100644 --- a/src/app/GUI/ColorWidgets/colorsettingswidget.cpp +++ b/src/app/GUI/ColorWidgets/colorsettingswidget.cpp @@ -382,9 +382,9 @@ ColorSettingsWidget::ColorSettingsWidget(QWidget *parent) connect(mPickingButton, &QPushButton::released, this, &ColorSettingsWidget::startColorPicking); eSizesUI::widget.add(mPickingButton, [this](const int size) { - mPickingButton->setFixedHeight(size); + mPickingButton->setFixedSize(size, size); //if (eSettings::instance().fCurrentInterfaceDPI != 1.) { - mPickingButton->setIconSize(QSize(size, size)); + //mPickingButton->setIconSize(QSize(size, size)); //} }); diff --git a/src/app/GUI/fillstrokesettings.cpp b/src/app/GUI/fillstrokesettings.cpp index 3916dde09..64ed6a56d 100644 --- a/src/app/GUI/fillstrokesettings.cpp +++ b/src/app/GUI/fillstrokesettings.cpp @@ -262,7 +262,14 @@ FillStrokeSettingsWidget::FillStrokeSettingsWidget(Document &document, mFlatCapStyleButton->setFixedHeight(size); mSquareCapStyleButton->setFixedHeight(size); mRoundCapStyleButton->setFixedHeight(size); - if (eSettings::instance().fCurrentInterfaceDPI != 1.) { + mFillTargetButton->setFixedHeight(size); + mStrokeTargetButton->setFixedHeight(size); + mFillNoneButton->setFixedHeight(size); + mFillFlatButton->setFixedHeight(size); + mFillGradientButton->setFixedHeight(size); + mLinearGradientButton->setFixedHeight(size); + mRadialGradientButton->setFixedHeight(size); + /*if (eSettings::instance().fCurrentInterfaceDPI != 1.) { mBevelJoinStyleButton->setIconSize(QSize(size, size)); mMiterJointStyleButton->setIconSize(QSize(size, size)); mRoundJoinStyleButton->setIconSize(QSize(size, size)); @@ -276,7 +283,7 @@ FillStrokeSettingsWidget::FillStrokeSettingsWidget(Document &document, mFillGradientButton->setIconSize(QSize(size, size)); mLinearGradientButton->setIconSize(QSize(size, size)); mRadialGradientButton->setIconSize(QSize(size, size)); - } + }*/ }); // layout @@ -309,6 +316,8 @@ FillStrokeSettingsWidget::FillStrokeSettingsWidget(Document &document, mColorTypeLayout->addWidget(mFillGradientButton); const auto mFillAndStrokeWidget = new QWidget(this); + mFillAndStrokeWidget->setContentsMargins(0, 0, 0, 0); + const auto mMainLayout = new QVBoxLayout(mFillAndStrokeWidget); mMainLayout->addWidget(mTargetWidget); @@ -324,7 +333,7 @@ FillStrokeSettingsWidget::FillStrokeSettingsWidget(Document &document, mFillStrokeArea->setWidget(mFillAndStrokeWidget); const auto mLayout = new QVBoxLayout(this); - + mLayout->setContentsMargins(0,0,0,0); mLayout->setMargin(0); mLayout->addWidget(mFillStrokeArea); diff --git a/src/ui/gradientwidgets/gradientwidget.cpp b/src/ui/gradientwidgets/gradientwidget.cpp index 0ff812903..c9c212714 100644 --- a/src/ui/gradientwidgets/gradientwidget.cpp +++ b/src/ui/gradientwidgets/gradientwidget.cpp @@ -113,9 +113,11 @@ GradientWidget::GradientWidget(QWidget * const parent) cLayout->addWidget(buttonAdd); cLayout->addWidget(buttonRem); cLayout->addWidget(buttonDup); + cLayout->addStretch(); mMainLayout->addWidget(aWidget); mMainLayout->addWidget(bWidget); + mMainLayout->addStretch(); /*eSizesUI::widget.add(this, [this](const int size) { const qreal mult = (3 + mNumberVisibleGradients + 0.5); @@ -128,13 +130,16 @@ GradientWidget::GradientWidget(QWidget * const parent) &buttonAdd, &buttonRem, &buttonDup](const int size) { - buttonAddColor->setFixedHeight(size); - buttonRemColor->setFixedHeight(size); - buttonAddColor->setIconSize(QSize(size, size)); + buttonAddColor->setFixedSize(size, size); + buttonRemColor->setFixedSize(size, size); + buttonAdd->setFixedHeight(size); + buttonRem->setFixedHeight(size); + buttonDup->setFixedHeight(size); + /*buttonAddColor->setIconSize(QSize(size, size)); buttonRemColor->setIconSize(QSize(size, size)); buttonAdd->setIconSize(QSize(size, size)); buttonRem->setIconSize(QSize(size, size)); - buttonDup->setIconSize(QSize(size, size)); + buttonDup->setIconSize(QSize(size, size));*/ }); const auto list = mGradientsListWidget->getList();