1
0
Fork 0
mirror of synced 2024-05-18 11:32:50 +12:00

Rare: Replace QToolButton with QPushButton

QToolButton is not really designed to be used in the way we did and since
QPushButton supports having a menu attached to, we can replace tool buttons
in most cases.

* Fix the presentation of the TabButtonWidget by updating RareStyle's css

* Reduce the size of the top tab bar to save vertical space.

* Remove infoLabel property
This commit is contained in:
loathingKernel 2024-02-21 20:25:03 +02:00
parent 8dbce8e9f2
commit 5bf353ec37
No known key found for this signature in database
GPG key ID: CE0C72D0B53821FD
26 changed files with 222 additions and 160 deletions

View file

@ -54,7 +54,7 @@ class ImportLogin(QFrame):
else:
self.ui.status_label.setText(self.text_egl_notfound)
self.ui.prefix_tool.clicked.connect(self.prefix_path)
self.ui.prefix_button.clicked.connect(self.prefix_path)
self.ui.prefix_combo.editTextChanged.connect(self.changed.emit)
def get_wine_prefixes(self):

View file

@ -2,7 +2,7 @@ from PyQt5.QtCore import QSize, pyqtSignal, pyqtSlot
from PyQt5.QtWidgets import QMenu, QTabWidget, QWidget, QWidgetAction, QShortcut, QMessageBox
from rare.shared import RareCore, LegendaryCoreSingleton, GlobalSignalsSingleton, ArgumentsSingleton
from rare.utils.misc import icon, ExitCodes
from rare.utils.misc import qta_icon, ExitCodes
from .account import AccountWidget
from .downloads import DownloadsTab
from .games import GamesTab
@ -18,6 +18,7 @@ class MainTabWidget(QTabWidget):
def __init__(self, parent):
super(MainTabWidget, self).__init__(parent=parent)
self.rcore = RareCore.instance()
self.core = LegendaryCoreSingleton()
self.signals = GlobalSignalsSingleton()
@ -47,29 +48,29 @@ class MainTabWidget(QTabWidget):
self.setTabEnabled(space_index, False)
self.tab_bar.expanded = space_index
# Button
button_index = self.addTab(QWidget(self), "")
button_index = self.addTab(QWidget(self), qta_icon("mdi.account-circle", fallback="fa.user"), "")
self.setTabEnabled(button_index, False)
self.account_widget = AccountWidget(self)
self.account_widget.exit_app.connect(self.__on_exit_app)
account_action = QWidgetAction(self)
account_action.setDefaultWidget(self.account_widget)
account_button = TabButtonWidget("mdi.account-circle", "Account", fallback_icon="fa.user")
account_button.setMenu(QMenu())
account_button.menu().addAction(account_action)
account_button = TabButtonWidget(qta_icon("mdi.menu", fallback="fa.align-justify"), tooltip="Menu")
account_menu = QMenu(account_button)
account_menu.addAction(account_action)
account_button.setMenu(account_menu)
self.tab_bar.setTabButton(
button_index, MainTabBar.RightSide, account_button
)
self.settings_tab = SettingsTab(self)
self.settings_index = self.addTab(self.settings_tab, icon("fa.gear"), "")
self.settings_index = self.addTab(self.settings_tab, qta_icon("fa.gear"), "")
self.settings_tab.about.update_available_ready.connect(
lambda: self.tab_bar.setTabText(self.settings_index, "(!)")
)
# Open game list on click on Games tab button
self.tabBarClicked.connect(self.mouse_clicked)
self.setIconSize(QSize(24, 24))
# shortcuts
QShortcut("Alt+1", self).activated.connect(lambda: self.setCurrentIndex(self.games_index))

View file

@ -5,7 +5,6 @@ from PyQt5.QtWidgets import (
QWidget,
QHBoxLayout,
QComboBox,
QToolButton,
QMenu,
QAction, QSpacerItem, QSizePolicy,
)
@ -99,10 +98,9 @@ class GameListHeadBar(QWidget):
integrations_menu.addAction(egl_sync_action)
integrations_menu.addAction(eos_ubisoft_action)
integrations = QToolButton(parent=self)
integrations = QPushButton(parent=self)
integrations.setText(self.tr("Integrations"))
integrations.setMenu(integrations_menu)
integrations.setPopupMode(QToolButton.InstantPopup)
self.search_bar = ButtonLineEdit("fa.search", placeholder_text=self.tr("Search"))
self.search_bar.setSizePolicy(QSizePolicy.Maximum, QSizePolicy.Preferred)
@ -130,7 +128,7 @@ class GameListHeadBar(QWidget):
self.refresh_list.clicked.connect(self.__refresh_clicked)
layout = QHBoxLayout(self)
layout.setContentsMargins(0, 5, 0, 5)
layout.setContentsMargins(0, 0, 0, 0)
layout.addWidget(self.filter)
layout.addWidget(self.order)
layout.addSpacerItem(QSpacerItem(0, 0, QSizePolicy.Expanding, QSizePolicy.Fixed))

View file

@ -46,7 +46,6 @@ class EGLSyncGroup(QGroupBox):
)
self.egl_path_info = ElideLabel(parent=self)
self.egl_path_info.setProperty("infoLabel", 1)
self.ui.egl_sync_layout.setWidget(
self.ui.egl_sync_layout.getWidgetPosition(self.ui.egl_path_info_label)[0],
QFormLayout.FieldRole, self.egl_path_info

View file

@ -15,7 +15,6 @@ from PyQt5.QtWidgets import (
QWidget,
QScrollArea,
QAction,
QToolButton,
QMenu, QStackedWidget, QPushButton, QLineEdit, QVBoxLayout, QComboBox,
)
@ -118,10 +117,9 @@ class WrapperWidget(QFrame):
manage_menu = QMenu(parent=self)
manage_menu.addActions([edit_action, delete_action])
manage_button = QToolButton(parent=self)
manage_button.setIcon(qta_icon("mdi.menu"))
manage_button = QPushButton(parent=self)
manage_button.setIcon(qta_icon("mdi.menu", fallback="fa.align-justify"))
manage_button.setMenu(manage_menu)
manage_button.setPopupMode(QToolButton.InstantPopup)
manage_button.setEnabled(wrapper.is_editable)
if not wrapper.is_editable:
manage_button.setToolTip(self.tr("Manage through settings"))

View file

@ -17,7 +17,7 @@ from rare.components.tabs.store.shop_models import ShopGame
from rare.shared import LegendaryCoreSingleton
from rare.ui.components.tabs.store.shop_game_info import Ui_shop_info
from rare.utils.extra_widgets import ImageLabel
from rare.utils.misc import icon
from rare.utils.misc import qta_icon as icon
from rare.widgets.loading_widget import LoadingWidget
logger = logging.getLogger("ShopInfo")

View file

@ -9,7 +9,7 @@ from PyQt5.QtWidgets import QWidget, QVBoxLayout, QLabel, QHBoxLayout
from rare.components.tabs.store.shop_models import ImageUrlModel
from rare.ui.components.tabs.store.wishlist_widget import Ui_WishlistWidget
from rare.utils.extra_widgets import ImageLabel
from rare.utils.misc import icon
from rare.utils.misc import qta_icon as icon
logger = logging.getLogger("GameWidgets")

View file

@ -5,7 +5,7 @@ from rare.components.tabs.store import ShopApiCore
from rare.components.tabs.store.game_widgets import WishlistWidget
from rare.ui.components.tabs.store.wishlist import Ui_Wishlist
from rare.utils.extra_widgets import WaitingSpinner
from rare.utils.misc import icon
from rare.utils.misc import qta_icon as icon
class Wishlist(QStackedWidget, Ui_Wishlist):

View file

@ -1,15 +1,13 @@
from PyQt5.QtCore import QSize
from PyQt5.QtWidgets import QTabBar, QToolButton
from rare.utils.misc import icon
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QTabBar, QSizePolicy, QPushButton
class MainTabBar(QTabBar):
def __init__(self, parent=None):
super(MainTabBar, self).__init__(parent=parent)
self.setObjectName("MainTabBar")
self.setObjectName(type(self).__name__)
font = self.font()
font.setPointSize(font.pointSize() + 2)
font.setPointSize(font.pointSize() + 1)
font.setBold(True)
self.setFont(font)
self.expanded = -1
@ -24,11 +22,9 @@ class MainTabBar(QTabBar):
return size
class TabButtonWidget(QToolButton):
def __init__(self, button_icon: str, tool_tip: str, fallback_icon=None, parent=None):
class TabButtonWidget(QPushButton):
def __init__(self, icon: QIcon, tooltip: str = "", parent=None):
super(TabButtonWidget, self).__init__(parent=parent)
self.setText("Icon")
self.setPopupMode(QToolButton.InstantPopup)
self.setIcon(icon(button_icon, fallback_icon, scale_factor=1.25))
self.setToolTip(tool_tip)
self.setIconSize(QSize(25, 25))
self.setObjectName(type(self).__name__)
self.setIcon(icon)
self.setToolTip(tooltip)

View file

@ -5,7 +5,7 @@ from typing import Union, Type
import qstylizer.style
from PyQt5.QtCore import QDir, QObject
from PyQt5.QtGui import QColor
from PyQt5.pyrcc import RCCResourceLibrary, CONSTANT_COMPRESSLEVEL_DEFAULT, CONSTANT_COMPRESSTHRESHOLD_DEFAULT
from PyQt5.pyrcc import RCCResourceLibrary, CONSTANT_COMPRESSTHRESHOLD_DEFAULT
from PyQt5.sip import wrappertype
from rare.utils.misc import widget_object_name
@ -64,6 +64,13 @@ def css_name(widget: Union[wrappertype, QObject, Type], subwidget: str = ""):
css = qstylizer.style.StyleSheet()
# InfoLabel
css.QLabel["#InfoLabel"].setValues(
color="#999",
fontStyle="italic",
fontWeight="normal",
)
# [Un]InstallButton
css.QPushButton["#InstallButton"].setValues(
borderColor=QColor(0, 180, 0).name(),
@ -197,6 +204,15 @@ css.QPushButton[css_name(SelectViewWidget, "Button")].setValues(
)
# ButtonLineEdit
from rare.utils.extra_widgets import ButtonLineEdit
css.QPushButton[css_name(ButtonLineEdit, "Button")].setValues(
backgroundColor="transparent",
border="0px",
padding="0px",
)
if __name__ == "__main__":
with open("stylesheet.qss", "w") as qss:
qss.write(f'\n/* This file is auto-generated from "{os.path.basename(__file__)}". DO NOT EDIT!!! */\n\n')

View file

@ -1,6 +1,11 @@
/* This file is auto-generated from "stylesheet.py". DO NOT EDIT!!! */
QLabel#InfoLabel {
color: #999;
font-style: italic;
font-weight: normal;
}
QPushButton#InstallButton {
border-color: #00b400;
background-color: #007800;
@ -106,3 +111,8 @@ QPushButton#SelectViewWidgetButton {
border: none;
background-color: transparent;
}
QPushButton#ButtonLineEditButton {
background-color: transparent;
border: 0px;
padding: 0px;
}

View file

@ -20,7 +20,6 @@ disabled: #43474d #767778 -- border for disabled widgets
alternate: #3c3f41 #A3DAAA -- border color for gradient backgrounds on widgets like Tabs and Popups
[Special]
info-normal: #bbb #4D5059 -- infoLabel
install-normal: #070 #F9A7FF -- install
install-hover: #050 #BB7DBF -- install
install-disabled: #020 #7D5380 -- install
@ -48,12 +47,6 @@ QLabel:disabled {
padding: 0px;
selection-background-color: #71DA7E;
}
QLabel[infoLabel="1"] {
color: #4D5059;
font-style: italic;
font-weight: normal;
}
QMenu,
QListView,
@ -101,6 +94,7 @@ QScrollBar {
background-color: #DADDDE;
selection-background-color: #71DA7E;
}
QLineEdit,
QTextEdit,
QTimeEdit,
@ -111,11 +105,22 @@ QSpinBox,
QDoubleSpinBox,
QProgressBar,
QPushButton {
height: 1.30em;
min-height: 1.30em;
}
QLineEdit,
QTextEdit
QTimeEdit,
QDateEdit,
QDateTimeEdit,
QSpinBox,
QDoubleSpinBox,
QProgressBar {
max-height: 1.30em;
}
QToolButton {
height: 1.10em;
min-height: 1.10em;
}
QFrame[frameShape="0"] {
border-width: 0px;
}
@ -314,12 +319,15 @@ QToolButton {
padding-left: 6px;
padding-right: 6px;
}
QPushButton::menu-indicator {
/*
QPushButton::menu-indicator,
QToolButton::menu-indicator {
subcontrol-position: right center;
subcontrol-origin: padding;
left: -2px;
border-style: none;
}
*/
QGroupBox,
QCheckBox,
@ -451,12 +459,6 @@ QSizeGrip {
height: 4px;
}
QLineEdit#SearchBar {
padding: 3px;
border-radius: 5px;
background-color: #DADDDE;
}
QTabWidget::pane {
}
QTabWidget::tab-bar {
@ -610,6 +612,39 @@ QTabBar::tab:right:selected:disabled {
border-left-color: transparent;
}
QStatusBar {
border-width: 1px;
border-style: solid;
border-color: transparent;
border-top-color: #5CD3FF;
border-bottom-color: #A3DAAA;
background: qlineargradient(
x1: 0, y1: 3,
x2: 0, y2: 0,
stop: 0 #A3DAAA,
stop: 1 #C2C4C5);
}
QToolTip {
border-width: 1px;
border-style: solid;
border-color: #5CD3FF;
border-radius: 4px;
padding: 1px;
opacity: 200;
}
QBalloonTip {
color: #36393F;
background-color: #C2C4C5;
border-width: 1px;
border-style: solid;
border-color: #5CD3FF;
border-radius: 4px;
padding: 1px;
}
/* Main tab bar styling */
QTabBar#MainTabBar {
border-width: 1px;
border-style: solid;
@ -651,6 +686,17 @@ QTabBar#MainTabBar::tab:top:selected {
border-color: #5CD3FF;
border-bottom-color: #C2C4C5;
}
QPushButton#TabButtonWidget,
QToolButton#TabButtonWidget {
padding: 0px;
border-color: rgb( 51, 54, 59);
}
QPushButton#TabButtonWidget:disabled,
QToolButton#TabButtonWidget:disabled {
border-color: rgb( 41, 43, 47);
}
/* Side tab bar styling */
QTabBar#SideTabBar {
border-width: 1px;
border-style: solid;
@ -688,36 +734,10 @@ QTabBar#SideTabBar::tab:disabled {
background-color: transparent;
}
QStatusBar {
border-width: 1px;
border-style: solid;
border-color: transparent;
border-top-color: #5CD3FF;
border-bottom-color: #A3DAAA;
background: qlineargradient(
x1: 0, y1: 3,
x2: 0, y2: 0,
stop: 0 #A3DAAA,
stop: 1 #C2C4C5);
}
QToolTip {
border-width: 1px;
border-style: solid;
border-color: #5CD3FF;
border-radius: 4px;
padding: 1px;
opacity: 200;
}
QBalloonTip {
color: #36393F;
background-color: #C2C4C5;
border-width: 1px;
border-style: solid;
border-color: #5CD3FF;
border-radius: 4px;
padding: 1px;
/* Search bar styling */
QLineEdit#SearchBar {
border-radius: 5px;
background-color: #DADDDE;
}
/* Wrapper settings styling */
@ -745,3 +765,7 @@ QLabel#WrapperSettingsLabel {
border-color: #71DA7E;
background-color: #BCBEBF;
}
QLabel#WrapperSettingsLabel:disabled {
border-color: rgb( 67, 71, 77);
background-color: rgb( 32, 34, 37);
}

View file

@ -1,4 +1,4 @@
<svg height="640" viewBox="0 0 320 640" width="320" xmlns="http://www.w3.org/2000/svg">
<path d="m41 236.475h238c21.4 0 32.1 25.9 17 41l-119 119c-9.4 9.4-24.6 9.4-33.9 0l-119.1-119c-15.1-15.1-4.4-41 17-41z"
fill="#eee"/>
fill="#ccc"/>
</svg>

Before

Width:  |  Height:  |  Size: 241 B

After

Width:  |  Height:  |  Size: 241 B

View file

@ -1,4 +1,4 @@
<svg height="320" viewBox="0 0 320 320" width="320" xmlns="http://www.w3.org/2000/svg">
<path d="m41 76.475h238c21.4 0 32.1 25.9 17 41l-119 119c-9.4 9.4-24.6 9.4-33.9 0l-119.1-119c-15.1-15.1-4.4-41 17-41z"
fill="#eee"/>
fill="#ccc"/>
</svg>

Before

Width:  |  Height:  |  Size: 240 B

After

Width:  |  Height:  |  Size: 240 B

View file

@ -1,4 +1,4 @@
<svg height="320" viewBox="0 0 320 320" width="320" xmlns="http://www.w3.org/2000/svg">
<path d="m279.01546 243.525h-237.999997c-21.4 0-32.1000001-25.9-17-41l118.999997-119c9.4-9.4 24.6-9.4 33.9 0l119 119c15.2 15.1 4.5 41-16.9 41z"
fill="#eee"/>
fill="#ccc"/>
</svg>

Before

Width:  |  Height:  |  Size: 266 B

After

Width:  |  Height:  |  Size: 266 B

View file

@ -6,7 +6,7 @@ disabled: #43474d rgb( 67, 71, 77) -- disabled font color
rgba( 67, 71, 77, 25%) == rgb( 41, 43, 47)
[Background]
normal: #202225 rgb( 32, 34, 37) -- main background color
editable: #333344 rgb( 51, 51, 68) -- background color for reactive/editable widgets (TextEdits, ProgressBars etc)
editable: #272733 rgb( 38, 38, 51) -- background color for reactive/editable widgets (TextEdits, ProgressBars etc)
hover: #222233 rgb( 34, 34, 51) -- background color when hovering over reactive widgets (Buttons, Headers)
selection: #2f4f4f rgb( 47, 79, 79) -- background color for selectable widgets
alternate: #282a2e rgb( 40, 42, 46) -- background color for alternating rows in List/Tree/TableViews and for ScrollBars
@ -20,7 +20,6 @@ disabled: #43474d rgb( 67, 71, 77) -- border for disabled widgets
alternate: #3c3f41 rgb( 60, 63, 65) -- border color for gradient backgrounds on widgets like Tabs and Popups
[Special]
info-normal: #bbb rgb(187, 187, 187) -- infoLabel
install-normal: #070 rgb( 0, 119, 0) -- install
install-hover: #050 rgb( 0, 85, 0) -- install
install-disabled: #020 rgb( 0, 34, 0) -- install
@ -48,12 +47,6 @@ QLabel:disabled {
padding: 0px;
selection-background-color: rgb( 47, 79, 79);
}
QLabel[infoLabel="1"] {
color: rgb(187, 187, 187);
font-style: italic;
font-weight: normal;
}
QMenu,
QListView,
@ -98,9 +91,10 @@ QDoubleSpinBox,
QProgressBar,
QScrollBar {
border-color: rgb( 47, 79, 79);
background-color: rgb( 51, 51, 68);
background-color: rgb( 38, 38, 51);
selection-background-color: rgb( 47, 79, 79);
}
QLineEdit,
QTextEdit,
QTimeEdit,
@ -111,11 +105,22 @@ QSpinBox,
QDoubleSpinBox,
QProgressBar,
QPushButton {
height: 1.30em;
min-height: 1.30em;
}
QLineEdit,
QTextEdit
QTimeEdit,
QDateEdit,
QDateTimeEdit,
QSpinBox,
QDoubleSpinBox,
QProgressBar {
max-height: 1.30em;
}
QToolButton {
height: 1.10em;
min-height: 1.10em;
}
QFrame[frameShape="0"] {
border-width: 0px;
}
@ -230,7 +235,7 @@ QScrollBar::handle {
border-width: 1px;
border-style: solid;
border-color: rgb( 72, 61, 139);
background-color: rgb( 51, 51, 68);
background-color: rgb( 38, 38, 51);
border-radius: 2px;
min-height: 30px;
min-width: 30px;
@ -314,12 +319,15 @@ QToolButton {
padding-left: 6px;
padding-right: 6px;
}
QPushButton::menu-indicator {
/*
QPushButton::menu-indicator,
QToolButton::menu-indicator {
subcontrol-position: right center;
subcontrol-origin: padding;
left: -2px;
border-style: none;
}
*/
QGroupBox,
QCheckBox,
@ -451,12 +459,6 @@ QSizeGrip {
height: 4px;
}
QLineEdit#SearchBar {
padding: 3px;
border-radius: 5px;
background-color: rgb( 51, 51, 68);
}
QTabWidget::pane {
}
QTabWidget::tab-bar {
@ -610,6 +612,39 @@ QTabBar::tab:right:selected:disabled {
border-left-color: transparent;
}
QStatusBar {
border-width: 1px;
border-style: solid;
border-color: transparent;
border-top-color: rgb( 72, 61, 139);
border-bottom-color: rgb( 60, 63, 65);
background: qlineargradient(
x1: 0, y1: 3,
x2: 0, y2: 0,
stop: 0 rgb( 60, 63, 65),
stop: 1 rgb( 32, 34, 37));
}
QToolTip {
border-width: 1px;
border-style: solid;
border-color: rgb( 72, 61, 139);
border-radius: 4px;
padding: 1px;
opacity: 200;
}
QBalloonTip {
color: rgb(238, 238, 238);
background-color: rgb( 32, 34, 37);
border-width: 1px;
border-style: solid;
border-color: rgb( 72, 61, 139);
border-radius: 4px;
padding: 1px;
}
/* Main tab bar styling */
QTabBar#MainTabBar {
border-width: 1px;
border-style: solid;
@ -632,7 +667,7 @@ QTabBar#MainTabBar::tab {
margin-right: 3px;
border-top-color: transparent;
border-bottom-color: rgb( 72, 61, 139);
padding: 5px;
padding: 3px 5px;
}/*
QTabBar#MainTabBar::tab:top:first,
QTabBar#MainTabBar::tab:bottom:first {
@ -651,6 +686,17 @@ QTabBar#MainTabBar::tab:top:selected {
border-color: rgb( 72, 61, 139);
border-bottom-color: rgb( 32, 34, 37);
}
QPushButton#TabButtonWidget,
QToolButton#TabButtonWidget {
padding: 0px;
border-color: rgb( 51, 54, 59);
}
QPushButton#TabButtonWidget:disabled,
QToolButton#TabButtonWidget:disabled {
border-color: rgb( 41, 43, 47);
}
/* Side tab bar styling */
QTabBar#SideTabBar {
border-width: 1px;
border-style: solid;
@ -688,41 +734,16 @@ QTabBar#SideTabBar::tab:disabled {
background-color: transparent;
}
QStatusBar {
border-width: 1px;
border-style: solid;
border-color: transparent;
border-top-color: rgb( 72, 61, 139);
border-bottom-color: rgb( 60, 63, 65);
background: qlineargradient(
x1: 0, y1: 3,
x2: 0, y2: 0,
stop: 0 rgb( 60, 63, 65),
stop: 1 rgb( 32, 34, 37));
}
QToolTip {
border-width: 1px;
border-style: solid;
border-color: rgb( 72, 61, 139);
border-radius: 4px;
padding: 1px;
opacity: 200;
}
QBalloonTip {
color: rgb(238, 238, 238);
background-color: rgb( 32, 34, 37);
border-width: 1px;
border-style: solid;
border-color: rgb( 72, 61, 139);
border-radius: 4px;
padding: 1px;
/* Search bar styling */
QLineEdit#SearchBar {
border-radius: 5px;
background-color: rgb( 38, 38, 51);
}
/* Wrapper settings styling */
QPushButton#WrapperWidgetButton,
QToolButton#WrapperWidgetButton {
padding: 0px;
border-color: rgb( 51, 54, 59);
}
QPushButton#WrapperWidgetButton:disabled,
@ -731,7 +752,7 @@ QToolButton#WrapperWidgetButton:disabled {
}
QScrollArea#WrapperSettingsScroll {
border-color: rgb( 47, 79, 79);
background-color: rgb( 40, 42, 46);
background-color: rgb( 38, 38, 51);
}
QScrollBar#WrapperSettingsScrollBar {
background-color: rgb( 40, 42, 46);
@ -743,9 +764,9 @@ QLabel#WrapperSettingsLabel {
padding: 2px;
color: #999;
border-color: rgb( 47, 79, 79);
background-color: rgb( 40, 42, 46);
background-color: rgb( 38, 38, 51);
}
QLabel#WrapperSettingsLabel:disabled {
border-color: rgb( 67, 71, 77);
background-color: rgb( 32, 34, 37);
}
}

View file

@ -14,7 +14,7 @@ from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_ImportLogin(object):
def setupUi(self, ImportLogin):
ImportLogin.setObjectName("ImportLogin")
ImportLogin.resize(233, 156)
ImportLogin.resize(256, 143)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
@ -52,9 +52,9 @@ class Ui_ImportLogin(object):
self.prefix_combo.setEditable(True)
self.prefix_combo.setObjectName("prefix_combo")
self.prefix_layout.addWidget(self.prefix_combo)
self.prefix_tool = QtWidgets.QToolButton(ImportLogin)
self.prefix_tool.setObjectName("prefix_tool")
self.prefix_layout.addWidget(self.prefix_tool)
self.prefix_button = QtWidgets.QPushButton(ImportLogin)
self.prefix_button.setObjectName("prefix_button")
self.prefix_layout.addWidget(self.prefix_button)
self.prefix_layout.setStretch(0, 1)
self.form_layout.setLayout(0, QtWidgets.QFormLayout.FieldRole, self.prefix_layout)
self.prefix_label = QtWidgets.QLabel(ImportLogin)
@ -85,7 +85,7 @@ class Ui_ImportLogin(object):
def retranslateUi(self, ImportLogin):
_translate = QtCore.QCoreApplication.translate
self.title_label.setText(_translate("ImportLogin", "Import existing session from EGL"))
self.prefix_tool.setText(_translate("ImportLogin", "Browse"))
self.prefix_button.setText(_translate("ImportLogin", "Browse..."))
self.prefix_label.setText(_translate("ImportLogin", "Select prefix"))
self.info_label.setText(_translate("ImportLogin", "<i>Please select the Wine prefix where Epic Games Launcher is installed. You will get logged out from EGL in the process.</i>"))

View file

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>233</width>
<height>156</height>
<width>256</width>
<height>143</height>
</rect>
</property>
<property name="sizePolicy">
@ -69,9 +69,9 @@
</widget>
</item>
<item>
<widget class="QToolButton" name="prefix_tool">
<widget class="QPushButton" name="prefix_button">
<property name="text">
<string>Browse</string>
<string>Browse...</string>
</property>
</widget>
</item>

View file

@ -45,7 +45,7 @@ class Ui_EGLSyncGroup(object):
def retranslateUi(self, EGLSyncGroup):
_translate = QtCore.QCoreApplication.translate
EGLSyncGroup.setTitle(_translate("EGLSyncGroup", "Sync with Epic Games Launcher"))
self.egl_path_edit_label.setText(_translate("EGLSyncGroup", "Prefix/Manifest path"))
self.egl_path_edit_label.setText(_translate("EGLSyncGroup", "Manifest path"))
self.egl_sync_check_label.setText(_translate("EGLSyncGroup", "Enable automatic sync"))
self.egl_sync_check.setText(_translate("EGLSyncGroup", "This will immediately synchronize with EGL"))
self.egl_path_info_label.setText(_translate("EGLSyncGroup", "Estimated path"))

View file

@ -29,7 +29,7 @@
<item row="0" column="0">
<widget class="QLabel" name="egl_path_edit_label">
<property name="text">
<string>Prefix/Manifest path</string>
<string>Manifest path</string>
</property>
</widget>
</item>

View file

@ -9,10 +9,9 @@ from PyQt5.QtWidgets import (
QWidget,
QPushButton,
QLineEdit,
QToolButton,
)
from rare.utils.misc import icon as qta_icon
from rare.utils.misc import qta_icon
from rare.utils.paths import cache_dir
from rare.utils.qt_requests import QtRequests
@ -117,14 +116,12 @@ class ButtonLineEdit(QLineEdit):
super(ButtonLineEdit, self).__init__(parent=parent)
self.setObjectName(type(self).__name__)
self.button = QToolButton(self)
self.button = QPushButton(self)
self.button.setObjectName(f"{type(self).__name__}Button")
self.button.setIcon(qta_icon(icon_name, color="white"))
self.button.setStyleSheet(
f"QToolButton#{self.button.objectName()} {{border: 0px; padding: 0px;}}"
)
self.button.setIcon(qta_icon(icon_name))
self.button.setCursor(Qt.ArrowCursor)
self.button.clicked.connect(self.buttonClicked.emit)
self.setPlaceholderText(placeholder_text)
frame_width = self.style().pixelMetric(QStyle.PM_DefaultFrameWidth)
button_size = self.button.sizeHint()

View file

@ -101,8 +101,9 @@ def set_color_pallete(color_scheme: str) -> None:
if custom_palette is not None:
qApp.setPalette(custom_palette)
qApp.setStyleSheet(static)
icon_color = qApp.palette().color(QPalette.Foreground).name()
qtawesome.set_defaults(color=icon_color)
icon_color_normal = qApp.palette().color(QPalette.Foreground).name()
icon_color_disabled = qApp.palette().color(QPalette.Foreground).name()
qtawesome.set_defaults(color=icon_color_normal, color_disabled=icon_color_disabled)
def get_color_schemes() -> Iterable[str]:
@ -124,8 +125,9 @@ def set_style_sheet(style_sheet: str) -> None:
file.close()
qApp.setStyleSheet(stylesheet + static)
icon_color = qApp.palette().color(QPalette.Text).name()
qtawesome.set_defaults(color="#eeeeee")
icon_color_normal = qApp.palette().color(QPalette.Text).name()
icon_color_disabled = qApp.palette().color(QPalette.Text).name()
qtawesome.set_defaults(color="#eee", color_disabled="#eee")
def get_style_sheets() -> Iterable[str]:

View file

@ -24,7 +24,7 @@ from PyQt5.QtWidgets import (
QCompleter,
QFileSystemModel,
QStyledItemDelegate,
QFileIconProvider,
QFileIconProvider, QPushButton,
)
from rare.utils.misc import qta_icon
@ -304,7 +304,7 @@ class PathEdit(IndicatorLineEdit):
)
self.setObjectName(type(self).__name__)
self.line_edit.setMinimumSize(QSize(250, 0))
self.path_select = QToolButton(self)
self.path_select = QPushButton(self)
self.path_select.setObjectName(f"{type(self).__name__}Button")
layout = self.layout()
layout.addWidget(self.path_select)