Skip to content

Commit

Permalink
slightly lighter border on light mode, and smaller radius
Browse files Browse the repository at this point in the history
  • Loading branch information
liias committed Sep 21, 2024
1 parent 0183bcb commit 7b997ba
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/gui/main_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ impl MainWindow {

return Container::new(col)
.background(MainWindowTheme::ENV_WINDOW_BACKGROUND_COLOR)
.rounded(10.0)
.border(MainWindowTheme::ENV_WINDOW_BORDER_COLOR, 0.5)
.rounded(7.0)
.border(MainWindowTheme::ENV_WINDOW_BORDER_COLOR, 0.3)
.expand_height()
.env_scope(|env, data| {
ui_theme::initialize_theme(env, data);
Expand Down Expand Up @@ -332,7 +332,7 @@ fn create_browser_label() -> Label<((bool, UISettings), UIBrowser)> {
name
},
)
.with_text_size(12.0)
.with_text_size(MainWindowTheme::ENV_BROWSER_LABEL_SIZE)
.with_line_break_mode(LineBreaking::Clip)
.with_text_alignment(TextAlignment::Start)
.with_text_color(MainWindowTheme::ENV_BROWSER_LABEL_COLOR);
Expand Down Expand Up @@ -376,7 +376,7 @@ fn create_browser(
Label::dynamic(|(_, item): &((bool, UISettings), UIBrowser), _env: &_| {
item.profile_name.clone()
})
.with_text_size(11.0)
.with_text_size(MainWindowTheme::ENV_PROFILE_LABEL_SIZE)
.with_line_break_mode(LineBreaking::Clip)
.with_text_alignment(TextAlignment::Start)
.with_text_color(MainWindowTheme::ENV_PROFILE_LABEL_COLOR);
Expand Down
30 changes: 22 additions & 8 deletions src/gui/ui_theme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@ fn get_theme(ui_theme: UITheme) -> Theme {
main: MainWindowTheme {
window_background_color: Color::rgba(0.15, 0.15, 0.15, 0.9),
window_border_color: Color::rgba(0.5, 0.5, 0.5, 0.9),
profile_label_color: Color::rgb8(190, 190, 190),
browser_label_size: 12.0,
browser_label_color: Color::rgb8(255, 255, 255),
profile_label_size: 11.0,
profile_label_color: Color::rgb8(190, 190, 190),
hotkey_background_color: Color::rgba(0.15, 0.15, 0.15, 1.0),
hotkey_border_color: Color::rgba(0.4, 0.4, 0.4, 0.9),
hotkey_text_color: Color::rgb8(128, 128, 128),
Expand Down Expand Up @@ -122,13 +124,15 @@ fn get_theme(ui_theme: UITheme) -> Theme {
},
general: GeneralTheme {
window_background_color: Color::rgba(0.85, 0.85, 0.85, 0.9),
window_border_color: Color::rgba(0.5, 0.5, 0.5, 0.9),
window_border_color: Color::rgba(0.7, 0.7, 0.7, 0.9),
},
main: MainWindowTheme {
window_background_color: Color::rgba8(215, 215, 215, 230),
window_border_color: Color::rgba(0.5, 0.5, 0.5, 0.9),
profile_label_color: Color::rgb8(30, 30, 30),
window_border_color: Color::rgba(0.7, 0.7, 0.7, 0.9),
browser_label_size: 12.0,
browser_label_color: Color::rgb8(0, 0, 0),
profile_label_size: 11.0,
profile_label_color: Color::rgb8(30, 30, 30),
hotkey_background_color: Color::rgb8(215, 215, 215),
hotkey_border_color: Color::rgba(0.4, 0.4, 0.4, 0.9),
hotkey_text_color: Color::rgb8(128, 128, 128),
Expand Down Expand Up @@ -192,8 +196,10 @@ impl GeneralTheme {
pub(crate) struct MainWindowTheme {
window_background_color: Color,
window_border_color: Color,
profile_label_color: Color,
browser_label_size: f64,
browser_label_color: Color,
profile_label_size: f64,
profile_label_color: Color,
hotkey_background_color: Color,
hotkey_border_color: Color,
hotkey_text_color: Color,
Expand All @@ -207,12 +213,18 @@ impl MainWindowTheme {
pub const ENV_WINDOW_BORDER_COLOR: Key<Color> =
Key::new("software.browsers.theme.main.window_border_color");

pub const ENV_PROFILE_LABEL_COLOR: Key<Color> =
Key::new("software.browsers.theme.main.profile_label_color");
pub const ENV_BROWSER_LABEL_SIZE: Key<f64> =
Key::new("software.browsers.theme.main.browser_label_size");

pub const ENV_BROWSER_LABEL_COLOR: Key<Color> =
Key::new("software.browsers.theme.main.browser_label_color");

pub const ENV_PROFILE_LABEL_SIZE: Key<f64> =
Key::new("software.browsers.theme.main.profile_label_size");

pub const ENV_PROFILE_LABEL_COLOR: Key<Color> =
Key::new("software.browsers.theme.main.profile_label_color");

pub const ENV_HOTKEY_BACKGROUND_COLOR: Key<Color> =
Key::new("software.browsers.theme.main.hotkey_background_color");

Expand All @@ -228,8 +240,10 @@ impl MainWindowTheme {
fn set_env_to_theme(&self, env: &mut Env) {
env.set(Self::ENV_WINDOW_BACKGROUND_COLOR, self.window_background_color);
env.set(Self::ENV_WINDOW_BORDER_COLOR, self.window_border_color);
env.set(Self::ENV_PROFILE_LABEL_COLOR, self.profile_label_color);
env.set(Self::ENV_BROWSER_LABEL_SIZE, self.browser_label_size);
env.set(Self::ENV_BROWSER_LABEL_COLOR, self.browser_label_color);
env.set(Self::ENV_PROFILE_LABEL_SIZE, self.profile_label_size);
env.set(Self::ENV_PROFILE_LABEL_COLOR, self.profile_label_color);
env.set(Self::ENV_HOTKEY_BACKGROUND_COLOR, self.hotkey_background_color);
env.set(Self::ENV_HOTKEY_BORDER_COLOR, self.hotkey_border_color);
env.set(Self::ENV_HOTKEY_TEXT_COLOR, self.hotkey_text_color);
Expand Down

0 comments on commit 7b997ba

Please sign in to comment.