From 6cca5476abfd62f3579a2a8ae681c9695079e174 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Wed, 1 May 2024 12:14:46 -0700 Subject: [PATCH] User hover style for drop target --- src/main.rs | 2 +- src/view/mod.rs | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index b618c84..193f67f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -669,7 +669,7 @@ impl Application for App { if let Some(workspace) = self.workspaces.iter().find(|x| &x.handle == handle) { - let item = view::workspace_item(workspace, output); + let item = view::workspace_item(workspace, output, false); return widget::container(item) .height(iced::Length::Fixed(size.height)) .width(iced::Length::Fixed(size.width)) diff --git a/src/view/mod.rs b/src/view/mod.rs index a3f4d3f..6284f75 100644 --- a/src/view/mod.rs +++ b/src/view/mod.rs @@ -115,6 +115,7 @@ fn workspace_item_appearance( pub(crate) fn workspace_item<'a>( workspace: &'a Workspace, output: &wl_output::WlOutput, + is_drop_target: bool, ) -> cosmic::Element<'a, Msg> { let image = capture_image(workspace.img_for_output.get(output)); let is_active = workspace.is_active; @@ -124,7 +125,7 @@ pub(crate) fn workspace_item<'a>( .selected(workspace.is_active) .style(cosmic::theme::Button::Custom { active: Box::new(move |_focused, theme| workspace_item_appearance( - theme, is_active, false + theme, is_active, is_drop_target )), disabled: Box::new(|_theme| { unreachable!() }), hovered: Box::new(move |_focused, theme| workspace_item_appearance( @@ -144,7 +145,7 @@ pub(crate) fn workspace_item<'a>( fn workspace_sidebar_entry<'a>( workspace: &'a Workspace, output: &'a wl_output::WlOutput, - _is_drop_target: bool, + is_drop_target: bool, ) -> cosmic::Element<'a, Msg> { /* XXX let mouse_interaction = if is_drop_target { @@ -170,7 +171,7 @@ fn workspace_sidebar_entry<'a>( */ //crate::widgets::mouse_interaction_wrapper( // mouse_interaction, - iced::widget::dnd_listener(workspace_item(workspace, output)) + iced::widget::dnd_listener(workspace_item(workspace, output, is_drop_target)) .on_enter(|actions, mime, pos| { Msg::DndWorkspaceEnter(workspace.handle.clone(), output.clone(), actions, mime, pos) })