File tree Expand file tree Collapse file tree 3 files changed +18
-3
lines changed
Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -762,7 +762,7 @@ impl App {
762762 match result {
763763 Ok ( _) => Message :: Ignore ,
764764 Err ( e) => {
765- log:: error!( "Unable to open directory : `{}` - {:?}" , path2. resolve( ) , e) ;
765+ log:: error!( "Unable to open file : `{}` - {:?}" , path2. resolve( ) , e) ;
766766 Message :: OpenPathFailure { path : path2 }
767767 }
768768 }
Original file line number Diff line number Diff line change @@ -232,6 +232,20 @@ pub fn choose_file<'a>(
232232 ) )
233233}
234234
235+ pub fn open_path < ' a > ( path : StrictPath , modifiers : & keyboard:: Modifiers ) -> CustomButton < ' a > {
236+ if modifiers. shift ( ) {
237+ icon ( Icon :: FileOpen ) . on_press ( Message :: OpenFile { path } )
238+ } else {
239+ icon ( Icon :: OpenInNew ) . on_press ( Message :: OpenDir { path } )
240+ }
241+ . tooltip ( format ! (
242+ "{}\n {} {}" ,
243+ lang:: action:: open_folder( ) ,
244+ lang:: field( & lang:: thing:: key:: shift( ) ) ,
245+ lang:: action:: open_file( )
246+ ) )
247+ }
248+
235249pub fn move_up < ' a > ( action : fn ( EditAction ) -> Message , index : usize ) -> CustomButton < ' a > {
236250 icon ( Icon :: ArrowUpward ) . on_press_maybe ( ( index > 0 ) . then ( || action ( EditAction :: move_up ( index) ) ) )
237251}
Original file line number Diff line number Diff line change @@ -457,7 +457,7 @@ impl Modal {
457457 for media in all_media {
458458 col = col. push (
459459 Row :: new ( )
460- . spacing ( 20 )
460+ . spacing ( 10 )
461461 . align_y ( Alignment :: Center )
462462 . push ( if collection. is_error ( media) {
463463 button:: icon ( Icon :: Error )
@@ -478,7 +478,8 @@ impl Modal {
478478 }
479479 . small_control ( ) ,
480480 )
481- . push ( text ( media. path ( ) . raw ( ) ) . width ( Length :: Fill ) ) ,
481+ . push ( button:: open_path ( media. path ( ) . clone ( ) , modifiers) )
482+ . push ( text ( media. path ( ) . raw ( ) ) ) ,
482483 ) ;
483484 }
484485 }
You can’t perform that action at this time.
0 commit comments