From 65971f02ade7cc2126b4142a32c363e02112f95c Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Fri, 3 Apr 2015 14:10:57 +1300 Subject: console: basic options page --- libmproxy/console/palettes.py | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'libmproxy/console/palettes.py') diff --git a/libmproxy/console/palettes.py b/libmproxy/console/palettes.py index cfb2702c..020863f8 100644 --- a/libmproxy/console/palettes.py +++ b/libmproxy/console/palettes.py @@ -17,6 +17,9 @@ class Palette: # Help 'key', 'head', 'text', + # Options + 'option_selected', 'option_active', 'option_active_selected', + # List and Connections 'method', 'focus', 'code_200', 'code_300', 'code_400', 'code_500', 'code_other', @@ -60,6 +63,9 @@ class LowDark(Palette): head = ('white,bold', 'default'), text = ('light gray', 'default'), + # Options + option_selected = ('light gray', 'dark blue'), + # List and Connections method = ('dark cyan', 'default'), focus = ('yellow', 'default'), @@ -112,6 +118,11 @@ class LowLight(Palette): head = ('black,bold', 'default'), text = ('dark gray', 'default'), + # Options + option_selected = ('light gray', 'dark blue'), + option_active = ('light red', 'default'), + option_active_selected = ('light red', 'dark blue'), + # List and Connections method = ('dark cyan', 'default'), focus = ('black', 'default'), @@ -181,6 +192,11 @@ class SolarizedLight(LowLight): key = (sol_blue, 'default',), head = (sol_base00, 'default'), + # Options + option_selected = (sol_base2, sol_base02), + option_active = (sol_orange, 'default'), + option_active_selected = (sol_orange, sol_base02), + # List and Connections method = (sol_cyan, 'default'), focus = (sol_base01, 'default'), @@ -223,6 +239,9 @@ class SolarizedDark(LowDark): key = (sol_blue, 'default',), head = (sol_base00, 'default'), + # Options + option_selected = (sol_base03, sol_base01), + # List and Connections method = (sol_cyan, 'default'), focus = (sol_base1, 'default'), @@ -252,10 +271,10 @@ class SolarizedDark(LowDark): palettes = { - "lowlight": LowLight(), - "lowdark": LowDark(), - "light": Light(), - "dark": Dark(), + #"lowlight": LowLight(), + #"lowdark": LowDark(), + #"light": Light(), + #"dark": Dark(), "solarized_light": SolarizedLight(), - "solarized_dark": SolarizedDark(), + #"solarized_dark": SolarizedDark(), } -- cgit v1.2.3 From 57bdb893425058d03b1aaf28e1c774c81a8d9403 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Fri, 3 Apr 2015 14:38:04 +1300 Subject: console: keyboard shortcuts for options --- libmproxy/console/palettes.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libmproxy/console/palettes.py') diff --git a/libmproxy/console/palettes.py b/libmproxy/console/palettes.py index 020863f8..98a1e042 100644 --- a/libmproxy/console/palettes.py +++ b/libmproxy/console/palettes.py @@ -19,6 +19,7 @@ class Palette: # Options 'option_selected', 'option_active', 'option_active_selected', + 'option_selected_key', # List and Connections 'method', 'focus', @@ -120,6 +121,7 @@ class LowLight(Palette): # Options option_selected = ('light gray', 'dark blue'), + option_selected_key = ('dark blue,bold', 'dark blue'), option_active = ('light red', 'default'), option_active_selected = ('light red', 'dark blue'), @@ -194,6 +196,7 @@ class SolarizedLight(LowLight): # Options option_selected = (sol_base2, sol_base02), + option_selected_key = (sol_blue, sol_base02), option_active = (sol_orange, 'default'), option_active_selected = (sol_orange, sol_base02), @@ -271,7 +274,7 @@ class SolarizedDark(LowDark): palettes = { - #"lowlight": LowLight(), + "lowlight": LowLight(), #"lowdark": LowDark(), #"light": Light(), #"dark": Dark(), -- cgit v1.2.3 From aadaa66d0b92ce7e97e3303e3152a2dda6d320e9 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Fri, 3 Apr 2015 19:44:09 +1300 Subject: console: tune and re-enable palettes --- libmproxy/console/palettes.py | 46 ++++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 20 deletions(-) (limited to 'libmproxy/console/palettes.py') diff --git a/libmproxy/console/palettes.py b/libmproxy/console/palettes.py index 98a1e042..b55a34aa 100644 --- a/libmproxy/console/palettes.py +++ b/libmproxy/console/palettes.py @@ -66,6 +66,9 @@ class LowDark(Palette): # Options option_selected = ('light gray', 'dark blue'), + option_selected_key = ('light cyan', 'dark blue'), + option_active = ('light red', 'default'), + option_active_selected = ('light red', 'dark blue'), # List and Connections method = ('dark cyan', 'default'), @@ -107,23 +110,23 @@ class LowLight(Palette): Low-color light background """ low = dict( - title = ('dark magenta,bold', 'light blue'), + title = ('dark magenta', 'default'), # Status bar & heading - heading = ('light gray', 'dark blue'), - heading_key = ('light cyan', 'dark blue'), + heading = ('white', 'black'), + heading_key = ('dark blue', 'black'), heading_inactive = ('black', 'light gray'), # Help - key = ('dark blue,bold', 'default'), - head = ('black,bold', 'default'), + key = ('dark blue', 'default'), + head = ('black', 'default'), text = ('dark gray', 'default'), # Options - option_selected = ('light gray', 'dark blue'), - option_selected_key = ('dark blue,bold', 'dark blue'), + option_selected = ('black', 'light gray'), + option_selected_key = ('dark blue', 'light gray'), option_active = ('light red', 'default'), - option_active_selected = ('light red', 'dark blue'), + option_active_selected = ('light red', 'light gray'), # List and Connections method = ('dark cyan', 'default'), @@ -195,10 +198,10 @@ class SolarizedLight(LowLight): head = (sol_base00, 'default'), # Options - option_selected = (sol_base2, sol_base02), - option_selected_key = (sol_blue, sol_base02), + option_selected = (sol_base03, sol_base2), + option_selected_key = (sol_blue, sol_base2), option_active = (sol_orange, 'default'), - option_active_selected = (sol_orange, sol_base02), + option_active_selected = (sol_orange, sol_base2), # List and Connections method = (sol_cyan, 'default'), @@ -231,19 +234,22 @@ class SolarizedLight(LowLight): class SolarizedDark(LowDark): high = dict( title = (sol_blue, 'default'), - text = (sol_base0, 'default'), + text = (sol_base1, 'default'), # Status bar & heading - heading = (sol_base03, sol_base1), - heading_key = (sol_blue+",bold", sol_base1), + heading = (sol_base2, sol_base01), + heading_key = (sol_blue+",bold", sol_base01), heading_inactive = (sol_base1, sol_base02), # Help key = (sol_blue, 'default',), - head = (sol_base00, 'default'), + head = (sol_base2, 'default'), # Options - option_selected = (sol_base03, sol_base01), + option_selected = (sol_base03, sol_base00), + option_selected_key = (sol_blue, sol_base00), + option_active = (sol_orange, 'default'), + option_active_selected = (sol_orange, sol_base00), # List and Connections method = (sol_cyan, 'default'), @@ -275,9 +281,9 @@ class SolarizedDark(LowDark): palettes = { "lowlight": LowLight(), - #"lowdark": LowDark(), - #"light": Light(), - #"dark": Dark(), + "lowdark": LowDark(), + "light": Light(), + "dark": Dark(), "solarized_light": SolarizedLight(), - #"solarized_dark": SolarizedDark(), + "solarized_dark": SolarizedDark(), } -- cgit v1.2.3 From 9e39999706dc1fbe3907a4d98aa30d777d6dfba7 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Mon, 6 Apr 2015 16:46:51 +1200 Subject: Add headings to options, start migrating more options into options screen SetHeaders first... --- libmproxy/console/palettes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libmproxy/console/palettes.py') diff --git a/libmproxy/console/palettes.py b/libmproxy/console/palettes.py index b55a34aa..3e6ce21f 100644 --- a/libmproxy/console/palettes.py +++ b/libmproxy/console/palettes.py @@ -185,7 +185,7 @@ sol_cyan = "h37" sol_green = "h64" class SolarizedLight(LowLight): high = dict( - title = (sol_blue, 'default'), + title = (sol_cyan, 'default'), text = (sol_base00, 'default'), # Status bar & heading -- cgit v1.2.3 From 1cb1ee411b9c8ffc40f83bcca99770af7f43a521 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Tue, 7 Apr 2015 08:42:40 +1200 Subject: console: palette picker for the options screen --- libmproxy/console/palettes.py | 1 + 1 file changed, 1 insertion(+) (limited to 'libmproxy/console/palettes.py') diff --git a/libmproxy/console/palettes.py b/libmproxy/console/palettes.py index 3e6ce21f..a6ad3f45 100644 --- a/libmproxy/console/palettes.py +++ b/libmproxy/console/palettes.py @@ -279,6 +279,7 @@ class SolarizedDark(LowDark): ) +DEFAULT = "dark" palettes = { "lowlight": LowLight(), "lowdark": LowDark(), -- cgit v1.2.3 From f6a3bd15b3b8c3d30abf6e5209e10cff3c4784e0 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Tue, 7 Apr 2015 10:01:18 +1200 Subject: console: All palettes now explicitly set a background colour There's a new option --palette-transparent to turn this off if you want to use your own terminal background. --- libmproxy/console/palettes.py | 50 ++++++++++++++++++++++++++++++++----------- 1 file changed, 37 insertions(+), 13 deletions(-) (limited to 'libmproxy/console/palettes.py') diff --git a/libmproxy/console/palettes.py b/libmproxy/console/palettes.py index a6ad3f45..52d7ab8f 100644 --- a/libmproxy/console/palettes.py +++ b/libmproxy/console/palettes.py @@ -1,4 +1,3 @@ - # Low-color themes should ONLY use the standard foreground and background # colours listed here: # @@ -6,9 +5,9 @@ # - class Palette: _fields = [ + 'background', 'title', # Status bar & heading @@ -35,15 +34,33 @@ class Palette: ] high = None - def palette(self): + def palette(self, transparent): l = [] + highback, lowback = None, None + if not transparent: + if self.high and self.high.get("background"): + highback = self.high["background"][1] + lowback = self.low["background"][1] + for i in self._fields: - v = [i] - v.extend(self.low[i]) - if self.high and i in self.high: - v.append(None) - v.extend(self.high[i]) - l.append(tuple(v)) + if transparent and i == "background": + l.append(["background", "default", "default"]) + else: + v = [i] + low = list(self.low[i]) + if lowback and low[1] == "default": + low[1] = lowback + v.extend(low) + if self.high and i in self.high: + v.append(None) + high = list(self.high[i]) + if highback and high[1] == "default": + high[1] = highback + v.extend(high) + elif highback: + high = [None, low[0], highback] + v.extend(high) + l.append(tuple(v)) return l @@ -52,6 +69,7 @@ class LowDark(Palette): Low-color dark background """ low = dict( + background = ('white', 'black'), title = ('white,bold', 'default'), # Status bar & heading @@ -110,6 +128,7 @@ class LowLight(Palette): Low-color light background """ low = dict( + background = ('black', 'white'), title = ('dark magenta', 'default'), # Status bar & heading @@ -158,6 +177,7 @@ class LowLight(Palette): class Light(LowLight): high = dict( + background = ('black', 'g100'), heading = ('g99', '#08f'), heading_key = ('#0ff,bold', '#08f'), heading_inactive = ('g35', 'g85'), @@ -171,10 +191,10 @@ sol_base03 = "h234" sol_base02 = "h235" sol_base01 = "h240" sol_base00 = "h241" -sol_base0 = "h244" -sol_base1 = "h245" -sol_base2 = "h254" -sol_base3 = "h230" +sol_base0 = "h244" +sol_base1 = "h245" +sol_base2 = "h254" +sol_base3 = "h230" sol_yellow = "h136" sol_orange = "h166" sol_red = "h160" @@ -183,8 +203,11 @@ sol_violet = "h61" sol_blue = "h33" sol_cyan = "h37" sol_green = "h64" + + class SolarizedLight(LowLight): high = dict( + background = (sol_base00, sol_base3), title = (sol_cyan, 'default'), text = (sol_base00, 'default'), @@ -233,6 +256,7 @@ class SolarizedLight(LowLight): class SolarizedDark(LowDark): high = dict( + background = (sol_base2, sol_base03), title = (sol_blue, 'default'), text = (sol_base1, 'default'), -- cgit v1.2.3 From 6bab6f2ef1b5043bdb8263bc45429fc45d66c7e2 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Tue, 7 Apr 2015 11:36:42 +1200 Subject: console: tune palettes a bit --- libmproxy/console/palettes.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'libmproxy/console/palettes.py') diff --git a/libmproxy/console/palettes.py b/libmproxy/console/palettes.py index 52d7ab8f..e34233a6 100644 --- a/libmproxy/console/palettes.py +++ b/libmproxy/console/palettes.py @@ -57,7 +57,7 @@ class Palette: if highback and high[1] == "default": high[1] = highback v.extend(high) - elif highback: + elif highback and self.low[i][1] == "default": high = [None, low[0], highback] v.extend(high) l.append(tuple(v)) @@ -73,9 +73,9 @@ class LowDark(Palette): title = ('white,bold', 'default'), # Status bar & heading - heading = ('light gray', 'dark blue'), + heading = ('white', 'dark blue'), heading_key = ('light cyan', 'dark blue'), - heading_inactive = ('white', 'dark gray'), + heading_inactive = ('dark gray', 'light gray'), # Help key = ('light cyan', 'default'), @@ -83,10 +83,10 @@ class LowDark(Palette): text = ('light gray', 'default'), # Options - option_selected = ('light gray', 'dark blue'), - option_selected_key = ('light cyan', 'dark blue'), + option_selected = ('black', 'light gray'), + option_selected_key = ('light cyan', 'light gray'), option_active = ('light red', 'default'), - option_active_selected = ('light red', 'dark blue'), + option_active_selected = ('light red', 'light gray'), # List and Connections method = ('dark cyan', 'default'), @@ -120,6 +120,10 @@ class Dark(LowDark): high = dict( heading_inactive = ('g58', 'g11'), intercept = ('#f60', 'default'), + + option_selected = ('g85', 'g45'), + option_selected_key = ('light cyan', 'g50'), + option_active_selected = ('light red', 'g50'), ) @@ -182,6 +186,10 @@ class Light(LowLight): heading_key = ('#0ff,bold', '#08f'), heading_inactive = ('g35', 'g85'), replay = ('#0a0,bold', 'default'), + + option_selected = ('black', 'g85'), + option_selected_key = ('dark blue', 'g85'), + option_active_selected = ('light red', 'g85'), ) -- cgit v1.2.3 From cb880cc65a6fc522ea457e0e2d0a61da4cc9405a Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Thu, 16 Apr 2015 12:16:07 +1200 Subject: Adjust header key color in solarized palettes --- libmproxy/console/palettes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libmproxy/console/palettes.py') diff --git a/libmproxy/console/palettes.py b/libmproxy/console/palettes.py index e34233a6..6490eb73 100644 --- a/libmproxy/console/palettes.py +++ b/libmproxy/console/palettes.py @@ -246,7 +246,7 @@ class SolarizedLight(LowLight): error = (sol_red, 'default'), - header = (sol_base01, 'default'), + header = (sol_blue, 'default'), highlight = (sol_base01, 'default'), intercept = (sol_red, 'default',), replay = (sol_green, 'default',), @@ -295,7 +295,7 @@ class SolarizedDark(LowDark): error = (sol_red, 'default'), - header = (sol_base01, 'default'), + header = (sol_blue, 'default'), highlight = (sol_base01, 'default'), intercept = (sol_red, 'default',), replay = (sol_green, 'default',), -- cgit v1.2.3 From a05a70d8168a07c92b2a3ecbbb1958d85532efe3 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sat, 30 May 2015 12:03:28 +1200 Subject: Add coding style check, reformat. --- libmproxy/console/palettes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libmproxy/console/palettes.py') diff --git a/libmproxy/console/palettes.py b/libmproxy/console/palettes.py index 6490eb73..ea3d1b62 100644 --- a/libmproxy/console/palettes.py +++ b/libmproxy/console/palettes.py @@ -270,7 +270,7 @@ class SolarizedDark(LowDark): # Status bar & heading heading = (sol_base2, sol_base01), - heading_key = (sol_blue+",bold", sol_base01), + heading_key = (sol_blue + ",bold", sol_base01), heading_inactive = (sol_base1, sol_base02), # Help -- cgit v1.2.3