From 6a5605eb0a6093f100c7880bf7e9ee5122940d8c Mon Sep 17 00:00:00 2001 From: Cornelius Andreas Rosenaa Date: Wed, 3 Jul 2024 18:43:39 +0200 Subject: [PATCH] Fix terminal styling for create subsystem --- apx_gui/windows/create_subsystem.py | 11 +++++++++-- apx_gui/windows/main_window.py | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/apx_gui/windows/create_subsystem.py b/apx_gui/windows/create_subsystem.py index 16d9b62..4dd528d 100644 --- a/apx_gui/windows/create_subsystem.py +++ b/apx_gui/windows/create_subsystem.py @@ -83,6 +83,9 @@ def __build_ui(self) -> None: self.__terminal.set_input_enabled(False) def __on_setup_terminal_colors(self, *args): + + is_dark: bool = self.__style_manager.get_dark() + palette = [ "#363636", "#c01c28", @@ -113,8 +116,12 @@ def __on_setup_terminal_colors(self, *args): self.colors = [Gdk.RGBA() for c in palette] [color.parse(s) for (color, s) in zip(self.colors, palette)] - self.fg.parse(FOREGROUND) - self.bg.parse(BACKGROUND) + if is_dark: + self.fg.parse(FOREGROUND_DARK) + self.bg.parse(BACKGROUND_DARK) + else: + self.fg.parse(FOREGROUND) + self.bg.parse(BACKGROUND) self.__terminal.set_colors(self.fg, self.bg, self.colors) diff --git a/apx_gui/windows/main_window.py b/apx_gui/windows/main_window.py index b205d8b..bb8f868 100644 --- a/apx_gui/windows/main_window.py +++ b/apx_gui/windows/main_window.py @@ -41,6 +41,7 @@ class ApxGUIWindow(Adw.ApplicationWindow): content: Adw.Bin = Gtk.Template.Child() # pyright: ignore tab_bar: Adw.TabBar = Gtk.Template.Child() # pyright: ignore title: Adw.WindowTitle = Gtk.Template.Child() # pyright: ignore + style_manager = Adw.StyleManager().get_default() # pyright: ignore def __init__(self, **kwargs) -> None: super().__init__(**kwargs)