summaryrefslogtreecommitdiff
path: root/tikzit/src/gtk/Application.m
diff options
context:
space:
mode:
Diffstat (limited to 'tikzit/src/gtk/Application.m')
-rw-r--r--tikzit/src/gtk/Application.m30
1 files changed, 22 insertions, 8 deletions
diff --git a/tikzit/src/gtk/Application.m b/tikzit/src/gtk/Application.m
index ecaec6d..9f5fba5 100644
--- a/tikzit/src/gtk/Application.m
+++ b/tikzit/src/gtk/Application.m
@@ -19,14 +19,7 @@
#import "Configuration.h"
#import "PreambleEditor.h"
-#ifdef HAVE_POPPLER
-#import "Preambles.h"
-#import "Preambles+Storage.h"
-#import "PreviewWindow.h"
-#endif
-#ifdef HAVE_POPPLER
-#import "SettingsDialog.h"
-#endif
+#import "PropertiesWindow.h"
#import "Shape.h"
#import "StyleManager.h"
#import "StyleManager+Storage.h"
@@ -35,6 +28,13 @@
#import "ToolBox.h"
#import "Window.h"
+#ifdef HAVE_POPPLER
+#import "Preambles.h"
+#import "Preambles+Storage.h"
+#import "PreviewWindow.h"
+#import "SettingsDialog.h"
+#endif
+
#import "BoundingBoxTool.h"
#import "CreateNodeTool.h"
#import "CreateEdgeTool.h"
@@ -48,6 +48,7 @@ Application* app = nil;
@interface Application (Notifications)
- (void) windowClosed:(NSNotification*)notification;
+- (void) windowGainedFocus:(NSNotification*)notification;
- (void) selectedToolChanged:(NSNotification*)notification;
@end
@@ -123,6 +124,9 @@ Application* app = nil;
name:@"ToolSelectionChanged"
object:toolBox];
+ propertiesWindow = [[PropertiesWindow alloc] init];
+ [propertiesWindow setVisible:YES];
+
app = [self retain];
}
@@ -177,6 +181,7 @@ Application* app = nil;
[tools release];
[activeTool release];
[toolBox release];
+ [propertiesWindow release];
[super dealloc];
}
@@ -200,6 +205,10 @@ Application* app = nil;
selector:@selector(windowClosed:)
name:@"WindowClosed"
object:window];
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(windowGainedFocus:)
+ name:@"WindowGainedFocus"
+ object:window];
// FIXME: focus?
}
@@ -306,6 +315,11 @@ Application* app = nil;
gtk_main_quit();
}
}
+- (void) windowGainedFocus:(NSNotification*)notification {
+ Window *window = [notification object];
+ TikzDocument *doc = [window document];
+ [propertiesWindow setDocument:doc];
+}
- (void) selectedToolChanged:(NSNotification*)n {
id<Tool> tool = [[n userInfo] objectForKey:@"tool"];
if (tool != nil)