Reset focus when changing workspaces, style changes
This commit is contained in:
@@ -73,6 +73,7 @@ class CmdAsana:
|
||||
if old_widget != None:
|
||||
self.clearSignals(old_widget)
|
||||
self.frame.contents.append((widget, self.frame.options()))
|
||||
self.frame.focus_position = 0
|
||||
|
||||
def showWorkspace(self, workspace_id):
|
||||
task_list = ui.TaskList(self.allMyTasks(workspace_id))
|
||||
@@ -133,9 +134,9 @@ class CmdAsana:
|
||||
urwid.connect_signal(workspace_menu, 'click', self.showWorkspace)
|
||||
|
||||
self.frame = urwid.Pile([
|
||||
('pack', workspace_menu),
|
||||
('pack', urwid.AttrMap(urwid.Divider(), 'header divider')),
|
||||
None])
|
||||
('pack', urwid.AttrMap(workspace_menu, 'workspace')),
|
||||
None
|
||||
])
|
||||
self.showWorkspace(self.myWorkspaces()[0]['id'])
|
||||
|
||||
loop = urwid.MainLoop(self.frame,
|
||||
|
||||
9
ui.py
9
ui.py
@@ -8,10 +8,9 @@ LIST = 'list'
|
||||
palette = [
|
||||
('selected', 'standout', ''),
|
||||
('selected workspace', 'standout,bold', ''),
|
||||
('header divider', '', 'dark blue'),
|
||||
('header', 'bold,dark cyan', ''),
|
||||
('task', 'dark cyan', 'black'),
|
||||
('workspace', 'yellow', '')
|
||||
('header', 'bold,light green', ''),
|
||||
('task', 'light green', ''),
|
||||
('workspace', 'white', 'dark blue')
|
||||
]
|
||||
|
||||
class WorkspaceMenu(urwid.Columns):
|
||||
@@ -21,7 +20,7 @@ class WorkspaceMenu(urwid.Columns):
|
||||
for workspace in workspaces:
|
||||
button = WorkspaceButton(workspace, self.loadWorkspace)
|
||||
self.contents.append((urwid.AttrMap(button,
|
||||
'workspace',
|
||||
None,
|
||||
focus_map='selected workspace'),
|
||||
self.options('given', 24)))
|
||||
def keypress(self, size, key):
|
||||
|
||||
Reference in New Issue
Block a user