From a70d309f6ab51b3e868aa4167c99259f4b17a199 Mon Sep 17 00:00:00 2001 From: Dimitri John Ledkov Date: Thu, 9 Apr 2020 12:00:03 +0100 Subject: [PATCH] Use common palette. Fixes header frindge colors in console-conf. --- console_conf/core.py | 4 +- console_conf/palette.py | 81 ------------------------- po/POTFILES.in | 3 +- subiquity/core.py | 2 +- {subiquity => subiquitycore}/palette.py | 0 5 files changed, 4 insertions(+), 86 deletions(-) delete mode 100644 console_conf/palette.py rename {subiquity => subiquitycore}/palette.py (100%) diff --git a/console_conf/core.py b/console_conf/core.py index 094ac40c..9540ef5f 100644 --- a/console_conf/core.py +++ b/console_conf/core.py @@ -25,7 +25,7 @@ log = logging.getLogger("console_conf.core") class ConsoleConf(Application): - from console_conf.palette import COLORS, STYLES, STYLES_MONO + from subiquitycore.palette import COLORS, STYLES, STYLES_MONO project = "console_conf" @@ -40,7 +40,7 @@ class ConsoleConf(Application): class RecoveryChooser(Application): - from console_conf.palette import COLORS, STYLES, STYLES_MONO + from subiquitycore.palette import COLORS, STYLES, STYLES_MONO project = "console_conf" diff --git a/console_conf/palette.py b/console_conf/palette.py deleted file mode 100644 index 861ba440..00000000 --- a/console_conf/palette.py +++ /dev/null @@ -1,81 +0,0 @@ -# Copyright 2015 Canonical, Ltd. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . - -""" Palette definitions """ - -COLORS = [ - ("bg", (0x11, 0x11, 0x11)), - ("orange", (0xe9, 0x54, 0x20)), - ("danger", (0xff, 0x00, 0x00)), - ("good", (0x0e, 0x84, 0x20)), - ("neutral", (0x00, 0x7a, 0xa6)), - ("gray", (0x66, 0x66, 0x66)), - ("brand", (0x33, 0x33, 0x33)), - ("fg", (0xff, 0xff, 0xff)), -] - -STYLES = [ - ('frame_header', 'fg', 'orange'), - ('body', 'fg', 'bg'), - - ('done_button', 'fg', 'bg'), - ('danger_button', 'fg', 'bg'), - ('other_button', 'fg', 'bg'), - ('done_button focus', 'fg', 'good'), - ('danger_button focus', 'fg', 'danger'), - ('other_button focus', 'fg', 'gray'), - - ('menu_button', 'fg', 'bg'), - ('menu_button focus', 'fg', 'gray'), - - ('info_primary', 'fg', 'bg'), - ('info_minor', 'gray', 'bg'), - ('info_error', 'danger', 'bg'), - - ('string_input', 'bg', 'fg'), - ('string_input focus', 'fg', 'gray'), - - ('progress_incomplete', 'fg', 'gray'), - ('progress_complete', 'fg', 'neutral'), - ('scrollbar', 'brand', 'bg'), - ('scrollbar focus', 'gray', 'bg'), -] - -STYLES_MONO = [ - ('frame_header', 'white', 'black'), - ('body', 'white', 'black'), - - ('done_button', 'white', 'black'), - ('danger_button', 'white', 'black'), - ('other_button', 'white', 'black'), - ('done_button focus', 'black', 'white'), - ('danger_button focus', 'black', 'white'), - ('other_button focus', 'black', 'white'), - - ('menu_button', 'white', 'black'), - ('menu_button focus', 'black', 'white'), - - ('info_primary', 'white', 'black'), - ('info_minor', 'white', 'black'), - ('info_error', 'white', 'black'), - - ('string_input', 'white', 'black'), - ('string_input focus', 'black', 'white'), - - ('progress_incomplete', 'white', 'black'), - ('progress_complete', 'black', 'white'), - ('scrollbar_fg', 'white', 'black'), - ('scrollbar_bg', 'white', 'black'), -] diff --git a/po/POTFILES.in b/po/POTFILES.in index 07ceca1b..9cbb93a5 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -16,6 +16,7 @@ subiquitycore/testing/view_helpers.py subiquitycore/testing/__init__.py subiquitycore/netplan.py subiquitycore/core.py +subiquitycore/palette.py subiquitycore/ssh.py subiquitycore/__init__.py subiquitycore/lsb_release.py @@ -73,7 +74,6 @@ subiquity/cmd/__init__.py subiquity/cmd/tui.py subiquity/cmd/schema.py subiquity/snapd.py -subiquity/palette.py subiquity/models/identity.py subiquity/models/locale.py subiquity/models/mirror.py @@ -145,7 +145,6 @@ console_conf/controllers/chooser.py console_conf/cmd/__init__.py console_conf/cmd/tui.py console_conf/cmd/write_login_details.py -console_conf/palette.py console_conf/models/identity.py console_conf/models/systems.py console_conf/models/console_conf.py diff --git a/subiquity/core.py b/subiquity/core.py index ac0d38f4..88871ee1 100644 --- a/subiquity/core.py +++ b/subiquity/core.py @@ -83,7 +83,7 @@ class Subiquity(Application): 'additionalProperties': True, } - from subiquity.palette import COLORS, STYLES, STYLES_MONO + from subiquitycore.palette import COLORS, STYLES, STYLES_MONO project = "subiquity" diff --git a/subiquity/palette.py b/subiquitycore/palette.py similarity index 100% rename from subiquity/palette.py rename to subiquitycore/palette.py