Skip to content

Commit

Permalink
Theme: hidpi stuff
Browse files Browse the repository at this point in the history
Reintroduces QtSvg as a dependency again. We have to use SVG's in CSS, else we get issues with display scaling 200% etc, but we do not use SVG elsewhere, due to other issues... the joy of HiDPI.
  • Loading branch information
rodlie committed Aug 11, 2024
1 parent 28ed0ce commit 0ce7661
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 9 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Generic build instructions.
* Multimedia
* Qml
* Xml
* Svg
* qscintilla
* ffmpeg *(4.2.x)*
* libavformat
Expand Down
1 change: 1 addition & 0 deletions src/app/GUI/BoxesList/boxsinglewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,7 @@ void BoxSingleWidget::loadStaticPixmaps(int iconSize)
" If you still have issues after restarting please report this issue.</p>").arg(iconSize));
}
const auto pixmapSize = ThemeSupport::getIconSize(iconSize);
qDebug() << "pixmaps size" << pixmapSize;
VISIBLE_ICON = new QPixmap(QIcon::fromTheme("visible").pixmap(pixmapSize));
INVISIBLE_ICON = new QPixmap(QIcon::fromTheme("hidden").pixmap(pixmapSize));
BOX_CHILDREN_VISIBLE_ICON = new QPixmap(QIcon::fromTheme("visible-child").pixmap(pixmapSize));
Expand Down
2 changes: 1 addition & 1 deletion src/app/GUI/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ MainWindow::MainWindow(Document& document,
this, &MainWindow::handleNewVideoClip);

setWindowIcon(QIcon::fromTheme(AppSupport::getAppName()));
setMinimumSize(1024, 576);
//setMinimumSize(1024, 576);

mAutoSaveTimer = new QTimer(this);
connect (mAutoSaveTimer, &QTimer::timeout,
Expand Down
10 changes: 5 additions & 5 deletions src/app/friction.qss
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ QSpinBox::down-button {
}
QDoubleSpinBox::up-arrow,
QSpinBox::up-arrow {
image: url(:/icons/hicolor/%7x%7/actions/go-up.png);
image: url(:/icons/hicolor/scalable/actions/go-up.svg);
width: %7px;
height: %7px;
}
QDoubleSpinBox::down-arrow,
QSpinBox::down-arrow {
image: url(:/icons/hicolor/%7x%7/actions/go-down.png);
image: url(:/icons/hicolor/scalable/actions/go-down.svg);
width: %7px;
height: %7px;
}
Expand Down Expand Up @@ -226,7 +226,7 @@ QComboBox::drop-down:button{

QToolButton::menu-arrow,
QComboBox::down-arrow {
image: url(:/icons/hicolor/%7x%7/actions/go-down.png);
image: url(:/icons/hicolor/scalable/actions/go-down.svg);
}

QComboBox#blendModeCombo,
Expand Down Expand Up @@ -485,11 +485,11 @@ QCheckBox::indicator:hover:unchecked {
}

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

QCheckBox::indicator:unchecked {
image: url(:/icons/hicolor/%7x%7/actions/dialog-cancel.png);
image: url(:/icons/hicolor/scalable/actions/dialog-cancel.svg);
}

QProgressBar {
Expand Down
2 changes: 1 addition & 1 deletion src/app/icons
Submodule icons updated 2 files
+4 −0 build.sh
+2,296 −0 hicolor.qrc
2 changes: 2 additions & 0 deletions src/cmake/friction-common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ find_package(
Multimedia
Qml
Xml
Svg
REQUIRED
)
set(QT_LIBRARIES
Expand All @@ -97,6 +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
)

if(WIN32)
Expand Down
9 changes: 7 additions & 2 deletions src/core/themesupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <QFile>
#include <QIcon>
#include <QApplication>
#include <QDebug>

const QColor ThemeSupport::getQColor(int r,
int g,
Expand Down Expand Up @@ -237,8 +238,12 @@ const QSize ThemeSupport::getIconSize(const int size)
{
QSize requestedSize(size, size);
const auto iconSizes = getAvailableIconSizes();
if (iconSizes.contains(requestedSize)) { return requestedSize; }
return findClosestIconSize(size);
bool hasIconSize = iconSizes.contains(requestedSize);
qDebug() << "requested icon size" << size << hasIconSize << "available" << iconSizes;
if (hasIconSize) { return requestedSize; }
const auto foundIconSize = findClosestIconSize(size);
qDebug() << "found icon size replacement" << foundIconSize;
return foundIconSize;
}

bool ThemeSupport::hasIconSize(const int size)
Expand Down
1 change: 1 addition & 0 deletions src/scripts/build_ci.bat
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ 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%\"
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%\"
Expand Down

0 comments on commit 0ce7661

Please sign in to comment.