Skip to content

Commit

Permalink
MacOS light and dark themes. Rework simplified theme
Browse files Browse the repository at this point in the history
  • Loading branch information
Exidex committed Jan 4, 2025
1 parent 2e06270 commit 34a5c5e
Show file tree
Hide file tree
Showing 5 changed files with 344 additions and 206 deletions.
33 changes: 10 additions & 23 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 20 additions & 1 deletion rust/client/src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,16 +233,35 @@ impl TryInto<iced_layershell::actions::LayershellCustomActionsWithId> for AppMsg
const WINDOW_WIDTH: f32 = 750.0;
const WINDOW_HEIGHT: f32 = 450.0;

#[cfg(not(target_os = "macos"))]
fn window_settings() -> window::Settings {
window::Settings {
size: Size::new(WINDOW_WIDTH, WINDOW_HEIGHT),
position: Position::Centered,
resizable: false,
decorations: false,
transparent: true,
#[cfg(target_os = "macos")]
closeable: false,
minimizable: false,
..Default::default()
}
}

#[cfg(target_os = "macos")]
fn window_settings() -> window::Settings {
window::Settings {
size: Size::new(WINDOW_WIDTH, WINDOW_HEIGHT),
position: Position::Centered,
resizable: false,
decorations: true,
transparent: false,
closeable: false,
minimizable: false,
platform_specific: window::settings::PlatformSpecific {
window_kind: window::settings::WindowKind::Popup,
fullsize_content_view: true,
title_hidden: true,
titlebar_transparent: true,
..Default::default()
},
..Default::default()
Expand Down
12 changes: 8 additions & 4 deletions rust/client/src/ui/theme/container.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use iced::{Border, Color, Length, Renderer};
use iced::{Border, Color, Length, Renderer, Shadow, Vector};
use iced::widget::{Container, container};
use iced::widget::container::Style;
use crate::ui::theme::{Element, GauntletComplexTheme, get_theme, ThemableWidget};
Expand Down Expand Up @@ -88,7 +88,7 @@ impl container::Catalog for GauntletComplexTheme {
match class {
ContainerStyleInner::Transparent => Default::default(),
ContainerStyleInner::ActionPanel => {
let root_theme = &self.root;
let root_theme = &self.popup;
let panel_theme = &self.action_panel;
let background_color = &panel_theme.background_color;

Expand All @@ -100,7 +100,11 @@ impl container::Catalog for GauntletComplexTheme {
width: root_theme.border_width,
color: root_theme.border_color.to_iced(),
},
shadow: Default::default(),
shadow: Shadow {
color: Color::from_rgba8(0, 0, 0, 0.50),
offset: Vector::new(0.0, 5.0),
blur_radius: 25.0,
},
}
}
ContainerStyleInner::ActionShortcutModifier => {
Expand Down Expand Up @@ -167,7 +171,7 @@ impl container::Catalog for GauntletComplexTheme {
}
}
ContainerStyleInner::Tooltip => {
let theme = &self.root;
let theme = &self.popup;
let tooltip_theme = &self.tooltip;
let background_color = &tooltip_theme.background_color;

Expand Down
2 changes: 1 addition & 1 deletion rust/client/src/ui/theme/date_picker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ impl Catalog for GauntletComplexTheme {


fn active(theme: &GauntletComplexTheme) -> Style {
let root_theme = &theme.root;
let root_theme = &theme.popup;
let theme = &theme.form_input_date_picker;

Style {
Expand Down
Loading

0 comments on commit 34a5c5e

Please sign in to comment.