mirror of
https://github.com/gryf/wicd.git
synced 2026-01-03 20:34:17 +01:00
curses/curses_misc.py:
added support for Meta and Ctrl being applied to keys in OptCols curses/wicd-curses.py Changed the colors slightly, colorized the clock.
This commit is contained in:
@@ -545,12 +545,21 @@ class OptCols(urwid.WidgetWrap):
|
|||||||
# callbacks map the text contents to its assigned callback.
|
# callbacks map the text contents to its assigned callback.
|
||||||
self.callbacks = []
|
self.callbacks = []
|
||||||
for cmd in tuples:
|
for cmd in tuples:
|
||||||
if cmd[0] == 'left':
|
splitcmd = cmd[0].split()
|
||||||
key = '<-'
|
key = ''
|
||||||
elif cmd[0] == 'right':
|
for part in splitcmd:
|
||||||
key = '->'
|
if part == 'ctrl':
|
||||||
else:
|
key+='C^'
|
||||||
key = cmd[0]
|
elif part == 'meta':
|
||||||
|
key+='M^'
|
||||||
|
else:
|
||||||
|
if part == 'left':
|
||||||
|
key += '<-'
|
||||||
|
elif part == 'right':
|
||||||
|
key += '->'
|
||||||
|
else:
|
||||||
|
key += part
|
||||||
|
|
||||||
#theText = urwid.Text([(attrs[0],cmd[0]),(attrs[1],cmd[1])])
|
#theText = urwid.Text([(attrs[0],cmd[0]),(attrs[1],cmd[1])])
|
||||||
if debug:
|
if debug:
|
||||||
callback = self.debugClick
|
callback = self.debugClick
|
||||||
|
|||||||
@@ -543,7 +543,9 @@ class appGUI():
|
|||||||
#(' ' ,' ',None),
|
#(' ' ,' ',None),
|
||||||
|
|
||||||
self.footer1 = OptCols(keys,debug=True)
|
self.footer1 = OptCols(keys,debug=True)
|
||||||
self.time_label = urwid.Text(strftime('%H:%M:%S'))
|
#self.time_label = urwid.Text(strftime('%H:%M:%S'))
|
||||||
|
self.time_label = \
|
||||||
|
urwid.AttrWrap(urwid.Text(strftime('%H:%M:%S')), 'timebar')
|
||||||
self.status_label = urwid.AttrWrap(urwid.Text('blah'),'important')
|
self.status_label = urwid.AttrWrap(urwid.Text('blah'),'important')
|
||||||
self.footer2 = urwid.Columns([self.status_label,('fixed', 8, self.time_label)])
|
self.footer2 = urwid.Columns([self.status_label,('fixed', 8, self.time_label)])
|
||||||
self.footerList = urwid.ListBox([self.footer1,self.footer2])
|
self.footerList = urwid.ListBox([self.footer1,self.footer2])
|
||||||
@@ -892,29 +894,29 @@ def main():
|
|||||||
# Default Color scheme.
|
# Default Color scheme.
|
||||||
# Other potential color schemes can be found at:
|
# Other potential color schemes can be found at:
|
||||||
# http://excess.org/urwid/wiki/RecommendedPalette
|
# http://excess.org/urwid/wiki/RecommendedPalette
|
||||||
# Note: the current palette below is optimized for the linux console.
|
|
||||||
# For example, this looks particularly bad on a default-colored XTerm.
|
# Thanks to nanotube on #wicd for helping with this
|
||||||
# NB: To find current terminal background use variable COLORFGBG
|
|
||||||
ui.register_palette([
|
ui.register_palette([
|
||||||
('body','default','default'),
|
('body','default','default'),
|
||||||
('focus','dark magenta','light gray'),
|
('focus','dark magenta','light gray'),
|
||||||
('header','light blue','default'),
|
('header','light blue','default'),
|
||||||
('important','light red','default'),
|
('important','light red','default'),
|
||||||
('connected','dark green','default'),
|
('connected','dark green','default'),
|
||||||
('connected focus','default','dark green'),
|
('connected focus','black','dark green'),
|
||||||
('editcp', 'default', 'default', 'standout'),
|
('editcp', 'default', 'default', 'standout'),
|
||||||
('editbx', 'light gray', 'dark blue'),
|
('editbx', 'light gray', 'dark blue'),
|
||||||
('editfc', 'white','dark blue', 'bold'),
|
('editfc', 'white','dark blue', 'bold'),
|
||||||
('editnfc','dark gray','default'),
|
('editnfc','dark gray','default','bold'),
|
||||||
('tab active','dark green','light gray'),
|
('tab active','dark green','light gray'),
|
||||||
('infobar','light gray','dark blue'),
|
('infobar','light gray','dark blue'),
|
||||||
|
('timebar','dark gray','default'),
|
||||||
# Simple colors around text
|
# Simple colors around text
|
||||||
('green','dark green','default'),
|
('green','dark green','default'),
|
||||||
('blue','dark blue','default'),
|
('blue','dark blue','default'),
|
||||||
('red','dark red','default'),
|
('red','dark red','default'),
|
||||||
('bold','white','black','bold')])
|
('bold','white','black','bold')])
|
||||||
# This is a wrapper around a function that calls another a function that is a
|
# This is a wrapper around a function that calls another a function that
|
||||||
# wrapper around a infinite loop. Fun.
|
# is a wrapper around a infinite loop. Fun.
|
||||||
urwid.set_encoding('utf8')
|
urwid.set_encoding('utf8')
|
||||||
ui.run_wrapper(run)
|
ui.run_wrapper(run)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user