1
0
Fork 0
mirror of synced 2024-06-26 18:20:50 +12:00

Dynamically add filters in head bar

This commit is contained in:
Dummerle 2021-12-31 01:03:59 +01:00
parent 78c0a74692
commit 868ef90a77
No known key found for this signature in database
GPG key ID: AB68CC59CA39F2F1

View file

@ -9,6 +9,7 @@ from PyQt5.QtWidgets import (
)
from qtawesome import icon
from rare import shared
from rare.utils.extra_widgets import SelectViewWidget
@ -29,21 +30,29 @@ class GameListHeadBar(QWidget):
self.tr("All"),
self.tr("Installed only"),
self.tr("Offline Games"),
self.tr("32 Bit Games"),
self.tr("Mac games"),
self.tr("Exclude Origin"),
# ,
#
# self.tr(),
]
)
self.layout().addWidget(self.filter)
self.available_filters = [
"all",
"installed",
"offline",
"32bit",
"mac",
"installable",
]
if shared.api_results.bit32_games:
self.filter.addItem(self.tr("32 Bit Games"))
self.available_filters.append("32bit")
if shared.api_results.mac_games:
self.filter.addItem(self.tr("Mac games"))
self.available_filters.append("mac")
if shared.api_results.no_asset_games:
self.filter.addItem(self.tr("Exclude Origin"))
self.available_filters.append("installable")
self.layout().addWidget(self.filter)
try:
self.filter.setCurrentIndex(self.settings.value("filter", 0, int))