Skip to content

Commit

Permalink
Set a per-terminal ColorTheme and ColorSet
Browse files Browse the repository at this point in the history
  • Loading branch information
japhb committed Mar 1, 2024
1 parent 7e70fc7 commit 26704a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 1 addition & 2 deletions lib/Terminal/Widgets/Input.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

use Terminal::Widgets::Utils::Color;
use Terminal::Widgets::ColorTheme;
use Terminal::Widgets::ColorThemes;
use Terminal::Widgets::Events;
use Terminal::Widgets::Widget;
use Terminal::Widgets::Form;
Expand All @@ -18,7 +17,7 @@ role Terminal::Widgets::Input
has $.error;
has %.color;

has Terminal::Widgets::ColorSet:D $.colorset = $DEFAULT-THEME.variants<attr8tango>;
has Terminal::Widgets::ColorSet:D $.colorset = self.terminal.colorset;
has Terminal::Widgets::Form $.form;


Expand Down
4 changes: 4 additions & 0 deletions lib/Terminal/Widgets/Terminal.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ use Terminal::LineEditor::RawTerminalInput;
use Terminal::Widgets::Events;
use Terminal::Widgets::TopLevel;
use Terminal::Widgets::I18N::Locale;
use Terminal::Widgets::ColorTheme;
use Terminal::Widgets::ColorThemes;


#| A container for the unique ANSI terminal event pump for a given terminal
Expand All @@ -16,6 +18,8 @@ class Terminal::Widgets::Terminal
has Terminal::Widgets::TopLevel $.current-toplevel;
has Terminal::Capabilities:D $.caps .= new;
has Terminal::Widgets::I18N::Locale:D $.locale .= new;
has Terminal::Widgets::ColorTheme:D $.color-theme = $DEFAULT-THEME;
has Terminal::Widgets::ColorSet:D $.colorset = $!color-theme.variants<attr8tango>;
has %.ui-prefs;

has Promise:D $.has-initialized .= new;
Expand Down

0 comments on commit 26704a5

Please sign in to comment.