Add hint about Cat

Signed-off-by: Tayou <tayou@gmx.net>
This commit is contained in:
Tayou 2023-01-09 18:40:58 +01:00
parent 5c48f0b458
commit 668b19d119
No known key found for this signature in database
GPG Key ID: 02CA43C1CB6E9887
4 changed files with 62 additions and 20 deletions

View File

@ -31,6 +31,16 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Hint: The cat appears in the background and is not shown by default. It is only made visible when pressing the Cat button in the Toolbar.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item> <item>
<widget class="Line" name="line"> <widget class="Line" name="line">
<property name="orientation"> <property name="orientation">
@ -41,7 +51,7 @@
<item> <item>
<widget class="QLabel" name="label_4"> <widget class="QLabel" name="label_4">
<property name="text"> <property name="text">
<string>Icon Preview:</string> <string> Preview:</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -317,6 +327,9 @@
<height>256</height> <height>256</height>
</size> </size>
</property> </property>
<property name="toolTip">
<string>The cat appears in the background and does not serve a purpose, it is purely visual.</string>
</property>
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>

View File

@ -72,10 +72,11 @@ void ThemeCustomizationWidget::showFeatures(ThemeFields features) {
void ThemeCustomizationWidget::applyIconTheme(int index) { void ThemeCustomizationWidget::applyIconTheme(int index) {
auto settings = APPLICATION->settings(); auto settings = APPLICATION->settings();
auto original = settings->get("IconTheme").toString(); auto originalIconTheme = settings->get("IconTheme").toString();
settings->set("IconTheme", m_iconThemeOptions[index].first); auto& newIconTheme = m_iconThemeOptions[index].first;
settings->set("IconTheme", newIconTheme);
if (original != settings->get("IconTheme")) { if (originalIconTheme != newIconTheme) {
APPLICATION->applyCurrentlySelectedTheme(); APPLICATION->applyCurrentlySelectedTheme();
} }
@ -113,7 +114,8 @@ void ThemeCustomizationWidget::loadSettings()
auto iconTheme = settings->get("IconTheme").toString(); auto iconTheme = settings->get("IconTheme").toString();
for (auto& iconThemeFromList : m_iconThemeOptions) { for (auto& iconThemeFromList : m_iconThemeOptions) {
ui->iconsComboBox->addItem(QIcon(QString(":/icons/%1/scalable/settings").arg(iconThemeFromList.first)), iconThemeFromList.second); QIcon iconForComboBox = QIcon(QString(":/icons/%1/scalable/settings").arg(iconThemeFromList.first));
ui->iconsComboBox->addItem(iconForComboBox, iconThemeFromList.second);
if (iconTheme == iconThemeFromList.first) { if (iconTheme == iconThemeFromList.first) {
ui->iconsComboBox->setCurrentIndex(ui->iconsComboBox->count() - 1); ui->iconsComboBox->setCurrentIndex(ui->iconsComboBox->count() - 1);
} }
@ -134,8 +136,8 @@ void ThemeCustomizationWidget::loadSettings()
auto cat = settings->get("BackgroundCat").toString(); auto cat = settings->get("BackgroundCat").toString();
for (auto& catFromList : m_catOptions) { for (auto& catFromList : m_catOptions) {
ui->backgroundCatComboBox->addItem(QIcon(QString(":/backgrounds/%1").arg(ThemeManager::getCatImage(catFromList.first))), QIcon catIcon = QIcon(QString(":/backgrounds/%1").arg(ThemeManager::getCatImage(catFromList.first)));
catFromList.second); ui->backgroundCatComboBox->addItem(catIcon, catFromList.second);
if (cat == catFromList.first) { if (cat == catFromList.first) {
ui->backgroundCatComboBox->setCurrentIndex(ui->backgroundCatComboBox->count() - 1); ui->backgroundCatComboBox->setCurrentIndex(ui->backgroundCatComboBox->count() - 1);
} }

View File

@ -74,4 +74,4 @@ class ThemeCustomizationWidget : public QWidget {
{ "rory-flat", QObject::tr("Rory ID 11 (flat edition, drawn by Ashtaka)") }, { "rory-flat", QObject::tr("Rory ID 11 (flat edition, drawn by Ashtaka)") },
{ "teawie", QObject::tr("Teawie (drawn by SympathyTea)") } { "teawie", QObject::tr("Teawie (drawn by SympathyTea)") }
}; };
}; };

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>400</width> <width>400</width>
<height>311</height> <height>191</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -77,6 +77,9 @@
</item> </item>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QLabel" name="backgroundCatLabel"> <widget class="QLabel" name="backgroundCatLabel">
<property name="toolTip">
<string>The cat appears in the background and is not shown by default. It is only made visible when pressing the Cat button in the Toolbar.</string>
</property>
<property name="text"> <property name="text">
<string>C&amp;at</string> <string>C&amp;at</string>
</property> </property>
@ -86,17 +89,41 @@
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="2" column="1">
<widget class="QComboBox" name="backgroundCatComboBox"> <layout class="QHBoxLayout" name="horizontalLayout">
<property name="sizePolicy"> <item>
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> <widget class="QComboBox" name="backgroundCatComboBox">
<horstretch>0</horstretch> <property name="sizePolicy">
<verstretch>0</verstretch> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
</sizepolicy> <horstretch>0</horstretch>
</property> <verstretch>0</verstretch>
<property name="focusPolicy"> </sizepolicy>
<enum>Qt::StrongFocus</enum> </property>
</property> <property name="focusPolicy">
</widget> <enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<string>The cat appears in the background and is not shown by default. It is only made visible when pressing the Cat button in the Toolbar.</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="catInfoLabel">
<property name="toolTip">
<string>The cat appears in the background and is not shown by default. It is only made visible when pressing the Cat button in the Toolbar.</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset theme="about">
<normaloff>.</normaloff>.</iconset>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item> </item>
</layout> </layout>
</widget> </widget>