added zoom support
This commit is contained in:
parent
0067bb9f8d
commit
c2ea31129f
1 changed files with 26 additions and 0 deletions
|
@ -84,6 +84,7 @@ namespace Webpin {
|
||||||
var width = info.get_string ("WebpinWindowWidth");
|
var width = info.get_string ("WebpinWindowWidth");
|
||||||
var height = info.get_string ("WebpinWindowHeight");
|
var height = info.get_string ("WebpinWindowHeight");
|
||||||
var state = info.get_string ("WebpinWindowMaximized");
|
var state = info.get_string ("WebpinWindowMaximized");
|
||||||
|
var zoom = info.get_string ("WebpinWindowZoom");
|
||||||
|
|
||||||
if (width != null && height != null) {
|
if (width != null && height != null) {
|
||||||
set_default_size (int.parse(width), int.parse(height));
|
set_default_size (int.parse(width), int.parse(height));
|
||||||
|
@ -95,6 +96,10 @@ namespace Webpin {
|
||||||
this.maximize ();
|
this.maximize ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (zoom != null) {
|
||||||
|
web_app.app_view.zoom_level = double.parse (zoom);
|
||||||
|
}
|
||||||
|
|
||||||
this.delete_event.connect (() => {
|
this.delete_event.connect (() => {
|
||||||
update_window_state(this.get_allocated_width (), this.get_allocated_height (), this.is_maximized);
|
update_window_state(this.get_allocated_width (), this.get_allocated_height (), this.is_maximized);
|
||||||
return false;
|
return false;
|
||||||
|
@ -162,6 +167,27 @@ namespace Webpin {
|
||||||
case Gdk.Key.F11:
|
case Gdk.Key.F11:
|
||||||
toggle_fullscreen();
|
toggle_fullscreen();
|
||||||
break;
|
break;
|
||||||
|
case Gdk.Key.KP_Add:
|
||||||
|
case Gdk.Key.plus:
|
||||||
|
if (Gdk.ModifierType.CONTROL_MASK in event.state) {
|
||||||
|
web_app.app_view.zoom_level += 0.1;
|
||||||
|
web_app.get_desktop_file().edit_propertie ("WebpinWindowZoom", web_app.app_view.zoom_level.to_string ());
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case Gdk.Key.KP_Subtract:
|
||||||
|
case Gdk.Key.minus:
|
||||||
|
if (Gdk.ModifierType.CONTROL_MASK in event.state) {
|
||||||
|
web_app.app_view.zoom_level -= 0.1;
|
||||||
|
web_app.get_desktop_file().edit_propertie ("WebpinWindowZoom", web_app.app_view.zoom_level.to_string ());
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case Gdk.Key.KP_0:
|
||||||
|
case Gdk.Key.@0:
|
||||||
|
if (Gdk.ModifierType.CONTROL_MASK in event.state) {
|
||||||
|
web_app.app_view.zoom_level = 1;
|
||||||
|
web_app.get_desktop_file().edit_propertie ("WebpinWindowZoom", web_app.app_view.zoom_level.to_string ());
|
||||||
|
}
|
||||||
|
break;
|
||||||
case Gdk.Key.F5:
|
case Gdk.Key.F5:
|
||||||
if (Gdk.ModifierType.CONTROL_MASK in event.state) {
|
if (Gdk.ModifierType.CONTROL_MASK in event.state) {
|
||||||
web_app.app_view.reload ();
|
web_app.app_view.reload ();
|
||||||
|
|
Loading…
Reference in a new issue