Add tab shortcuts alt + 1/2...
This commit is contained in:
parent
ed81bbf399
commit
82627a799e
1 changed files with 7 additions and 1 deletions
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue