mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-22 02:01:55 +07:00
Add center-window by-id action
This commit is contained in:
+11
-1
@@ -971,12 +971,22 @@ impl<W: LayoutElement> Workspace<W> {
|
||||
|
||||
pub fn center_column(&mut self) {
|
||||
if self.floating_is_active.get() {
|
||||
self.floating.center_window();
|
||||
self.floating.center_window(None);
|
||||
} else {
|
||||
self.scrolling.center_column();
|
||||
}
|
||||
}
|
||||
|
||||
pub fn center_window(&mut self, id: Option<&W::Id>) {
|
||||
if id.map_or(self.floating_is_active.get(), |id| {
|
||||
self.floating.has_window(id)
|
||||
}) {
|
||||
self.floating.center_window(id);
|
||||
} else {
|
||||
self.scrolling.center_window(id);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn toggle_width(&mut self) {
|
||||
if self.floating_is_active.get() {
|
||||
self.floating.toggle_window_width(None);
|
||||
|
||||
Reference in New Issue
Block a user