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:
parent
ff9c5fb293
commit
7c5e55e0b2
|
@ -43,6 +43,10 @@ STYLES = [
|
|||
('menu_button focus', black, light_gray, '', black, light_gray),
|
||||
('button', white, '', '', white, ''),
|
||||
('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_major', light_gray, '', '', light_gray, ''),
|
||||
('info_minor', dark_gray, '', '', dark_gray, ''),
|
||||
|
@ -50,7 +54,7 @@ STYLES = [
|
|||
('string_input', black, light_gray, '', black, light_gray),
|
||||
('string_input focus', white, dark_gray, '', white, dark_gray),
|
||||
('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 = [
|
||||
|
@ -62,6 +66,10 @@ STYLES_MONO = [
|
|||
('menu_button focus', '', '', '', white, ''),
|
||||
('button', 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 focus', '', '', '', white, ''),
|
||||
('progress_incomplete', '', '', '', '', black),
|
||||
|
|
|
@ -49,7 +49,7 @@ class DiskPartitionView(BaseView):
|
|||
|
||||
buttons = [
|
||||
Color.button(done),
|
||||
Color.button(cancel)
|
||||
Color.amberbutton(cancel)
|
||||
]
|
||||
return Pile(buttons)
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ class FilesystemConfirmationView(WidgetWrap):
|
|||
self.controller = controller
|
||||
pile = Pile([
|
||||
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))),
|
||||
Text(""),
|
||||
])
|
||||
|
@ -148,8 +148,8 @@ class FilesystemView(BaseView):
|
|||
buttons.append(
|
||||
Color.button(done_btn(on_press=self.done)))
|
||||
|
||||
buttons.append(Color.button(reset_btn(on_press=self.reset)))
|
||||
buttons.append(Color.button(cancel_btn(on_press=self.cancel)))
|
||||
buttons.append(Color.amberbutton(reset_btn(on_press=self.reset)))
|
||||
buttons.append(Color.redbutton(cancel_btn(on_press=self.cancel)))
|
||||
|
||||
return Pile(buttons)
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ from urwid import (
|
|||
from subiquitycore.ui.utils import Padding, Color
|
||||
|
||||
from subiquitycore.ui.buttons import (
|
||||
cancel_btn,
|
||||
menu_btn,
|
||||
PlainButton,
|
||||
)
|
||||
|
@ -61,8 +62,7 @@ class GuidedDiskSelectionView(BaseView):
|
|||
def __init__(self, model, controller):
|
||||
self.model = model
|
||||
self.controller = controller
|
||||
cancel = PlainButton(label="Cancel")
|
||||
connect_signal(cancel, 'click', self.cancel)
|
||||
cancel = Color.amberbutton(cancel_btn(on_press=self.cancel))
|
||||
disks = []
|
||||
for disk in self.model.all_disks():
|
||||
if disk.available:
|
||||
|
|
|
@ -44,7 +44,7 @@ class InstallpathView(BaseView):
|
|||
|
||||
def _build_buttons(self):
|
||||
self.buttons = [
|
||||
Color.button(cancel_btn(on_press=self.cancel)),
|
||||
Color.amberbutton(cancel_btn(on_press=self.cancel)),
|
||||
]
|
||||
return Pile(self.buttons)
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ class ProgressView(BaseView):
|
|||
Color.button(confirm_btn(label="Reboot Now", on_press=self.reboot)))
|
||||
|
||||
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)
|
||||
self.pile.contents.append((w, self.pile.options('pack')))
|
||||
|
|
|
@ -134,6 +134,10 @@ STYLE_NAMES = set([
|
|||
'menu_button focus',
|
||||
'button',
|
||||
'button focus',
|
||||
'redbutton',
|
||||
'redbutton focus',
|
||||
'amberbutton',
|
||||
'amberbutton focus',
|
||||
'info_primary',
|
||||
'info_major',
|
||||
'info_minor',
|
||||
|
|
|
@ -132,7 +132,7 @@ class NetworkView(BaseView):
|
|||
super().__init__(self.frame)
|
||||
|
||||
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))
|
||||
self.default_focus = done
|
||||
|
||||
|
|
Loading…
Reference in New Issue