From c685440155063dae2d09ebc70e2a41f88180b2c2 Mon Sep 17 00:00:00 2001 From: Victoria Brekenfeld Date: Mon, 11 Mar 2024 17:07:39 +0100 Subject: [PATCH] theme: Revert theming of tiling overview (fix #347) --- src/backend/render/mod.rs | 2 ++ src/shell/layout/tiling/mod.rs | 20 ++++++++++---------- src/theme.rs | 2 +- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/backend/render/mod.rs b/src/backend/render/mod.rs index b3b0a829..6090d9b8 100644 --- a/src/backend/render/mod.rs +++ b/src/backend/render/mod.rs @@ -96,6 +96,8 @@ pub type GlMultiError = MultiError< pub static CLEAR_COLOR: [f32; 4] = [0.153, 0.161, 0.165, 1.0]; pub static OUTLINE_SHADER: &str = include_str!("./shaders/rounded_outline.frag"); pub static RECTANGLE_SHADER: &str = include_str!("./shaders/rounded_rectangle.frag"); +pub static GROUP_COLOR: [f32; 3] = [0.788, 0.788, 0.788]; +pub static ACTIVE_GROUP_COLOR: [f32; 3] = [0.58, 0.922, 0.922]; pub struct IndicatorShader(pub GlesPixelProgram); diff --git a/src/shell/layout/tiling/mod.rs b/src/shell/layout/tiling/mod.rs index 012f41b5..022c937e 100644 --- a/src/shell/layout/tiling/mod.rs +++ b/src/shell/layout/tiling/mod.rs @@ -1,7 +1,10 @@ // SPDX-License-Identifier: GPL-3.0-only use crate::{ - backend::render::{element::AsGlowRenderer, BackdropShader, IndicatorShader, Key, Usage}, + backend::render::{ + element::AsGlowRenderer, BackdropShader, IndicatorShader, Key, Usage, ACTIVE_GROUP_COLOR, + GROUP_COLOR, + }, shell::{ element::{ resize_indicator::ResizeIndicator, @@ -22,7 +25,6 @@ use crate::{ CosmicSurface, Direction, FocusResult, MoveResult, OutputNotMapped, OverviewMode, ResizeDirection, ResizeMode, Trigger, }, - theme::group_color, utils::{prelude::*, tween::EaseRectangle}, wayland::{ handlers::xdg_shell::popup::get_popup_toplevel, @@ -4017,7 +4019,7 @@ fn geometries_for_groupview<'a, R>( mouse_tiling: Option>, swap_desc: Option, swap_tree: Option<&Tree>, - theme: &cosmic::theme::CosmicTheme, + _theme: &cosmic::theme::CosmicTheme, ) -> ( HashMap>, Vec>, @@ -4175,7 +4177,7 @@ where ) }; - let group_color = group_color(theme); + let group_color = GROUP_COLOR; match data { Data::Group { @@ -4547,7 +4549,7 @@ where geo.size -= (gap * 2, gap * 2).into(); } - let accent = theme.accent.base; + let accent = ACTIVE_GROUP_COLOR; if focused .as_ref() @@ -4563,7 +4565,7 @@ where Some(Some(TargetZone::WindowStack(stack_id, _))) if *stack_id == node_id => { - [accent.red, accent.green, accent.blue] + accent } _ => group_color, }; @@ -4580,9 +4582,7 @@ where * if focused .as_ref() .map(|focused_id| focused_id == &node_id) - .unwrap_or( - color == [accent.red, accent.green, accent.blue], - ) + .unwrap_or(color == accent) { 0.4 } else { @@ -4881,7 +4881,7 @@ where let swap_tree = swap_tree.flatten().filter(|_| is_active_output); let swap_desc = swap_desc.filter(|_| is_active_output); let window_hint = crate::theme::active_window_hint(theme); - let group_color = group_color(theme); + let group_color = GROUP_COLOR; // render placeholder, if we are swapping to an empty workspace if target_tree.root_node_id().is_none() && swap_desc.is_some() { window_elements.push( diff --git a/src/theme.rs b/src/theme.rs index 4c66fa83..89c4e3b4 100644 --- a/src/theme.rs +++ b/src/theme.rs @@ -7,7 +7,7 @@ use cosmic::cosmic_theme::{palette, Theme, ThemeMode}; use crate::state::State; -pub(crate) fn group_color(theme: &Theme) -> [f32; 3] { +pub(crate) fn _group_color(theme: &Theme) -> [f32; 3] { let neutral_8 = theme.palette.neutral_8; [neutral_8.red, neutral_8.green, neutral_8.blue] }