Skip to content

Commit

Permalink
#542 Don't modify background colors on Linux
Browse files Browse the repository at this point in the history
because makes issues with dark themes ... we don't use dark mode
detection on Linux
  • Loading branch information
helgoboss committed Mar 25, 2022
1 parent b69d536 commit bad298e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
13 changes: 10 additions & 3 deletions main/src/infrastructure/ui/util.rs
Expand Up @@ -147,10 +147,17 @@ pub mod view {

/// Use with care! Should be freed after use.
fn create_mapping_row_background_brush() -> Option<isize> {
if Window::dark_mode_is_enabled() {
#[cfg(any(target_os = "macos", target_os = "windows"))]
{
if Window::dark_mode_is_enabled() {
None
} else {
Some(create_brush(SHADED_WHITE))
}
}
#[cfg(target_os = "linux")]
{
None
} else {
Some(create_brush(SHADED_WHITE))
}
}

Expand Down
5 changes: 1 addition & 4 deletions swell-ui/src/window.rs
Expand Up @@ -27,6 +27,7 @@ impl Window {
Point::new(Pixels(point.x as _), Pixels(point.y as _))
}

#[cfg(any(target_os = "macos", target_os = "windows"))]
pub fn dark_mode_is_enabled() -> bool {
#[cfg(target_os = "macos")]
{
Expand All @@ -48,10 +49,6 @@ impl Window {
let luma = rgb.into_luma();
luma.luma < 0.5
}
#[cfg(target_os = "linux")]
{
false
}
}

pub fn from_non_null(hwnd: NonNull<raw::HWND__>) -> Window {
Expand Down

0 comments on commit bad298e

Please sign in to comment.