1
0
Fork 0
mirror of synced 2024-09-28 15:31:14 +12:00

Stylesheets: Refactor css widget selectors based on objectName()

The `objectName()` of onstall and uninstall buttons should be set
to `InstallButton` and `UninstallButton` respectively for them to
pick up their special CSS properties.

Make QToolBox tab text bold

Clean-up deprecated widget object names in the CSS
This commit is contained in:
loathingKernel 2023-01-25 17:08:43 +02:00
parent 020d225f97
commit 9e077f74ed
6 changed files with 32 additions and 90 deletions

View file

@ -81,7 +81,7 @@ class GameListHeadBar(QWidget):
integrations.setPopupMode(QToolButton.InstantPopup) integrations.setPopupMode(QToolButton.InstantPopup)
self.search_bar = ButtonLineEdit("fa.search", placeholder_text=self.tr("Search Game")) self.search_bar = ButtonLineEdit("fa.search", placeholder_text=self.tr("Search Game"))
self.search_bar.setObjectName("search_bar") self.search_bar.setObjectName("SearchBar")
self.search_bar.setFrame(False) self.search_bar.setFrame(False)
self.search_bar.setMinimumWidth(200) self.search_bar.setMinimumWidth(200)

View file

@ -46,6 +46,10 @@ class EOSGroup(QGroupBox, Ui_EosWidget):
def __init__(self, parent=None): def __init__(self, parent=None):
super(EOSGroup, self).__init__(parent=parent) super(EOSGroup, self).__init__(parent=parent)
self.setupUi(self) self.setupUi(self)
# lk: set object names for CSS properties
self.install_button.setObjectName("InstallButton")
self.uninstall_button.setObjectName("UninstallButton")
self.core = LegendaryCoreSingleton() self.core = LegendaryCoreSingleton()
self.signals = GlobalSignalsSingleton() self.signals = GlobalSignalsSingleton()

View file

@ -320,50 +320,24 @@ QPushButton::menu-indicator {
left: -2px; left: -2px;
border-style: none; border-style: none;
} }
QPushButton#menu { QPushButton#InstallButton {
padding: 0px;
margin: 0px;
border-style: none;
}
QPushButton#menu_button {
border-width: 0px;
background-color: #A3DAAA;
width: 18px;
height: 18px;
}
QPushButton#menu_button:hover {
background-color: #DADDDE;
}
QPushButton[install="1"],
QPushButton#install_button {
background-color: #F9A7FF; background-color: #F9A7FF;
} }
QPushButton[install="1"]:hover, QPushButton#InstallButton:hover {
QPushButton#install_button:hover {
background-color: #BB7DBF; background-color: #BB7DBF;
} }
QPushButton[install="1"]:disabled, QPushButton#InstallButton:disabled {
QPushButton#install_button:disabled {
background-color: #7D5380; background-color: #7D5380;
} }
QPushButton[uninstall="1"], QPushButton#UninstallButton {
QPushButton#uninstall_button {
background-color: #FFB085; background-color: #FFB085;
} }
QPushButton[uninstall="1"]:hover, QPushButton#UninstallButton:hover {
QPushButton#uninstall_button:hover {
background-color: #BF8464; background-color: #BF8464;
} }
QPushButton[uninstall="1"]:disabled, QPushButton#UninstallButton:disabled {
QPushButton#uninstall_button:disabled {
background-color: #805843; background-color: #805843;
} }
QPushButton#success{
background-color: lime;
}
QPushButton#installed_menu_button:hover {
background-color: green;
}
QGroupBox, QGroupBox,
QCheckBox, QCheckBox,
@ -391,7 +365,7 @@ QTableView::indicator {
height: 11px; height: 11px;
} }
QGroupBox::indicator { QGroupBox::indicator {
padding: 1px; padding: 0px;
} }
QGroupBox::indicator:disabled, QGroupBox::indicator:disabled,
QCheckBox::indicator:disabled, QCheckBox::indicator:disabled,
@ -449,9 +423,7 @@ QRadioButton::indicator:checked:disabled {
image: url(":/stylesheets/ChildOfMetropolis/circle-disabled.svg"); image: url(":/stylesheets/ChildOfMetropolis/circle-disabled.svg");
} }
QGroupBox, QGroupBox {
QGroupBox#group,
QGroupBox#settings_widget {
font-weight: bold; font-weight: bold;
margin-top: 0.5em; margin-top: 0.5em;
/* margin-left: 0.5em; /* Offset to the left */ /* margin-left: 0.5em; /* Offset to the left */
@ -460,10 +432,8 @@ QGroupBox#settings_widget {
border-radius: 4px; border-radius: 4px;
padding-top: 1.2em; padding-top: 1.2em;
} }
QGroupBox#game_widget_icon { QToolBox {
margin: 2px; font-weight: bold;
border-width: 0px;
padding: 0px;
} }
QToolBox::tab, QToolBox::tab,
QGroupBox::title { QGroupBox::title {
@ -496,11 +466,7 @@ QSizeGrip {
height: 4px; height: 4px;
} }
#list_widget { QLineEdit#SearchBar {
border-top-width: 2px;
}
#search_bar {
padding: 3px; padding: 3px;
border-radius: 5px; border-radius: 5px;
background-color: #DADDDE; background-color: #DADDDE;

View file

@ -320,50 +320,30 @@ QPushButton::menu-indicator {
left: -2px; left: -2px;
border-style: none; border-style: none;
} }
QPushButton#menu { QPushButton#InstallButton {
padding: 0px; border-color: rgb( 0, 119, 0);
margin: 0px;
border-style: none;
}
QPushButton#menu_button {
border-width: 0px;
background-color: rgb( 60, 63, 65);
width: 18px;
height: 18px;
}
QPushButton#menu_button:hover {
background-color: rgb( 51, 51, 68);
}
QPushButton[install="1"],
QPushButton#install_button {
background-color: rgb( 0, 119, 0); background-color: rgb( 0, 119, 0);
} }
QPushButton[install="1"]:hover, QPushButton#InstallButton:hover {
QPushButton#install_button:hover { border-color: rgb( 0, 85, 0);
background-color: rgb( 0, 85, 0); background-color: rgb( 0, 85, 0);
} }
QPushButton[install="1"]:disabled, QPushButton#InstallButton:disabled {
QPushButton#install_button:disabled { border-color: rgb( 0, 34, 0);
background-color: rgb( 0, 34, 0); background-color: rgb( 0, 34, 0);
} }
QPushButton[uninstall="1"], QPushButton#UninstallButton {
QPushButton#uninstall_button { border-color: rgb(119, 0, 0);
background-color: rgb(119, 0, 0); background-color: rgb(119, 0, 0);
} }
QPushButton[uninstall="1"]:hover, QPushButton#UninstallButton:hover {
QPushButton#uninstall_button:hover { border-color: rgb( 85, 0, 0);
background-color: rgb( 85, 0, 0); background-color: rgb( 85, 0, 0);
} }
QPushButton[uninstall="1"]:disabled, QPushButton#UninstallButton:disabled {
QPushButton#uninstall_button:disabled { border-color: rgb( 34, 0, 0);
background-color: rgb( 34, 0, 0); background-color: rgb( 34, 0, 0);
} }
QPushButton#success{
background-color: lime;
}
QPushButton#installed_menu_button:hover {
background-color: green;
}
QGroupBox, QGroupBox,
QCheckBox, QCheckBox,
@ -449,9 +429,7 @@ QRadioButton::indicator:checked:disabled {
image: url(":/stylesheets/RareStyle/circle-disabled.svg"); image: url(":/stylesheets/RareStyle/circle-disabled.svg");
} }
QGroupBox, QGroupBox {
QGroupBox#group,
QGroupBox#settings_widget {
font-weight: bold; font-weight: bold;
margin-top: 0.5em; margin-top: 0.5em;
/* margin-left: 0.5em; /* Offset to the left */ /* margin-left: 0.5em; /* Offset to the left */
@ -460,10 +438,8 @@ QGroupBox#settings_widget {
border-radius: 4px; border-radius: 4px;
padding-top: 1.2em; padding-top: 1.2em;
} }
QGroupBox#game_widget_icon { QToolBox {
margin: 2px; font-weight: bold;
border-width: 0px;
padding: 0px;
} }
QToolBox::tab, QToolBox::tab,
QGroupBox::title { QGroupBox::title {
@ -496,11 +472,7 @@ QSizeGrip {
height: 4px; height: 4px;
} }
#list_widget { QLineEdit#SearchBar {
border-top-width: 2px;
}
#search_bar {
padding: 3px; padding: 3px;
border-radius: 5px; border-radius: 5px;
background-color: rgb( 51, 51, 68); background-color: rgb( 51, 51, 68);