@@ -38,9 +38,11 @@ const FONT: &str = "sans 14px";
3838const BORDER : i32 = 4 ;
3939const TEXT_HIDE_P : & str =
4040 "Press <span face='mono' bgcolor='#2C2C2C'> Space </span> to save the screenshot.\n \
41+ Press <span face='mono' bgcolor='#2C2C2C'> Ctrl+A </span> to select the entire output.\n \
4142 Press <span face='mono' bgcolor='#2C2C2C'> P </span> to hide the pointer.";
4243const TEXT_SHOW_P : & str =
4344 "Press <span face='mono' bgcolor='#2C2C2C'> Space </span> to save the screenshot.\n \
45+ Press <span face='mono' bgcolor='#2C2C2C'> Ctrl+A </span> to select the entire output.\n \
4446 Press <span face='mono' bgcolor='#2C2C2C'> P </span> to show the pointer.";
4547
4648// Ideally the screenshot UI should support cross-output selections. However, that poses some
@@ -460,6 +462,23 @@ impl ScreenshotUi {
460462 self . update_buffers ( ) ;
461463 }
462464
465+
466+ pub fn select_entire_output ( & mut self ) {
467+ let Self :: Open {
468+ selection,
469+ output_data,
470+ ..
471+ } = self else { return } ;
472+
473+ let current_data = & output_data[ & selection. 0 ] ;
474+ let size = current_data. size ;
475+
476+ selection. 1 = Point :: new ( 0 , 0 ) ;
477+ selection. 2 = Point :: new ( size. w - 1 , size. h - 1 ) ;
478+
479+ self . update_buffers ( ) ;
480+ }
481+
463482 pub fn set_width ( & mut self , change : SizeChange ) {
464483 let Self :: Open {
465484 selection : ( output, a, b) ,
@@ -1067,6 +1086,10 @@ fn action(raw: Keysym, mods: ModifiersState) -> Option<Action> {
10671086 } ) ;
10681087 }
10691088
1089+ if mods. ctrl && raw == Keysym :: a {
1090+ return Some ( Action :: ScreenshotSelectAll ) ;
1091+ }
1092+
10701093 if !mods. ctrl && raw == Keysym :: p {
10711094 return Some ( Action :: ScreenshotTogglePointer ) ;
10721095 }
0 commit comments