Herbert Breunung avatar Herbert Breunung committed f628d73

adding fullscreen(f11) and closing app with alt+q

Comments (0)

Files changed (3)

lib/Kephra/API.pm

 	document_bar => sub { Kephra::App::Panel::Editor::_active_docbar() },
 );
 
+sub app { $Kephra::App::_ref }
 # gui parts of main window
 sub widget { # widget names are same as in the config
 	my $name = shift;

lib/Kephra/App/Editor.pm

 		elsif ($key ==  &Wx::WXK_PAGEDOWN+4000){Kephra::App::Panel::Editor::move_tab_right()}
 		elsif ($key ==  &Wx::WXK_PAGEDOWN+5000){Kephra::App::Panel::Editor::move_tab_rightmost()}
 		elsif ($key ==  &Wx::WXK_F2)           {Kephra::App::Panel::FileBrowser::focus() } 
+		elsif ($key ==  &Wx::WXK_F11)          {Kephra::API::widget('win')->toggle_fullscreen() } 
 		elsif ($key ==  &Wx::WXK_ESCAPE)       { } 
 		elsif ($key ==  ord('Q') + 2000)       {Kephra::File::close_active() }
+		elsif ($key ==  ord('Q') + 4000)       {Kephra::API::app()->close_save }
 		else {$event->Skip}
 		#print " $key- \n";
 	});

lib/Kephra/App/Window.pm

 	$self->set_title($title);
 }
 
+sub toggle_fullscreen {
+	my ($self) = @_;
+	$self->{fullscreen} ^= 1;
+	$self->ShowFullScreen ( 
+		$self->{fullscreen}, 
+		&Wx::wxFULLSCREEN_NOCAPTION | &Wx::wxFULLSCREEN_NOBORDER
+	);
+}
 
 1;
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.