1
0
Fork 0
mirror of synced 2024-10-01 09:47:29 +13:00

Add tab shortcuts alt + 1/2...

This commit is contained in:
Dummerle 2021-08-23 17:03:42 +02:00
parent ed81bbf399
commit 82627a799e

View file

@ -1,7 +1,7 @@
import webbrowser import webbrowser
from PyQt5.QtCore import QSize, pyqtSignal from PyQt5.QtCore import QSize, pyqtSignal
from PyQt5.QtWidgets import QMenu, QTabWidget, QWidget, QWidgetAction from PyQt5.QtWidgets import QMenu, QTabWidget, QWidget, QWidgetAction, QShortcut
from qtawesome import icon from qtawesome import icon
from custom_legendary.core import LegendaryCore from custom_legendary.core import LegendaryCore
@ -108,6 +108,12 @@ class TabWidget(QTabWidget):
self.tabBarClicked.connect(lambda x: self.games_tab.layout.setCurrentIndex(0) if x == 0 else None) self.tabBarClicked.connect(lambda x: self.games_tab.layout.setCurrentIndex(0) if x == 0 else None)
self.setIconSize(QSize(25, 25)) self.setIconSize(QSize(25, 25))
# shortcuts
QShortcut("Alt+1", self).activated.connect(lambda: self.setCurrentIndex(0))
QShortcut("Alt+2", self).activated.connect(lambda: self.setCurrentIndex(1))
QShortcut("Alt+3", self).activated.connect(lambda: self.setCurrentIndex(2))
QShortcut("Alt+4", self).activated.connect(lambda: self.setCurrentIndex(5))
# TODO; maybe pass InstallOptionsModel only, not split arguments # TODO; maybe pass InstallOptionsModel only, not split arguments
def install_game(self, options: InstallOptionsModel, update=False, silent=False): def install_game(self, options: InstallOptionsModel, update=False, silent=False):
install_dialog = InstallDialog(self.core, install_dialog = InstallDialog(self.core,