mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-30 03:14:22 +00:00
console: status bar improvements
- Arrow to show flow order - Hook statusbar up to focus change to fix some update issues
This commit is contained in:
parent
f08b57fb9b
commit
5975cc8301
@ -123,10 +123,14 @@ if urwid.util.detected_encoding:
|
|||||||
SYMBOL_REPLAY = u"\u21ba"
|
SYMBOL_REPLAY = u"\u21ba"
|
||||||
SYMBOL_RETURN = u"\u2190"
|
SYMBOL_RETURN = u"\u2190"
|
||||||
SYMBOL_MARK = u"\u25cf"
|
SYMBOL_MARK = u"\u25cf"
|
||||||
|
SYMBOL_UP = u"\u21E7"
|
||||||
|
SYMBOL_DOWN = u"\u21E9"
|
||||||
else:
|
else:
|
||||||
SYMBOL_REPLAY = u"[r]"
|
SYMBOL_REPLAY = u"[r]"
|
||||||
SYMBOL_RETURN = u"<-"
|
SYMBOL_RETURN = u"<-"
|
||||||
SYMBOL_MARK = "[m]"
|
SYMBOL_MARK = "[m]"
|
||||||
|
SYMBOL_UP = "^"
|
||||||
|
SYMBOL_DOWN = " "
|
||||||
|
|
||||||
|
|
||||||
# Save file to disk
|
# Save file to disk
|
||||||
|
@ -119,12 +119,13 @@ class StatusBar(urwid.WidgetWrap):
|
|||||||
self.helptext = helptext
|
self.helptext = helptext
|
||||||
self.ib = urwid.WidgetWrap(urwid.Text(""))
|
self.ib = urwid.WidgetWrap(urwid.Text(""))
|
||||||
super().__init__(urwid.Pile([self.ib, self.master.ab]))
|
super().__init__(urwid.Pile([self.ib, self.master.ab]))
|
||||||
signals.update_settings.connect(self.sig_update_settings)
|
signals.update_settings.connect(self.sig_update)
|
||||||
signals.flowlist_change.connect(self.sig_update_settings)
|
signals.flowlist_change.connect(self.sig_update)
|
||||||
master.options.changed.connect(self.sig_update_settings)
|
master.options.changed.connect(self.sig_update)
|
||||||
|
master.view.focus.sig_change.connect(self.sig_update)
|
||||||
self.redraw()
|
self.redraw()
|
||||||
|
|
||||||
def sig_update_settings(self, sender, updated=None):
|
def sig_update(self, sender, updated=None):
|
||||||
self.redraw()
|
self.redraw()
|
||||||
|
|
||||||
def keypress(self, *args, **kwargs):
|
def keypress(self, *args, **kwargs):
|
||||||
@ -229,8 +230,14 @@ class StatusBar(urwid.WidgetWrap):
|
|||||||
offset = 0
|
offset = 0
|
||||||
else:
|
else:
|
||||||
offset = self.master.view.focus.index + 1
|
offset = self.master.view.focus.index + 1
|
||||||
|
|
||||||
|
if self.master.options.order_reversed:
|
||||||
|
arrow = common.SYMBOL_UP
|
||||||
|
else:
|
||||||
|
arrow = common.SYMBOL_DOWN
|
||||||
|
|
||||||
t = [
|
t = [
|
||||||
('heading', ("[%s/%s]" % (offset, fc)).ljust(9))
|
('heading', ("%s [%s/%s]" % (arrow, offset, fc)).ljust(11)),
|
||||||
]
|
]
|
||||||
|
|
||||||
if self.master.server.bound:
|
if self.master.server.bound:
|
||||||
|
Loading…
Reference in New Issue
Block a user