From f33153af3ad2ff99edff769c0761e57b70cac87a Mon Sep 17 00:00:00 2001 From: Dummerle Date: Tue, 9 Mar 2021 18:13:04 +0100 Subject: [PATCH] Some Style --- .../Tabs/Games/GameWidgetInstalled.py | 8 ++- Rare/Components/Tabs/Games/GamesTab.py | 11 +++-- Rare/Components/Tabs/Games/ImportWidget.py | 2 +- Rare/Styles/RareStyle.qss | 49 +++++++++++++------ Rare/utils/QtExtensions.py | 2 +- 5 files changed, 45 insertions(+), 27 deletions(-) diff --git a/Rare/Components/Tabs/Games/GameWidgetInstalled.py b/Rare/Components/Tabs/Games/GameWidgetInstalled.py index 52d405e4..002b4096 100644 --- a/Rare/Components/Tabs/Games/GameWidgetInstalled.py +++ b/Rare/Components/Tabs/Games/GameWidgetInstalled.py @@ -71,11 +71,9 @@ class GameWidgetInstalled(QWidget): self.menu_btn.leaveEvent = lambda x: self.info_label.setText( "Please update Game") if self.update_available else self.info_label.setText("Start Game") # remove Border - self.menu_btn.setStyleSheet(""" - QPushButton{ - border: none; - } - """) + + self.menu_btn.setObjectName("menu_button") + self.menu_btn.clicked.connect(lambda: self.show_info.emit(self.game.app_name)) self.menu_btn.setFixedWidth(17) minilayout.addWidget(self.menu_btn) diff --git a/Rare/Components/Tabs/Games/GamesTab.py b/Rare/Components/Tabs/Games/GamesTab.py index 6ddc5492..1dbcc4bd 100644 --- a/Rare/Components/Tabs/Games/GamesTab.py +++ b/Rare/Components/Tabs/Games/GamesTab.py @@ -1,5 +1,5 @@ -from PyQt5.QtCore import QSettings -from PyQt5.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QCheckBox, QLineEdit, QPushButton, QStackedLayout +from PyQt5.QtCore import QSettings, QSize +from PyQt5.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QCheckBox, QLineEdit, QPushButton, QStackedLayout, QLabel from qtawesome import icon from Rare.Components.Tabs.Games.GameInfo.GameInfo import InfoTabs @@ -60,7 +60,6 @@ class Games(QWidget): self.head_bar.view.toggled.connect( lambda: self.game_list.update_list(not self.head_bar.view.isChecked())) - self.setLayout(self.layout) @@ -68,7 +67,6 @@ class GameListHeadBar(QWidget): def __init__(self): super(GameListHeadBar, self).__init__() self.layout = QHBoxLayout() - self.installed_only = QCheckBox(self.tr("Installed only")) self.layout.addWidget(self.installed_only) @@ -80,6 +78,11 @@ class GameListHeadBar(QWidget): self.layout.addStretch(1) self.search_bar = QLineEdit() + self.search_bar.setObjectName("search_bar") + self.search_bar.setFrame(False) + icon_label = QLabel() + icon_label.setPixmap(icon("fa.search", color="white").pixmap(QSize(20, 20))) + self.layout.addWidget(icon_label) self.search_bar.setMinimumWidth(200) self.search_bar.setPlaceholderText(self.tr("Search Game")) self.layout.addWidget(self.search_bar) diff --git a/Rare/Components/Tabs/Games/ImportWidget.py b/Rare/Components/Tabs/Games/ImportWidget.py index 975198a5..d076a997 100644 --- a/Rare/Components/Tabs/Games/ImportWidget.py +++ b/Rare/Components/Tabs/Games/ImportWidget.py @@ -54,7 +54,7 @@ class ImportWidget(QWidget): self.layout.addStretch(1) self.main_layout.addLayout(self.layout) - + # self.main_layout.addStretch(1) self.setLayout(self.main_layout) def import_game(self, path=None): diff --git a/Rare/Styles/RareStyle.qss b/Rare/Styles/RareStyle.qss index 32d0c7be..6944f70c 100644 --- a/Rare/Styles/RareStyle.qss +++ b/Rare/Styles/RareStyle.qss @@ -7,20 +7,24 @@ QLabel { background-color: transparent; } -QTabBar{ +QTabBar#main_tab_bar{ border-bottom: none; + background-color: #2b2b2c; +} +QTabBar::tab#main_tab_bar{ + border-bottom: noneq; } QTabBar::tab#main_tab_bar { border-bottom: none; padding: 5px } -QTabBar::tab:selected{ - border-bottom: 2px solid white; +QTabBar::tab:selected#main_tab_bar{ + background-color: gray; } QTabBar::tab:hover#main_tab_bar { - background-color: black; + border-bottom: 2px solid black; } @@ -31,13 +35,18 @@ QTabBar::tab:disabled { QToolButton { - padding: 5px; + padding: 6px; } QPushButton { - border: 2px solid white; - border-radius: 2px; + border: 1px solid white; + border-radius: 4px; + background-color: #3c3f41; + padding: 3px; +} +QPushButton:hover{ + background-color: #223; } QPushButton::menu-indicator { @@ -53,22 +62,23 @@ QPushButton#menu { border-style: none; } +QPushButton#menu_button{ + background-color: transparent; + border: none; +} +QPushButton:hover#menu_button{ + background-color: #334; +} + QLineEdit { border: 1px solid white; } -QCheckBox::indicator { - border: 1px solid white; - border-radius: 2px; +QCheckBox{ + color: #F0F0F0; } -QCheckBox::indicator:checked { - background-color: white; -} -#head_bar { - border-bottom: 2px solid white; -} #list_widget { border-top: 2px solid white; @@ -89,6 +99,13 @@ QTabBar::tab:hover#settings_bar { QTabBar::tab::selected#settings_bar { background-color: darkslategrey; } + +#search_bar{ + padding: 3px; + border-radius: 5px; + background-color: #334; +} + /* QScrollBar:vertical{ border: 1px solid white; diff --git a/Rare/utils/QtExtensions.py b/Rare/utils/QtExtensions.py index 90a9485d..27f47cc4 100644 --- a/Rare/utils/QtExtensions.py +++ b/Rare/utils/QtExtensions.py @@ -202,7 +202,7 @@ class SelectViewWidget(QWidget): def __init__(self, icon_view: bool): super(SelectViewWidget, self).__init__() self.icon_view = icon_view - self.setStyleSheet("""QPushButton{border: none}""") + self.setStyleSheet("""QPushButton{border: none; background-color: transparent}""") self.icon_view_button = QPushButton() self.list_view = QPushButton() if icon_view: