mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 00:01:36 +00:00
Merge pull request #1693 from cortesi/statusbar
console: status bar improvements
This commit is contained in:
commit
be6ce4f22b
@ -123,10 +123,14 @@ if urwid.util.detected_encoding:
|
||||
SYMBOL_REPLAY = u"\u21ba"
|
||||
SYMBOL_RETURN = u"\u2190"
|
||||
SYMBOL_MARK = u"\u25cf"
|
||||
SYMBOL_UP = u"\u21E7"
|
||||
SYMBOL_DOWN = u"\u21E9"
|
||||
else:
|
||||
SYMBOL_REPLAY = u"[r]"
|
||||
SYMBOL_RETURN = u"<-"
|
||||
SYMBOL_MARK = "[m]"
|
||||
SYMBOL_UP = "^"
|
||||
SYMBOL_DOWN = " "
|
||||
|
||||
|
||||
# Save file to disk
|
||||
|
@ -119,12 +119,13 @@ class StatusBar(urwid.WidgetWrap):
|
||||
self.helptext = helptext
|
||||
self.ib = urwid.WidgetWrap(urwid.Text(""))
|
||||
super().__init__(urwid.Pile([self.ib, self.master.ab]))
|
||||
signals.update_settings.connect(self.sig_update_settings)
|
||||
signals.flowlist_change.connect(self.sig_update_settings)
|
||||
master.options.changed.connect(self.sig_update_settings)
|
||||
signals.update_settings.connect(self.sig_update)
|
||||
signals.flowlist_change.connect(self.sig_update)
|
||||
master.options.changed.connect(self.sig_update)
|
||||
master.view.focus.sig_change.connect(self.sig_update)
|
||||
self.redraw()
|
||||
|
||||
def sig_update_settings(self, sender, updated=None):
|
||||
def sig_update(self, sender, updated=None):
|
||||
self.redraw()
|
||||
|
||||
def keypress(self, *args, **kwargs):
|
||||
@ -180,6 +181,10 @@ class StatusBar(urwid.WidgetWrap):
|
||||
r.append("[")
|
||||
r.append(("heading_key", "M"))
|
||||
r.append(":%s]" % self.master.options.default_contentview)
|
||||
if self.master.options.order:
|
||||
r.append("[")
|
||||
r.append(("heading_key", "o"))
|
||||
r.append(":%s]" % self.master.options.order)
|
||||
|
||||
opts = []
|
||||
if self.master.options.anticache:
|
||||
@ -229,8 +234,14 @@ class StatusBar(urwid.WidgetWrap):
|
||||
offset = 0
|
||||
else:
|
||||
offset = self.master.view.focus.index + 1
|
||||
|
||||
if self.master.options.order_reversed:
|
||||
arrow = common.SYMBOL_UP
|
||||
else:
|
||||
arrow = common.SYMBOL_DOWN
|
||||
|
||||
t = [
|
||||
('heading', ("[%s/%s]" % (offset, fc)).ljust(9))
|
||||
('heading', ("%s [%s/%s]" % (arrow, offset, fc)).ljust(11)),
|
||||
]
|
||||
|
||||
if self.master.server.bound:
|
||||
|
Loading…
Reference in New Issue
Block a user