Add a way to change the position of the cat.
This simple commit adds the ability to further customize the cat by allowing the user to change its position. Signed-off-by: xSlendiX <slendi@socopon.com>
This commit is contained in:
parent
7f226eba9c
commit
58bc61ccbd
@ -605,6 +605,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
|
||||
// The cat
|
||||
m_settings->registerSetting("TheCat", false);
|
||||
m_settings->registerSetting("CatStyle", "BackgroundCat");
|
||||
m_settings->registerSetting("CatPosition", "top right");
|
||||
|
||||
m_settings->registerSetting("InstSortMode", "Name");
|
||||
m_settings->registerSetting("SelectedInstance", QString());
|
||||
|
@ -1620,16 +1620,21 @@ void MainWindow::setCatBackground(bool enabled)
|
||||
else {
|
||||
cat += "Cat";
|
||||
}
|
||||
|
||||
auto cat_position = APPLICATION->settings()->get("CatPosition").toString().toLower().trimmed();
|
||||
if (cat_position != "top left" && cat_position != "bottom left" && cat_position != "bottom right" && cat_position != "top right")
|
||||
cat_position = "top right";
|
||||
|
||||
view->setStyleSheet(QString(R"(
|
||||
InstanceView
|
||||
{
|
||||
background-image: url(:/backgrounds/%1);
|
||||
background-attachment: fixed;
|
||||
background-clip: padding;
|
||||
background-position: top right;
|
||||
background-position: %2;
|
||||
background-repeat: none;
|
||||
background-color:palette(base);
|
||||
})").arg(cat));
|
||||
})").arg(cat, cat_position));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -322,6 +322,11 @@ void LauncherPage::applySettings()
|
||||
s->set("CatStyle", ui->themeComboBoxCat->currentText());
|
||||
}
|
||||
|
||||
if(s->get("CatPosition") != ui->themeComboBoxCatPosition->currentData())
|
||||
{
|
||||
s->set("CatPosition", ui->themeComboBoxCatPosition->currentData());
|
||||
}
|
||||
|
||||
if(original != s->get("IconTheme"))
|
||||
{
|
||||
APPLICATION->setIconTheme(s->get("IconTheme").toString());
|
||||
@ -447,6 +452,20 @@ void LauncherPage::loadSettings()
|
||||
ui->themeComboBoxCat->setCurrentIndex(1);
|
||||
else
|
||||
ui->themeComboBoxCat->setCurrentIndex(0);
|
||||
|
||||
auto currentCatPosition = s->get("CatPosition").toString();
|
||||
ui->themeComboBoxCatPosition->addItem(tr("Top Left"), "top left");
|
||||
ui->themeComboBoxCatPosition->addItem(tr("Top Right"), "top right");
|
||||
ui->themeComboBoxCatPosition->addItem(tr("Bottom Left"), "bottom left");
|
||||
ui->themeComboBoxCatPosition->addItem(tr("Bottom Right"), "bottom right");
|
||||
if (currentCatPosition == "top left")
|
||||
ui->themeComboBoxCatPosition->setCurrentIndex(0);
|
||||
else if (currentCatPosition == "bottom left")
|
||||
ui->themeComboBoxCatPosition->setCurrentIndex(2);
|
||||
else if (currentCatPosition == "bottom right")
|
||||
ui->themeComboBoxCatPosition->setCurrentIndex(3);
|
||||
else
|
||||
ui->themeComboBoxCatPosition->setCurrentIndex(1);
|
||||
}
|
||||
|
||||
// Toolbar/menu bar settings (not applicable if native menu bar is present)
|
||||
|
@ -355,6 +355,17 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="themeCatPositionLabel">
|
||||
<property name="text">
|
||||
<string>Cat Position</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="themeComboBoxCatPosition">
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
Loading…
Reference in New Issue
Block a user