1
0
Fork 0
forked from wry/wry

control-center: add window pane

This commit is contained in:
Julian Orth 2026-03-05 18:59:43 +01:00
parent aefd1fbbdb
commit ca6fc54246
9 changed files with 611 additions and 11 deletions

View file

@ -9,6 +9,7 @@ use {
cc_input::InputPane,
cc_look_and_feel::LookAndFeelPane,
cc_outputs::OutputsPane,
cc_window::{WindowPane, WindowSearchPane},
cc_xwayland::XwaylandPane,
},
egui_adapter::egui_platform::{
@ -18,8 +19,8 @@ use {
macros::Bitflag,
state::State,
utils::{
asyncevent::AsyncEvent, copyhashmap::CopyHashMap, numcell::NumCell,
static_text::StaticText,
asyncevent::AsyncEvent, copyhashmap::CopyHashMap,
event_listener::LazyEventSourceListener, numcell::NumCell, static_text::StaticText,
},
},
egui::{
@ -50,6 +51,7 @@ mod cc_input;
mod cc_look_and_feel;
mod cc_outputs;
mod cc_sidebar;
mod cc_window;
mod cc_xwayland;
#[derive(Debug, Error)]
@ -141,6 +143,8 @@ enum PaneType {
LookAndFeel(LookAndFeelPane),
Clients(ClientsPane),
Client(ClientPane),
WindowSearch(WindowSearchPane),
Window(WindowPane),
}
struct CcBehavior<'a> {
@ -168,6 +172,8 @@ impl Pane {
PaneType::LookAndFeel(v) => v.title(res),
PaneType::Clients(v) => v.title(res),
PaneType::Client(v) => v.title(res),
PaneType::WindowSearch(v) => v.title(res),
PaneType::Window(v) => v.title(res),
}
}
@ -183,6 +189,8 @@ impl Pane {
PaneType::LookAndFeel(p) => p.show(ui),
PaneType::Clients(p) => p.show(behavior, ui),
PaneType::Client(p) => p.show(behavior, ui),
PaneType::WindowSearch(p) => p.show(behavior, ui),
PaneType::Window(p) => p.show(behavior, ui),
}
}
}
@ -200,6 +208,8 @@ impl PaneType {
PaneType::LookAndFeel(_) => CCI_LOOK_AND_FEEL,
PaneType::Clients(_) => ControlCenterInterest::none(),
PaneType::Client(_) => ControlCenterInterest::none(),
PaneType::WindowSearch(_) => ControlCenterInterest::none(),
PaneType::Window(_) => ControlCenterInterest::none(),
}
}
}
@ -663,3 +673,9 @@ impl Drop for GridRow<'_> {
self.end_row();
}
}
impl LazyEventSourceListener for ControlCenterInner {
fn triggered(self: Rc<Self>) {
self.window.request_redraw();
}
}