Clone in a terminal:
Commit ba12105
Johan Mattsson - 2012-10-12T14:04:25+00:00
ba12105fd8fa8e3e9f3efeea05f70821e0760f93johan.mattsson.m@gmail.com

store window size

Changed files (5)

Diff

diff --git a/src/GlyphCanvas.vala b/src/GlyphCanvas.valaindex 8d0ed0d..f30cc19 100644--- a/src/GlyphCanvas.vala+++ b/src/GlyphCanvas.vala@@ -63,7 +63,7 @@ class GlyphCanvas : DrawingArea  { 					}
 					
 					Supplement.current_glyph.resized (alloc, allocation);
-					Preferences.update_window_size ();
+					MainWindow.native_window.update_window_size ();
 				}
 				
 				alloc = allocation;
diff --git a/src/GtkInterface.vala b/src/GtkInterface.valaindex 4120749..e228807 100644--- a/src/GtkInterface.vala+++ b/src/GtkInterface.vala@@ -185,12 +185,24 @@ public class GtkWindow : Gtk.Window, NativeWindow { 		// (Supplement.exe:1300): Gdk-CRITICAL **: gdk_window_set_cursor: assertion `GDK_IS_WINDOW (window)' failed		 		// singleton.frame.set_cursor (cursor); 	}-	++	public void update_window_size () {+		int w, h;+		get_size (out w, out h);+		+		print ("window_width $w\n");+		+		Preferences.set ("window_width", @"$w");+		Preferences.set ("window_height", @"$h");+	}+		 	private void set_size_and_position () { 		int w = Preferences.get_window_width (); 		int h = Preferences.get_window_height (); 		-		set_default_size (w, h);+		print ("window_width $w\n");+		+		set_default_size (1000, h); 		// move (10, 240); 	} 	diff --git a/src/MainWindow.vala b/src/MainWindow.valaindex 2bca17d..8663341 100644--- a/src/MainWindow.vala+++ b/src/MainWindow.vala@@ -21,15 +21,6 @@ using WebKit; 
 namespace Supplement {
 
-public interface NativeWindow : GLib.Object {
-	public abstract string? file_chooser (string title);
-	public abstract string? set_title (string title);
-
-	public abstract void toggle_expanded_margin_bottom ();
-	public abstract void toggle_expanded_margin_right ();
-	
-}
-
 internal class MainWindow {
 	
 	public static Toolbox tools;
diff --git a/src/Preferences.vala b/src/Preferences.valaindex ac7f909..9bca886 100644--- a/src/Preferences.vala+++ b/src/Preferences.vala@@ -83,15 +83,6 @@ internal class Preferences { 		return (h == 0) ? 500 : h; 	} 	-	public static void update_window_size () {-/*		int w, h;-		MainWindow.get_current_window ().get_size (out w, out h);-		-		set ("window_width", @"$w");-		set ("window_height", @"$h");-*/-	}-	 	public static void load () { 		File app_dir = Supplement.get_settings_directory (); 		File settings = app_dir.get_child ("settings");diff --git a/src/wscript b/src/wscriptindex 170099c..34cd1f2 100644--- a/src/wscript+++ b/src/wscript@@ -33,6 +33,7 @@ BIRDFONT = [ 	'MenuTab.vala', 	'MergeTool.vala', 	'MoveTool.vala',+	'NativeWindow.vala', 	'Intersection.vala', 	'IntersectionList.vala', 	'IOThread.vala',

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112