Add a disabled-by-default toggle for using bright colors for bold text

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
This commit is contained in:
Mohammad AlSaleh 2024-01-11 17:47:24 +03:00 • committed by Jeremy Soller
parent fc6e2de78b
commit b161db94d1
4 changed files with 32 additions and 8 deletions

View file

@ -147,6 +147,7 @@ pub enum Message {
Paste(Option<segmented_button::Entity>),
PasteValue(Option<segmented_button::Entity>, String),
SelectAll(Option<segmented_button::Entity>),
UseBrightBold(bool),
ShowHeaderBar(bool),
SyntaxTheme(usize, bool),
SystemThemeModeChange(cosmic_theme::ThemeMode),
@ -426,6 +427,10 @@ impl App {
}
let settings_view = settings_view
.add(
widget::settings::item::builder(fl!("use-bright-bold"))
.toggler(self.config.use_bright_bold, Message::UseBrightBold),
)
.add(
widget::settings::item::builder(fl!("default-font-size")).control(
widget::dropdown(&self.font_size_names, font_size_selected, |index| {
@ -734,6 +739,12 @@ impl Application for App {
return self.save_config();
}
}
Message::UseBrightBold(use_bright_bold) => {
if use_bright_bold != self.config.use_bright_bold {
self.config.use_bright_bold = use_bright_bold;
return self.save_config();
}
}
Message::SystemThemeModeChange(_theme_mode) => {
return self.update_config();
}
@ -814,9 +825,7 @@ impl Application for App {
entity,
term_event_tx.clone(),
self.term_config.clone(),
self.config.typed_font_stretch(),
self.config.font_weight,
self.config.bold_font_weight,
&self.config,
colors.clone(),
);
terminal.set_config(&self.config, &self.themes, self.zoom_adj);