diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2022-02-21 19:16:49 +0100 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2022-02-28 20:37:32 +0100 |
commit | 8d462a1edd6e7446746947bcb9537f1c800d38ef (patch) | |
tree | 92ef1c1f012073d2d95948d85a8c491e099a00d5 /utils | |
parent | 83e4078d9c9902ee184955817a0fae0320a54b53 (diff) | |
download | rockbox-8d462a1edd6e7446746947bcb9537f1c800d38ef.tar.gz rockbox-8d462a1edd6e7446746947bcb9537f1c800d38ef.zip |
rbutil: Rework Logo display.
Replace QLabel with QSvgWidget so the widget draws the svg directly
instead of first creating a pixmap from it.
This also avoids an issue when building with mxe which causes the image
to not show due to a missing svg plugin (which doesn't happen for svg
icons.)
Change-Id: Ic4e265f0567984d1ffe7a3e1cc641df27755e90b
Diffstat (limited to 'utils')
-rw-r--r-- | utils/rbutilqt/CMakeLists.txt | 3 | ||||
-rw-r--r-- | utils/rbutilqt/rbutilqt.cpp | 1 | ||||
-rw-r--r-- | utils/rbutilqt/rbutilqtfrm.ui | 40 |
3 files changed, 24 insertions, 20 deletions
diff --git a/utils/rbutilqt/CMakeLists.txt b/utils/rbutilqt/CMakeLists.txt index cc1ecd575c..d0ac4d9a54 100644 --- a/utils/rbutilqt/CMakeLists.txt +++ b/utils/rbutilqt/CMakeLists.txt | |||
@@ -123,7 +123,8 @@ if(APPLE) | |||
123 | endif() | 123 | endif() |
124 | 124 | ||
125 | target_link_libraries(RockboxUtility rbbase cutelogger gitversion | 125 | target_link_libraries(RockboxUtility rbbase cutelogger gitversion |
126 | Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Multimedia) | 126 | Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Multimedia |
127 | Qt${QT_VERSION_MAJOR}::Svg) | ||
127 | 128 | ||
128 | target_include_directories(RockboxUtility PRIVATE | 129 | target_include_directories(RockboxUtility PRIVATE |
129 | ${CMAKE_CURRENT_LIST_DIR}/gui | 130 | ${CMAKE_CURRENT_LIST_DIR}/gui |
diff --git a/utils/rbutilqt/rbutilqt.cpp b/utils/rbutilqt/rbutilqt.cpp index aa405418be..271d252391 100644 --- a/utils/rbutilqt/rbutilqt.cpp +++ b/utils/rbutilqt/rbutilqt.cpp | |||
@@ -88,6 +88,7 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent) | |||
88 | ui.setupUi(this); | 88 | ui.setupUi(this); |
89 | QIcon windowIcon(":/icons/rockbox-clef.svg"); | 89 | QIcon windowIcon(":/icons/rockbox-clef.svg"); |
90 | this->setWindowIcon(windowIcon); | 90 | this->setWindowIcon(windowIcon); |
91 | ui.logoLabel->load(QLatin1String(":/icons/rockbox-logo.svg")); | ||
91 | #if defined(Q_OS_MACX) | 92 | #if defined(Q_OS_MACX) |
92 | // don't translate menu entries that are handled specially on OS X | 93 | // don't translate menu entries that are handled specially on OS X |
93 | // (Configure, Quit). Qt handles them for us if they use english string. | 94 | // (Configure, Quit). Qt handles them for us if they use english string. |
diff --git a/utils/rbutilqt/rbutilqtfrm.ui b/utils/rbutilqt/rbutilqtfrm.ui index af47fea72c..5c78c812a8 100644 --- a/utils/rbutilqt/rbutilqtfrm.ui +++ b/utils/rbutilqt/rbutilqtfrm.ui | |||
@@ -6,8 +6,8 @@ | |||
6 | <rect> | 6 | <rect> |
7 | <x>0</x> | 7 | <x>0</x> |
8 | <y>0</y> | 8 | <y>0</y> |
9 | <width>650</width> | 9 | <width>631</width> |
10 | <height>399</height> | 10 | <height>441</height> |
11 | </rect> | 11 | </rect> |
12 | </property> | 12 | </property> |
13 | <property name="windowTitle"> | 13 | <property name="windowTitle"> |
@@ -19,8 +19,8 @@ | |||
19 | </property> | 19 | </property> |
20 | <widget class="QWidget" name="centralwidget"> | 20 | <widget class="QWidget" name="centralwidget"> |
21 | <layout class="QGridLayout" name="gridLayout_3"> | 21 | <layout class="QGridLayout" name="gridLayout_3"> |
22 | <item row="0" column="0"> | 22 | <item row="0" column="1"> |
23 | <widget class="QLabel" name="logoLabel"> | 23 | <widget class="QSvgWidget" name="logoLabel" native="true"> |
24 | <property name="minimumSize"> | 24 | <property name="minimumSize"> |
25 | <size> | 25 | <size> |
26 | <width>200</width> | 26 | <width>200</width> |
@@ -39,21 +39,15 @@ | |||
39 | <height>62</height> | 39 | <height>62</height> |
40 | </size> | 40 | </size> |
41 | </property> | 41 | </property> |
42 | <property name="text"> | 42 | <property name="toolTip"> |
43 | <string comment="Welcome to Rockbox Utility, the installation and housekeeping tool for Rockbox."/> | 43 | <string>Welcome to Rockbox Utility, the installation and housekeeping tool for Rockbox.</string> |
44 | </property> | ||
45 | <property name="pixmap"> | ||
46 | <pixmap resource="rbutilqt.qrc">:/icons/rockbox-logo.svg</pixmap> | ||
47 | </property> | 44 | </property> |
48 | <property name="scaledContents"> | 45 | <property name="accessibleName"> |
49 | <bool>true</bool> | 46 | <string>Rockbox Logo</string> |
50 | </property> | ||
51 | <property name="alignment"> | ||
52 | <set>Qt::AlignCenter</set> | ||
53 | </property> | 47 | </property> |
54 | </widget> | 48 | </widget> |
55 | </item> | 49 | </item> |
56 | <item row="0" column="1"> | 50 | <item row="0" column="2"> |
57 | <widget class="QGroupBox" name="groupBoxDevice"> | 51 | <widget class="QGroupBox" name="groupBoxDevice"> |
58 | <property name="sizePolicy"> | 52 | <property name="sizePolicy"> |
59 | <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> | 53 | <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> |
@@ -74,7 +68,7 @@ | |||
74 | <string/> | 68 | <string/> |
75 | </property> | 69 | </property> |
76 | <property name="pixmap"> | 70 | <property name="pixmap"> |
77 | <pixmap resource="rbutilqt.qrc">:/icons/rockbox-32.png</pixmap> | 71 | <pixmap>:/icons/rockbox-32.png</pixmap> |
78 | </property> | 72 | </property> |
79 | <property name="scaledContents"> | 73 | <property name="scaledContents"> |
80 | <bool>false</bool> | 74 | <bool>false</bool> |
@@ -159,7 +153,7 @@ | |||
159 | </layout> | 153 | </layout> |
160 | </widget> | 154 | </widget> |
161 | </item> | 155 | </item> |
162 | <item row="1" column="0" colspan="2"> | 156 | <item row="1" column="0" colspan="3"> |
163 | <widget class="QTabWidget" name="tabWidget"> | 157 | <widget class="QTabWidget" name="tabWidget"> |
164 | <property name="currentIndex"> | 158 | <property name="currentIndex"> |
165 | <number>0</number> | 159 | <number>0</number> |
@@ -384,8 +378,8 @@ | |||
384 | <rect> | 378 | <rect> |
385 | <x>0</x> | 379 | <x>0</x> |
386 | <y>0</y> | 380 | <y>0</y> |
387 | <width>650</width> | 381 | <width>631</width> |
388 | <height>22</height> | 382 | <height>30</height> |
389 | </rect> | 383 | </rect> |
390 | </property> | 384 | </property> |
391 | <widget class="QMenu" name="menu_File"> | 385 | <widget class="QMenu" name="menu_File"> |
@@ -632,6 +626,14 @@ | |||
632 | </property> | 626 | </property> |
633 | </action> | 627 | </action> |
634 | </widget> | 628 | </widget> |
629 | <customwidgets> | ||
630 | <customwidget> | ||
631 | <class>QSvgWidget</class> | ||
632 | <extends>QWidget</extends> | ||
633 | <header location="global">QSvgWidget</header> | ||
634 | <container>1</container> | ||
635 | </customwidget> | ||
636 | </customwidgets> | ||
635 | <tabstops> | 637 | <tabstops> |
636 | <tabstop>tabWidget</tabstop> | 638 | <tabstop>tabWidget</tabstop> |
637 | <tabstop>buttonChangeDevice</tabstop> | 639 | <tabstop>buttonChangeDevice</tabstop> |