Skip to content

Commit

Permalink
Add hint about Cat
Browse files Browse the repository at this point in the history
Signed-off-by: Tayou <tayou@gmx.net>
  • Loading branch information
Tayou committed Jan 10, 2023
1 parent 003bb61 commit 77add06
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 20 deletions.
15 changes: 14 additions & 1 deletion launcher/ui/setupwizard/ThemeWizardPage.ui
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<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="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
Expand All @@ -41,7 +51,7 @@
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Icon Preview:</string>
<string> Preview:</string>
</property>
</widget>
</item>
Expand Down Expand Up @@ -317,6 +327,9 @@
<height>256</height>
</size>
</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">
<string/>
</property>
Expand Down
14 changes: 8 additions & 6 deletions launcher/ui/widgets/ThemeCustomizationWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,11 @@ void ThemeCustomizationWidget::showFeatures(ThemeFields features) {

void ThemeCustomizationWidget::applyIconTheme(int index) {
auto settings = APPLICATION->settings();
auto original = settings->get("IconTheme").toString();
settings->set("IconTheme", m_iconThemeOptions[index].first);
auto originalIconTheme = settings->get("IconTheme").toString();
auto& newIconTheme = m_iconThemeOptions[index].first;
settings->set("IconTheme", newIconTheme);

if (original != settings->get("IconTheme")) {
if (originalIconTheme != newIconTheme) {
APPLICATION->applyCurrentlySelectedTheme();
}

Expand Down Expand Up @@ -113,7 +114,8 @@ void ThemeCustomizationWidget::loadSettings()

auto iconTheme = settings->get("IconTheme").toString();
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) {
ui->iconsComboBox->setCurrentIndex(ui->iconsComboBox->count() - 1);
}
Expand All @@ -134,8 +136,8 @@ void ThemeCustomizationWidget::loadSettings()

auto cat = settings->get("BackgroundCat").toString();
for (auto& catFromList : m_catOptions) {
ui->backgroundCatComboBox->addItem(QIcon(QString(":/backgrounds/%1").arg(ThemeManager::getCatImage(catFromList.first))),
catFromList.second);
QIcon catIcon = QIcon(QString(":/backgrounds/%1").arg(ThemeManager::getCatImage(catFromList.first)));
ui->backgroundCatComboBox->addItem(catIcon, catFromList.second);
if (cat == catFromList.first) {
ui->backgroundCatComboBox->setCurrentIndex(ui->backgroundCatComboBox->count() - 1);
}
Expand Down
2 changes: 1 addition & 1 deletion launcher/ui/widgets/ThemeCustomizationWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ class ThemeCustomizationWidget : public QWidget {
{ "rory-flat", QObject::tr("Rory ID 11 (flat edition, drawn by Ashtaka)") },
{ "teawie", QObject::tr("Teawie (drawn by SympathyTea)") }
};
};
};
51 changes: 39 additions & 12 deletions launcher/ui/widgets/ThemeCustomizationWidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>400</width>
<height>311</height>
<height>191</height>
</rect>
</property>
<property name="windowTitle">
Expand Down Expand Up @@ -77,6 +77,9 @@
</item>
<item row="2" column="0">
<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">
<string>C&amp;at</string>
</property>
Expand All @@ -86,17 +89,41 @@
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="backgroundCatComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
</widget>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QComboBox" name="backgroundCatComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<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>
</layout>
</widget>
Expand Down

0 comments on commit 77add06

Please sign in to comment.