From bf014d3560b15e710a916f0c58fe81e5852bd29b Mon Sep 17 00:00:00 2001 From: Artem Anufrij Date: Thu, 18 Oct 2018 22:10:56 +0200 Subject: [PATCH] fixed restore window size; added file:/// into placeholder --- .gitignore | 1 + .vscode/tasks.json | 4 ++-- src/MainWindow.vala | 7 +++++-- src/Widgets/Views/Editor.vala | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d163863 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build/ \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index c14ebb3..bf18339 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -4,9 +4,9 @@ "version": "2.0.0", "tasks": [ { - "label": "make", + "label": "ninja", "type": "shell", - "command": "cd ${workspaceFolder}/build && make", + "command": "cd ${workspaceFolder}/build && ninja", "group": { "kind": "build", "isDefault": true diff --git a/src/MainWindow.vala b/src/MainWindow.vala index 7959b5c..15bf01c 100644 --- a/src/MainWindow.vala +++ b/src/MainWindow.vala @@ -207,8 +207,11 @@ namespace Webpin { private void store_settings () { settings.window_state = (this.is_maximized ? Settings.WindowState.MAXIMIZED: Settings.WindowState.NORMAL); if (settings.window_state == Settings.WindowState.NORMAL) { - settings.window_height = this.get_allocated_height (); - settings.window_width = this.get_allocated_width (); + int width, height; + this.get_size (out width, out height); + + settings.window_height = height; + settings.window_width = width; } } } diff --git a/src/Widgets/Views/Editor.vala b/src/Widgets/Views/Editor.vala index b18d259..99f1532 100644 --- a/src/Widgets/Views/Editor.vala +++ b/src/Widgets/Views/Editor.vala @@ -91,7 +91,7 @@ namespace Webpin.Widgets.Views { app_name_entry.set_placeholder_text (_ ("Application name")); app_url_entry = new Gtk.Entry (); - app_url_entry.set_placeholder_text (_ ("https://myapp.domain")); + app_url_entry.set_placeholder_text (_ ("https://myapp.domain or file:///my/local/file")); //icon selector popover icon_selector_popover = new Gtk.Popover (icon_button); @@ -176,7 +176,7 @@ namespace Webpin.Widgets.Views { reset_grab_color_and_icon (); app_url_entry.get_style_context ().add_class ("error"); app_url_entry.set_icon_from_icon_name (Gtk.EntryIconPosition.SECONDARY, "dialog-information"); - app_url_entry.set_icon_tooltip_text (Gtk.EntryIconPosition.SECONDARY, _ ("url must start with http:// or https://")); + app_url_entry.set_icon_tooltip_text (Gtk.EntryIconPosition.SECONDARY, _ ("url must start with http:// or https:// or file:///")); app_url_valid = false; } else { grab_color_and_icon ();