Update color palette

Create palette for traffic light buttons: green (default), amber and
red. Color-code most buttons.

Make all progressbars orange for the completed part.
This commit is contained in:
Dimitri John Ledkov 2017-09-11 16:25:25 +01:00
parent ff9c5fb293
commit 7c5e55e0b2
No known key found for this signature in database
GPG Key ID: CAC2D8B9CD2CA5F9
8 changed files with 22 additions and 10 deletions

View File

@ -43,6 +43,10 @@ STYLES = [
('menu_button focus', black, light_gray, '', black, light_gray), ('menu_button focus', black, light_gray, '', black, light_gray),
('button', white, '', '', white, ''), ('button', white, '', '', white, ''),
('button focus', black, dark_green, '', black, dark_green), ('button focus', black, dark_green, '', black, dark_green),
('redbutton', white, '', '', white, ''),
('redbutton focus', black, dark_red, '', black, dark_red),
('amberbutton', white, '', '', white, ''),
('amberbutton focus', black, yellow, '', black, yellow),
('info_primary', white, '', '', white, ''), ('info_primary', white, '', '', white, ''),
('info_major', light_gray, '', '', light_gray, ''), ('info_major', light_gray, '', '', light_gray, ''),
('info_minor', dark_gray, '', '', dark_gray, ''), ('info_minor', dark_gray, '', '', dark_gray, ''),
@ -50,7 +54,7 @@ STYLES = [
('string_input', black, light_gray, '', black, light_gray), ('string_input', black, light_gray, '', black, light_gray),
('string_input focus', white, dark_gray, '', white, dark_gray), ('string_input focus', white, dark_gray, '', white, dark_gray),
('progress_incomplete', white, dark_magenta, '', white, dark_magenta), ('progress_incomplete', white, dark_magenta, '', white, dark_magenta),
('progress_complete', white, light_magenta, '', white, light_magenta) ('progress_complete', white, dark_blue, '', white, orange)
] ]
STYLES_MONO = [ STYLES_MONO = [
@ -62,6 +66,10 @@ STYLES_MONO = [
('menu_button focus', '', '', '', white, ''), ('menu_button focus', '', '', '', white, ''),
('button', white, black, '', '', ''), ('button', white, black, '', '', ''),
('button focus', white, black, '', '', ''), ('button focus', white, black, '', '', ''),
('redbutton', white, black, '', '', ''),
('redbutton focus', white, black, '', '', ''),
('amberbutton', white, black, '', '', ''),
('amberbutton focus', white, black, '', '', ''),
('string_input', '', '', '', white, ''), ('string_input', '', '', '', white, ''),
('string_input focus', '', '', '', white, ''), ('string_input focus', '', '', '', white, ''),
('progress_incomplete', '', '', '', '', black), ('progress_incomplete', '', '', '', '', black),

View File

@ -49,7 +49,7 @@ class DiskPartitionView(BaseView):
buttons = [ buttons = [
Color.button(done), Color.button(done),
Color.button(cancel) Color.amberbutton(cancel)
] ]
return Pile(buttons) return Pile(buttons)

View File

@ -57,7 +57,7 @@ class FilesystemConfirmationView(WidgetWrap):
self.controller = controller self.controller = controller
pile = Pile([ pile = Pile([
UrwidPadding(Text(confirmation_text), left=2, right=2), UrwidPadding(Text(confirmation_text), left=2, right=2),
Padding.fixed_15(Color.button(cancel_btn(label="No", on_press=self.cancel))), Padding.fixed_15(Color.amberbutton(cancel_btn(label="No", on_press=self.cancel))),
Padding.fixed_15(Color.button(continue_btn(on_press=self.ok))), Padding.fixed_15(Color.button(continue_btn(on_press=self.ok))),
Text(""), Text(""),
]) ])
@ -148,8 +148,8 @@ class FilesystemView(BaseView):
buttons.append( buttons.append(
Color.button(done_btn(on_press=self.done))) Color.button(done_btn(on_press=self.done)))
buttons.append(Color.button(reset_btn(on_press=self.reset))) buttons.append(Color.amberbutton(reset_btn(on_press=self.reset)))
buttons.append(Color.button(cancel_btn(on_press=self.cancel))) buttons.append(Color.redbutton(cancel_btn(on_press=self.cancel)))
return Pile(buttons) return Pile(buttons)

View File

@ -21,6 +21,7 @@ from urwid import (
from subiquitycore.ui.utils import Padding, Color from subiquitycore.ui.utils import Padding, Color
from subiquitycore.ui.buttons import ( from subiquitycore.ui.buttons import (
cancel_btn,
menu_btn, menu_btn,
PlainButton, PlainButton,
) )
@ -61,8 +62,7 @@ class GuidedDiskSelectionView(BaseView):
def __init__(self, model, controller): def __init__(self, model, controller):
self.model = model self.model = model
self.controller = controller self.controller = controller
cancel = PlainButton(label="Cancel") cancel = Color.amberbutton(cancel_btn(on_press=self.cancel))
connect_signal(cancel, 'click', self.cancel)
disks = [] disks = []
for disk in self.model.all_disks(): for disk in self.model.all_disks():
if disk.available: if disk.available:

View File

@ -44,7 +44,7 @@ class InstallpathView(BaseView):
def _build_buttons(self): def _build_buttons(self):
self.buttons = [ self.buttons = [
Color.button(cancel_btn(on_press=self.cancel)), Color.amberbutton(cancel_btn(on_press=self.cancel)),
] ]
return Pile(self.buttons) return Pile(self.buttons)

View File

@ -65,7 +65,7 @@ class ProgressView(BaseView):
Color.button(confirm_btn(label="Reboot Now", on_press=self.reboot))) Color.button(confirm_btn(label="Reboot Now", on_press=self.reboot)))
z = Padding.fixed_20( z = Padding.fixed_20(
Color.button(confirm_btn(label="Quit Installer", on_press=self.quit))) Color.amberbutton(confirm_btn(label="Quit Installer", on_press=self.quit)))
new_focus = len(self.pile.contents) new_focus = len(self.pile.contents)
self.pile.contents.append((w, self.pile.options('pack'))) self.pile.contents.append((w, self.pile.options('pack')))

View File

@ -134,6 +134,10 @@ STYLE_NAMES = set([
'menu_button focus', 'menu_button focus',
'button', 'button',
'button focus', 'button focus',
'redbutton',
'redbutton focus',
'amberbutton',
'amberbutton focus',
'info_primary', 'info_primary',
'info_major', 'info_major',
'info_minor', 'info_minor',

View File

@ -132,7 +132,7 @@ class NetworkView(BaseView):
super().__init__(self.frame) super().__init__(self.frame)
def _build_buttons(self): def _build_buttons(self):
cancel = Color.button(cancel_btn(on_press=self.cancel)) cancel = Color.amberbutton(cancel_btn(on_press=self.cancel))
done = Color.button(done_btn(on_press=self.done)) done = Color.button(done_btn(on_press=self.done))
self.default_focus = done self.default_focus = done