Skip to content

Commit

Permalink
HiDPI: try to fix issues on Windows (part deux)
Browse files Browse the repository at this point in the history
  • Loading branch information
rodlie committed Aug 10, 2024
1 parent d90252e commit 31e2f13
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/app/GUI/ColorWidgets/colorsettingswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
//}
});

Expand Down
15 changes: 12 additions & 3 deletions src/app/GUI/fillstrokesettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -276,7 +283,7 @@ FillStrokeSettingsWidget::FillStrokeSettingsWidget(Document &document,
mFillGradientButton->setIconSize(QSize(size, size));
mLinearGradientButton->setIconSize(QSize(size, size));
mRadialGradientButton->setIconSize(QSize(size, size));
}
}*/
});

// layout
Expand Down Expand Up @@ -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);
Expand All @@ -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);

Expand Down
13 changes: 9 additions & 4 deletions src/ui/gradientwidgets/gradientwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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();
Expand Down

0 comments on commit 31e2f13

Please sign in to comment.