diff options
| author | Linnea Gräf <nea@nea.moe> | 2025-11-27 21:43:04 +0100 |
|---|---|---|
| committer | Linnea Gräf <nea@nea.moe> | 2025-12-01 21:42:28 +0100 |
| commit | 7471cd5ddd794d904dd66562ca1446d42c7fc6a5 (patch) | |
| tree | e307d49a53e4054f2e4b1a7003482943785c6f8a /src | |
| parent | e863f52feaaef9c4149211045013b1f515ac5a8e (diff) | |
| download | niri-feat/screenshotselectall.tar.gz niri-feat/screenshotselectall.tar.bz2 niri-feat/screenshotselectall.zip | |
screenshot_ui: add ctrl+a command to select entire outputfeat/screenshotselectall
Diffstat (limited to 'src')
| -rw-r--r-- | src/input/mod.rs | 7 | ||||
| -rw-r--r-- | src/ui/screenshot_ui.rs | 19 |
2 files changed, 25 insertions, 1 deletions
diff --git a/src/input/mod.rs b/src/input/mod.rs index 81e5d863..f53855af 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -1636,7 +1636,11 @@ impl State { self.niri.queue_redraw_all(); } Action::MaximizeColumn => { - self.niri.layout.toggle_full_width(); + if self.niri.screenshot_ui.is_open() { + self.niri.screenshot_ui.select_entire_output(); + } else { + self.niri.layout.toggle_full_width(); + } } Action::MaximizeWindowToEdges => { let focus = self.niri.layout.focus().map(|m| m.window.clone()); @@ -4570,6 +4574,7 @@ fn allowed_during_screenshot(action: &Action) -> bool { | Action::SetWindowWidth(_) | Action::SetWindowHeight(_) | Action::SetColumnWidth(_) + | Action::MaximizeColumn ) } diff --git a/src/ui/screenshot_ui.rs b/src/ui/screenshot_ui.rs index 7c03d36e..c996816e 100644 --- a/src/ui/screenshot_ui.rs +++ b/src/ui/screenshot_ui.rs @@ -460,6 +460,25 @@ impl ScreenshotUi { self.update_buffers(); } + pub fn select_entire_output(&mut self) { + let Self::Open { + selection, + output_data, + .. + } = self + else { + return; + }; + + let current_data = &output_data[&selection.0]; + let size = current_data.size; + + selection.1 = Point::new(0, 0); + selection.2 = Point::new(size.w - 1, size.h - 1); + + self.update_buffers(); + } + pub fn set_width(&mut self, change: SizeChange) { let Self::Open { selection: (output, a, b), |
