Skip to content

Commit

Permalink
HiDPI stuff
Browse files Browse the repository at this point in the history
Disable SVG icons (again), we only used 3 as a workaround for hidpi issues when using pixmaps in css, but that has now been fixed.

We are now ~99% done with HiDPI UI support.
  • Loading branch information
rodlie committed Aug 11, 2024
1 parent a00c6b4 commit 8b0ba2b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 26 deletions.
10 changes: 5 additions & 5 deletions src/app/friction.qss
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ QSpinBox::down-button {
}
QDoubleSpinBox::up-arrow,
QSpinBox::up-arrow {
image: url(:/icons/hicolor/scalable/actions/go-up.svg); /* half */
image: url(:/icons/hicolor/%11x%11/actions/go-up.png);
width: %10px;
height: %10px;
}
QDoubleSpinBox::down-arrow,
QSpinBox::down-arrow {
image: url(:/icons/hicolor/scalable/actions/go-down.svg); /* half */
image: url(:/icons/hicolor/%11x%11/actions/go-down.png);
width: %10px;
height: %10px;
}
Expand Down Expand Up @@ -229,7 +229,7 @@ QComboBox::drop-down:button{

QToolButton::menu-arrow,
QComboBox::down-arrow {
image: url(:/icons/hicolor/scalable/actions/go-down.svg); /* full */
image: url(:/icons/hicolor/%11x%11/actions/go-down.png);
width: %7px;
height: %7px;
}
Expand Down Expand Up @@ -490,13 +490,13 @@ QCheckBox::indicator:hover:unchecked {
}

QCheckBox::indicator:checked {
image: url(:/icons/hicolor/scalable/actions/dialog-ok.svg);
image: url(:/icons/hicolor/%11x%11/actions/dialog-ok.png);
width: %7px;
height: %7px;
}

QCheckBox::indicator:unchecked {
image: url(:/icons/hicolor/scalable/actions/dialog-cancel.svg);
image: url(:/icons/hicolor/%11x%11/actions/dialog-cancel.png);
width: %7px;
height: %7px;
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/icons
Submodule icons updated 2 files
+3 −3 build.sh
+0 −2,296 hicolor.qrc
4 changes: 2 additions & 2 deletions src/cmake/friction-common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ find_package(
Multimedia
Qml
Xml
Svg
#Svg
REQUIRED
)
set(QT_LIBRARIES
Expand All @@ -98,7 +98,7 @@ set(QT_LIBRARIES
Qt${QT_VERSION_MAJOR}::Multimedia
Qt${QT_VERSION_MAJOR}::Qml
Qt${QT_VERSION_MAJOR}::Xml
Qt${QT_VERSION_MAJOR}::Svg
#Qt${QT_VERSION_MAJOR}::Svg
)

if(WIN32)
Expand Down
15 changes: 0 additions & 15 deletions src/core/themesupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,21 +192,6 @@ const QString ThemeSupport::getThemeStyle(int iconSize)
css = stylesheet.readAll();
stylesheet.close();
}
#ifdef Q_OS_WIN
// svg in qss on windows are broken!
css.replace("/scalable/actions/go-up.svg); /* half */",
"/%11x%11/actions/go-up.png);");
css.replace("/scalable/actions/go-up.svg); /* full */",
"/%11x%11/actions/go-up.png);");
css.replace("/scalable/actions/go-down.svg); /* half */",
"/%11x%11/actions/go-down.png);");
css.replace("/scalable/actions/go-down.svg); /* full */",
"/%11x%11/actions/go-down.png);");
css.replace("/scalable/actions/dialog-ok.svg",
"/%11x%11/actions/dialog-ok.png");
css.replace("/scalable/actions/dialog-cancel.svg",
"/%11x%11/actions/dialog-cancel.png");
#endif
const qreal iconPixelRatio = iconSize * qApp->desktop()->devicePixelRatioF();
return css.arg(getThemeButtonBaseColor().name(),
getThemeButtonBorderColor().name(),
Expand Down
6 changes: 3 additions & 3 deletions src/scripts/build_ci.bat
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ set OUTPUT_DIR="%CWD%\build\output\friction-%VERSION%"
mkdir "%OUTPUT_DIR%"
mkdir "%OUTPUT_DIR%\audio"
mkdir "%OUTPUT_DIR%\platforms"
mkdir "%OUTPUT_DIR%\imageformats"
REM mkdir "%OUTPUT_DIR%\imageformats"

copy "%CWD%\build\src\core\%BDIR%\frictioncore.dll" "%OUTPUT_DIR%\"
copy "%CWD%\build\src\ui\%BDIR%\frictionui.dll" "%OUTPUT_DIR%\"
Expand All @@ -71,13 +71,13 @@ copy "%SDK_DIR%\bin\Qt5Network.dll" "%OUTPUT_DIR%\"
copy "%SDK_DIR%\bin\Qt5OpenGL.dll" "%OUTPUT_DIR%\"
copy "%SDK_DIR%\bin\Qt5PrintSupport.dll" "%OUTPUT_DIR%\"
copy "%SDK_DIR%\bin\Qt5Qml.dll" "%OUTPUT_DIR%\"
copy "%SDK_DIR%\bin\Qt5Svg.dll" "%OUTPUT_DIR%\"
REM copy "%SDK_DIR%\bin\Qt5Svg.dll" "%OUTPUT_DIR%\"
copy "%SDK_DIR%\bin\Qt5Widgets.dll" "%OUTPUT_DIR%\"
copy "%SDK_DIR%\bin\Qt5Xml.dll" "%OUTPUT_DIR%\"
copy "%SDK_DIR%\bin\qscintilla2_qt5.dll" "%OUTPUT_DIR%\"
copy "%SDK_DIR%\plugins\audio\qtaudio_wasapi.dll" "%OUTPUT_DIR%\audio\"
copy "%SDK_DIR%\plugins\platforms\qwindows.dll" "%OUTPUT_DIR%\platforms\"
copy "%SDK_DIR%\plugins\imageformats\qsvg.dll" "%OUTPUT_DIR%\imageformats\"
REM copy "%SDK_DIR%\plugins\imageformats\qsvg.dll" "%OUTPUT_DIR%\imageformats\"
copy "%SDK_DIR%\bin\avcodec-58.dll" "%OUTPUT_DIR%\"
copy "%SDK_DIR%\bin\avdevice-58.dll" "%OUTPUT_DIR%\"
copy "%SDK_DIR%\bin\avformat-58.dll" "%OUTPUT_DIR%\"
Expand Down

0 comments on commit 8b0ba2b

Please sign in to comment.