Fix color of icons
This commit is contained in:
parent
83ad8f0982
commit
c2ae188745
|
@ -12,13 +12,14 @@ creating an issue on github or on Discord: https://discord.gg/YvmABK9YSk
|
|||
|
||||
### Installation via pip (recommend)
|
||||
|
||||
Execute `pip install Rare` for all users Or `pip install Rare --user` for only one user.
|
||||
Execute `pip install Rare` for all users Or `pip install Rare --user` for only one user.
|
||||
|
||||
Linux: execute `rare` in your terminal.
|
||||
Linux: execute `rare` in your terminal.
|
||||
|
||||
Windows: execute `pythonw -m rare` in cmd
|
||||
|
||||
It is possible to create a desktop link, or a start menu link. Execute the command above with `--desktop-shortcut` or `--startmenu-shortcut` option
|
||||
It is possible to create a desktop link, or a start menu link. Execute the command above with `--desktop-shortcut`
|
||||
or `--startmenu-shortcut` option
|
||||
|
||||
**Note**: On Linux must be `/home/user/.local/bin` in PATH and on Windows must be `PythonInstallationDirectory\Scripts`
|
||||
in PATH.
|
||||
|
|
|
@ -4,8 +4,9 @@ import os
|
|||
import sys
|
||||
import time
|
||||
|
||||
import qtawesome
|
||||
from PyQt5.QtCore import QSettings, QTranslator
|
||||
from PyQt5.QtGui import QIcon
|
||||
from PyQt5.QtGui import QIcon, QPalette
|
||||
from PyQt5.QtWidgets import QApplication, QSystemTrayIcon, QStyleFactory
|
||||
|
||||
from custom_legendary.core import LegendaryCore
|
||||
|
@ -87,6 +88,7 @@ class App(QApplication):
|
|||
custom_palette = load_color_scheme(os.path.join(resources_path, "colors", color + ".scheme"))
|
||||
if custom_palette is not None:
|
||||
self.setPalette(custom_palette)
|
||||
qtawesome.set_defaults(color=custom_palette.color(QPalette.Text))
|
||||
elif style := settings.value("style_sheet", False):
|
||||
settings.setValue("color_scheme", "")
|
||||
stylesheet = open(os.path.join(resources_path, "stylesheets", style, "stylesheet.qss")).read()
|
||||
|
@ -94,6 +96,7 @@ class App(QApplication):
|
|||
if os.name == "nt":
|
||||
style_resource_path = style_resource_path.replace('\\', '/')
|
||||
self.setStyleSheet(stylesheet.replace("@path@", style_resource_path))
|
||||
qtawesome.set_defaults(color="white")
|
||||
# lk: for qresources stylesheets, not an ideal solution for modability,
|
||||
# lk: too many extra steps and I don't like binary files in git, even as strings.
|
||||
# importlib.import_module("rare.resources.stylesheets." + style)
|
||||
|
|
|
@ -3,8 +3,6 @@ from PyQt5.QtGui import QFont
|
|||
from PyQt5.QtWidgets import QTabBar, QToolButton
|
||||
from qtawesome import icon
|
||||
|
||||
from rare.utils.utils import get_icon_color
|
||||
|
||||
|
||||
class TabBar(QTabBar):
|
||||
def __init__(self, expanded):
|
||||
|
@ -29,6 +27,6 @@ class TabButtonWidget(QToolButton):
|
|||
super(TabButtonWidget, self).__init__()
|
||||
self.setText("Icon")
|
||||
self.setPopupMode(QToolButton.InstantPopup)
|
||||
self.setIcon(icon(button_icon, color=get_icon_color(), scale_factor=1.25))
|
||||
self.setIcon(icon(button_icon, scale_factor=1.25))
|
||||
self.setToolTip(tool_tip)
|
||||
self.setIconSize(QSize(25, 25))
|
||||
|
|
|
@ -15,7 +15,6 @@ from rare.components.tabs.games import GameTab
|
|||
from rare.components.tabs.settings import SettingsTab
|
||||
from rare.utils import legendary_utils
|
||||
from rare.utils.models import InstallQueueItemModel, InstallOptionsModel
|
||||
from rare.utils.utils import get_icon_color
|
||||
|
||||
|
||||
class TabWidget(QTabWidget):
|
||||
|
@ -63,7 +62,7 @@ class TabWidget(QTabWidget):
|
|||
account_button.menu().addAction(account_action)
|
||||
self.tabBar().setTabButton(disabled_tab + 1, self.tabBar().RightSide, account_button)
|
||||
|
||||
self.addTab(self.settings, icon("fa.gear", color=get_icon_color()),
|
||||
self.addTab(self.settings, icon("fa.gear"),
|
||||
"(!)" if self.settings.about.update_available else "")
|
||||
|
||||
# Signals
|
||||
|
|
|
@ -86,7 +86,9 @@ class SyncWidget(QGroupBox):
|
|||
|
||||
if not igame.save_path:
|
||||
igame.save_path = os.path.expanduser(f"~/{igame.app_name}/")
|
||||
QMessageBox.warning(self, "Savepath error", self.tr("Please edit save path of game {} manually in Cload saves tab").format(igame.title))
|
||||
QMessageBox.warning(self, "Savepath error",
|
||||
self.tr("Please edit save path of game {} manually in Cload saves tab").format(
|
||||
igame.title))
|
||||
if igame.save_path and not os.path.exists(igame.save_path):
|
||||
os.makedirs(igame.save_path)
|
||||
self.core.lgd.set_installed_game(self.igame.app_name, self.igame)
|
||||
|
|
|
@ -5,7 +5,6 @@ from PyQt5.QtWidgets import QGroupBox, QVBoxLayout, QLabel, QHBoxLayout, QPushBu
|
|||
from qtawesome import icon
|
||||
|
||||
from rare.utils.models import InstallQueueItemModel
|
||||
from rare.utils.utils import get_icon_color
|
||||
|
||||
logger = getLogger("QueueWidget")
|
||||
|
||||
|
@ -21,14 +20,14 @@ class DlWidget(QWidget):
|
|||
self.layout = QHBoxLayout()
|
||||
|
||||
self.left_layout = QVBoxLayout()
|
||||
self.move_up_button = QPushButton(icon("fa.arrow-up", color=get_icon_color()), "")
|
||||
self.move_up_button = QPushButton(icon("fa.arrow-up"), "")
|
||||
if index == 0:
|
||||
self.move_up_button.setDisabled(True)
|
||||
self.move_up_button.clicked.connect(lambda: self.move_up.emit(self.app_name))
|
||||
self.move_up_button.setFixedWidth(20)
|
||||
self.left_layout.addWidget(self.move_up_button)
|
||||
|
||||
self.move_down_buttton = QPushButton(icon("fa.arrow-down", color=get_icon_color()), "")
|
||||
self.move_down_buttton = QPushButton(icon("fa.arrow-down"), "")
|
||||
self.move_down_buttton.clicked.connect(lambda: self.move_down.emit(self.app_name))
|
||||
self.left_layout.addWidget(self.move_down_buttton)
|
||||
self.move_down_buttton.setFixedWidth(20)
|
||||
|
|
|
@ -8,7 +8,6 @@ from rare.components.tabs.games.game_info.uninstalled_info import UninstalledInf
|
|||
from rare.components.tabs.games.game_list import GameList
|
||||
from rare.components.tabs.games.import_widget import ImportWidget
|
||||
from rare.utils.extra_widgets import SelectViewWidget
|
||||
from rare.utils.utils import get_icon_color
|
||||
|
||||
|
||||
class GameTab(QWidget):
|
||||
|
@ -101,7 +100,7 @@ class GameListHeadBar(QWidget):
|
|||
self.layout.addWidget(self.filter)
|
||||
self.layout.addStretch(1)
|
||||
|
||||
self.import_game = QPushButton(icon("mdi.import", color=get_icon_color()), self.tr("Import Game"))
|
||||
self.import_game = QPushButton(icon("mdi.import"), self.tr("Import Game"))
|
||||
self.layout.addWidget(self.import_game)
|
||||
|
||||
self.layout.addStretch(1)
|
||||
|
@ -110,7 +109,7 @@ class GameListHeadBar(QWidget):
|
|||
self.search_bar.setObjectName("search_bar")
|
||||
self.search_bar.setFrame(False)
|
||||
icon_label = QLabel()
|
||||
icon_label.setPixmap(icon("fa.search", color=get_icon_color()).pixmap(QSize(20, 20)))
|
||||
icon_label.setPixmap(icon("fa.search").pixmap(QSize(20, 20)))
|
||||
self.layout.addWidget(icon_label)
|
||||
self.search_bar.setMinimumWidth(200)
|
||||
self.search_bar.setPlaceholderText(self.tr("Search Game"))
|
||||
|
@ -123,7 +122,7 @@ class GameListHeadBar(QWidget):
|
|||
self.layout.addWidget(self.view)
|
||||
self.layout.addStretch(1)
|
||||
self.refresh_list = QPushButton()
|
||||
self.refresh_list.setIcon(icon("fa.refresh", color=get_icon_color())) # Reload icon
|
||||
self.refresh_list.setIcon(icon("fa.refresh")) # Reload icon
|
||||
self.layout.addWidget(self.refresh_list)
|
||||
|
||||
self.setLayout(self.layout)
|
||||
|
|
|
@ -14,7 +14,7 @@ from rare.ui.components.tabs.games.game_info.game_info import Ui_GameInfo
|
|||
from rare.utils.extra_widgets import SideTabBar
|
||||
from rare.utils.legendary_utils import VerifyThread
|
||||
from rare.utils.steam_grades import SteamWorker
|
||||
from rare.utils.utils import get_size, get_pixmap, get_icon_color
|
||||
from rare.utils.utils import get_size, get_pixmap
|
||||
|
||||
|
||||
class InfoTabs(QTabWidget):
|
||||
|
@ -25,7 +25,7 @@ class InfoTabs(QTabWidget):
|
|||
self.setTabBar(SideTabBar())
|
||||
self.setTabPosition(QTabWidget.West)
|
||||
|
||||
self.addTab(QWidget(), icon("mdi.keyboard-backspace", color=get_icon_color()), self.tr("Back"))
|
||||
self.addTab(QWidget(), icon("mdi.keyboard-backspace"), self.tr("Back"))
|
||||
self.tabBarClicked.connect(lambda x: self.parent().layout.setCurrentIndex(0) if x == 0 else None)
|
||||
|
||||
self.info = GameInfo(core, self)
|
||||
|
@ -58,7 +58,6 @@ class InfoTabs(QTabWidget):
|
|||
self.parent().layout.setCurrentIndex(0)
|
||||
|
||||
|
||||
|
||||
class GameInfo(QWidget, Ui_GameInfo):
|
||||
igame: InstalledGame
|
||||
game: Game
|
||||
|
|
|
@ -13,7 +13,7 @@ from rare.ui.components.tabs.games.game_info.game_info import Ui_GameInfo
|
|||
from rare.utils.extra_widgets import SideTabBar
|
||||
from rare.utils.json_formatter import QJsonModel
|
||||
from rare.utils.steam_grades import SteamWorker
|
||||
from rare.utils.utils import get_pixmap, get_icon_color
|
||||
from rare.utils.utils import get_pixmap
|
||||
|
||||
|
||||
class UninstalledTabInfo(QTabWidget):
|
||||
|
@ -24,7 +24,7 @@ class UninstalledTabInfo(QTabWidget):
|
|||
self.setTabBar(SideTabBar())
|
||||
self.setTabPosition(QTabWidget.West)
|
||||
|
||||
self.addTab(QWidget(), icon("mdi.keyboard-backspace", color=get_icon_color()), self.tr("Back"))
|
||||
self.addTab(QWidget(), icon("mdi.keyboard-backspace"), self.tr("Back"))
|
||||
self.tabBarClicked.connect(lambda x: self.parent().layout.setCurrentIndex(0) if x == 0 else None)
|
||||
|
||||
self.info = UninstalledInfo(core, self)
|
||||
|
|
|
@ -9,7 +9,6 @@ from custom_legendary.core import LegendaryCore
|
|||
from custom_legendary.models.game import InstalledGame
|
||||
from rare.components.tabs.games.game_widgets.base_installed_widget import BaseInstalledWidget
|
||||
from rare.utils.extra_widgets import ClickableLabel
|
||||
from rare.utils.utils import get_icon_color
|
||||
|
||||
logger = getLogger("GameWidgetInstalled")
|
||||
|
||||
|
@ -52,7 +51,7 @@ class GameWidgetInstalled(BaseInstalledWidget):
|
|||
|
||||
# Info Button
|
||||
self.menu_btn = QPushButton()
|
||||
self.menu_btn.setIcon(icon("ei.info-circle", color=get_icon_color()))
|
||||
self.menu_btn.setIcon(icon("ei.info-circle"))
|
||||
# self.menu_btn.setObjectName("installed_menu_button")
|
||||
self.menu_btn.setIconSize(QSize(18, 18))
|
||||
self.menu_btn.enterEvent = lambda x: self.info_label.setText("Information")
|
||||
|
|
|
@ -7,7 +7,6 @@ from qtawesome import icon
|
|||
from custom_legendary.core import LegendaryCore
|
||||
from custom_legendary.models.game import InstalledGame
|
||||
from rare.components.tabs.games.game_widgets.base_installed_widget import BaseInstalledWidget
|
||||
from rare.utils.utils import get_icon_color
|
||||
|
||||
logger = getLogger("GameWidget")
|
||||
|
||||
|
@ -34,7 +33,7 @@ class InstalledListWidget(BaseInstalledWidget):
|
|||
self.image.setPixmap(self.pixmap)
|
||||
self.layout.addWidget(self.image)
|
||||
|
||||
play_icon = icon("ei.play", color=get_icon_color())
|
||||
play_icon = icon("ei.play")
|
||||
self.title_widget = QLabel(f"<h1>{self.igame.title}</h1>")
|
||||
self.app_name_label = QLabel(self.igame.app_name)
|
||||
self.launch_button = QPushButton(play_icon, self.tr("Launch"))
|
||||
|
|
|
@ -10,7 +10,6 @@ from qtawesome import icon
|
|||
from custom_legendary.core import LegendaryCore
|
||||
from rare.utils import legendary_utils
|
||||
from rare.utils.extra_widgets import PathEdit
|
||||
from rare.utils.utils import get_icon_color
|
||||
|
||||
logger = getLogger("Import")
|
||||
|
||||
|
@ -24,7 +23,7 @@ class ImportWidget(QWidget):
|
|||
self.game_list = [i.app_name for i in self.core.get_game_list()]
|
||||
|
||||
self.main_layout = QHBoxLayout()
|
||||
self.back_button = QPushButton(icon("mdi.keyboard-backspace", color=get_icon_color()), self.tr("Back"))
|
||||
self.back_button = QPushButton(icon("mdi.keyboard-backspace"), self.tr("Back"))
|
||||
self.right_layout = QVBoxLayout()
|
||||
self.right_layout.addWidget(self.back_button)
|
||||
self.right_layout.addStretch(1)
|
||||
|
|
|
@ -8,7 +8,6 @@ from qtawesome import icon
|
|||
|
||||
from rare import resources_path
|
||||
from rare.ui.utils.pathedit import Ui_PathEdit
|
||||
from rare.utils.utils import get_icon_color
|
||||
|
||||
|
||||
class FlowLayout(QLayout):
|
||||
|
@ -230,9 +229,9 @@ class SelectViewWidget(QWidget):
|
|||
self.list_view = QPushButton()
|
||||
if icon_view:
|
||||
self.icon_view_button.setIcon(icon("mdi.view-grid-outline", color="orange"))
|
||||
self.list_view.setIcon(icon("fa5s.list", color=get_icon_color()))
|
||||
self.list_view.setIcon(icon("fa5s.list"))
|
||||
else:
|
||||
self.icon_view_button.setIcon(icon("mdi.view-grid-outline", color=get_icon_color()))
|
||||
self.icon_view_button.setIcon(icon("mdi.view-grid-outline"))
|
||||
self.list_view.setIcon(icon("fa5s.list", color="orange"))
|
||||
|
||||
self.icon_view_button.clicked.connect(self.icon)
|
||||
|
@ -249,12 +248,12 @@ class SelectViewWidget(QWidget):
|
|||
|
||||
def icon(self):
|
||||
self.icon_view_button.setIcon(icon("mdi.view-grid-outline", color="orange"))
|
||||
self.list_view.setIcon(icon("fa5s.list", color=get_icon_color()))
|
||||
self.list_view.setIcon(icon("fa5s.list"))
|
||||
self.icon_view = False
|
||||
self.toggled.emit()
|
||||
|
||||
def list(self):
|
||||
self.icon_view_button.setIcon(icon("mdi.view-grid-outline", color=get_icon_color()))
|
||||
self.icon_view_button.setIcon(icon("mdi.view-grid-outline"))
|
||||
self.list_view.setIcon(icon("fa5s.list", color="orange"))
|
||||
self.icon_view = True
|
||||
self.toggled.emit()
|
||||
|
|
|
@ -114,7 +114,6 @@ def get_steam_id(title: str):
|
|||
return 0
|
||||
|
||||
|
||||
|
||||
def check_time(): # this function check if it's time to update
|
||||
global file
|
||||
text = open(file, 'r')
|
||||
|
|
|
@ -412,20 +412,3 @@ def text_color_for_background(background: Tuple[int, int, int]) -> Tuple[int,
|
|||
return 255, 255, 255
|
||||
else:
|
||||
return 0, 0, 0
|
||||
|
||||
|
||||
def get_icon_color() -> str:
|
||||
if settings.value("color_scheme") in [
|
||||
"Adapta-Nokto", "Arc-Dark", "Arc-Darker", "Darker", "Rare", "Numix-Dark"
|
||||
]:
|
||||
return "white"
|
||||
elif settings.value("style_sheet") in [
|
||||
"RareStyle"
|
||||
]:
|
||||
return "white"
|
||||
elif settings.value("color_scheme") in [
|
||||
"Airy", "Dusk", "Zukitre"
|
||||
]:
|
||||
return "black"
|
||||
else:
|
||||
return "white"
|
||||
|
|
Loading…
Reference in a new issue