mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
always start in first sidebar mode
I didn't notice anyone objecting; let's see how this is received. https://forums.ankiweb.net/t/anki-2-1-45-alpha/10061/35
This commit is contained in:
parent
adcdb422c5
commit
5a8f534f00
1 changed files with 2 additions and 3 deletions
|
@ -40,12 +40,11 @@ class SidebarToolbar(QToolBar):
|
||||||
action.setCheckable(True)
|
action.setCheckable(True)
|
||||||
action.setShortcut(f"Alt+{row + 1}")
|
action.setShortcut(f"Alt+{row + 1}")
|
||||||
self._action_group.addAction(action)
|
self._action_group.addAction(action)
|
||||||
saved = self.sidebar.col.get_config("sidebarTool", 0)
|
# always start with first tool
|
||||||
active = saved if saved < len(self._tools) else 0
|
active = 0
|
||||||
self._action_group.actions()[active].setChecked(True)
|
self._action_group.actions()[active].setChecked(True)
|
||||||
self.sidebar.tool = self._tools[active][0]
|
self.sidebar.tool = self._tools[active][0]
|
||||||
|
|
||||||
def _on_action_group_triggered(self, action: QAction) -> None:
|
def _on_action_group_triggered(self, action: QAction) -> None:
|
||||||
index = self._action_group.actions().index(action)
|
index = self._action_group.actions().index(action)
|
||||||
self.sidebar.col.set_config("sidebarTool", index)
|
|
||||||
self.sidebar.tool = self._tools[index][0]
|
self.sidebar.tool = self._tools[index][0]
|
||||||
|
|
Loading…
Reference in a new issue