Skip to content

Commit

Permalink
Merge pull request #1408 from Autodesk/donnels/MAYA-111084/layer_edit…
Browse files Browse the repository at this point in the history
…or_icon_missing_at_scaling_125

MAYA-111084 - LE save icon missing when scaling is 125%
  • Loading branch information
Krystian Ligenza authored May 14, 2021
2 parents 2b81281 + 3235f78 commit ac2fb6a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/usd/ui/layerEditor/layerEditorWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,16 @@ using namespace UsdLayerEditor;
// properly support high dpi with style sheets
QString getDPIPixmapName(QString baseName)
{
QString suffix(QString::number(IS_MAC_OS ? 100 : DPIScale(100)));
return baseName + "_" + suffix + ".png";
#ifdef Q_OS_DARWIN
return baseName + "_100.png";
#else
const auto scale = utils->dpiScale();
if (scale >= 2.0)
return baseName + "_200.png";
else if (scale >= 1.5)
return baseName + "_150.png";
return baseName + "_100.png";
#endif
}

// setup a push button with DPI-appropriate regular, hover and pressed png in the
Expand All @@ -71,6 +79,8 @@ static void setupButtonWithHIGBitmaps(QPushButton* button, QString baseName)
QPushButton {
padding : %1px;
background-image: url(%2);
background-position: center center;
background-repeat: no-repeat;
border: 0px;
background-origin: content;
}
Expand Down

0 comments on commit ac2fb6a

Please sign in to comment.