diff --git a/src/app/GUI/GradientWidgets/currentgradientwidget.cpp b/src/app/GUI/GradientWidgets/currentgradientwidget.cpp index d97b0f1ef..c13ef1353 100755 --- a/src/app/GUI/GradientWidgets/currentgradientwidget.cpp +++ b/src/app/GUI/GradientWidgets/currentgradientwidget.cpp @@ -54,6 +54,7 @@ void CurrentGradientWidget::setCurrentGradient(Gradient * const gradient) { } void CurrentGradientWidget::paintGL() { + qreal pixelRatio = devicePixelRatioF(); glClearColor(0.3f, 0.3f, 0.3f, 1); glClear(GL_COLOR_BUFFER_BIT); if(!mGradient) return; @@ -69,7 +70,10 @@ void CurrentGradientWidget::paintGL() { for(int j = 0; j < nColors; j++) { const QColor color = mGradient->getColorAt(j); const int cWidth = j == nColors - 1 ? width() - colX : xInc; - glViewport(colX, 0, cWidth, height()); + glViewport(colX * pixelRatio, + 0, + cWidth * pixelRatio, + height() * pixelRatio); const bool lightBorder = shouldValPointerBeLightHSV(color.hueF(), color.hsvSaturationF(), diff --git a/src/app/GUI/GradientWidgets/displayedgradientswidget.cpp b/src/app/GUI/GradientWidgets/displayedgradientswidget.cpp index e02d444df..ce3c36111 100755 --- a/src/app/GUI/GradientWidgets/displayedgradientswidget.cpp +++ b/src/app/GUI/GradientWidgets/displayedgradientswidget.cpp @@ -86,6 +86,7 @@ void DisplayedGradientsWidget::updateHeight() { #include "GUI/ColorWidgets/colorwidgetshaders.h" void DisplayedGradientsWidget::paintGL() { + qreal pixelRatio = devicePixelRatioF(); const int nVisible = qMin(mGradients.count() - mTopGradientId, mMaxVisibleGradients); int gradY = mDisplayedTop; @@ -104,7 +105,10 @@ void DisplayedGradientsWidget::paintGL() { eSizesUI::widget/(3.f*xInc), 1.f/3); for(int j = (nColors == 1 ? 0 : 1); j < nColors; j++) { const QColor color = gradient->getColorAt(j); - glViewport(xT, yInverted, qRound(xInc), eSizesUI::widget); + glViewport(xT * pixelRatio, + yInverted * pixelRatio, + qRound(xInc * pixelRatio), + eSizesUI::widget * pixelRatio); glUniform4f(GRADIENT_PROGRAM.fRGBAColor1Loc, lastColor.redF(), lastColor.greenF(), @@ -117,7 +121,10 @@ void DisplayedGradientsWidget::paintGL() { xT += qRound(xInc); lastColor = color; } - glViewport(0, yInverted, width(), eSizesUI::widget); + glViewport(0, + yInverted * pixelRatio, + width() * pixelRatio, + eSizesUI::widget * pixelRatio); if(gradient == mSelectedGradient) { glUseProgram(DOUBLE_BORDER_PROGRAM.fID); glUniform2f(DOUBLE_BORDER_PROGRAM.fInnerBorderSizeLoc, diff --git a/src/app/GUI/GradientWidgets/gradientslistwidget.cpp b/src/app/GUI/GradientWidgets/gradientslistwidget.cpp index e3bc35ac5..f755f61fc 100755 --- a/src/app/GUI/GradientWidgets/gradientslistwidget.cpp +++ b/src/app/GUI/GradientWidgets/gradientslistwidget.cpp @@ -30,6 +30,7 @@ GradientsListWidget::GradientsListWidget(QWidget *parent) : ScrollArea(parent) { + setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); eSizesUI::widget.add(this, [this](const int size) { setFixedHeight(6*size); verticalScrollBar()->setSingleStep(size);