diff --git a/system/fluent.glade b/system/fluents.glade
similarity index 93%
rename from system/fluent.glade
rename to system/fluents.glade
index 0f286fb..4a98dd8 100644
--- a/system/fluent.glade
+++ b/system/fluents.glade
@@ -177,6 +177,77 @@
@@ -305,7 +376,7 @@
True
- gtk-zoom-in
+ gtk-fullscreen
True
True
False
@@ -320,7 +391,7 @@
True
- gtk-zoom-out
+ gtk-leave-fullscreen
True
True
False
@@ -380,7 +451,7 @@
True
True
- 300
+ 370
diff --git a/system/plots.py b/system/plots.py
index 53b41e2..36ec30e 100644
--- a/system/plots.py
+++ b/system/plots.py
@@ -59,6 +59,13 @@ class ViewFrame (gtk.Frame):
else:
self.unfocus()
+ # Get dropped views
+ self.drag_dest_set(gtk.DEST_DEFAULT_ALL,
+ [("GTK_TREE_MODEL_ROW", gtk.TARGET_SAME_APP, 7)],
+ gtk.gdk.ACTION_LINK)
+ self.connect("drag-data-received", self.on_drag_data_received)
+
+
# Set view
self._view = self.empty_view
self._view.connect("button-press-event", self.on_button_press_event)
@@ -79,7 +86,7 @@ class ViewFrame (gtk.Frame):
return self
def unfocus(self):
- """Removes focus from the ViewFrame if it is focused."""
+ """Removes focus from the ViewFrame. Does nothing if unfocused."""
if not self.focused:
return
@@ -88,6 +95,7 @@ class ViewFrame (gtk.Frame):
def set_view(self, view):
"""Set view to view or to empty view if parameter is None"""
+
# if None is passed, use empty view
if view == None:
view = self.empty_view
@@ -104,6 +112,7 @@ class ViewFrame (gtk.Frame):
# switch which widget we are listening to
if self._button_event:
self._view.disconnect(self._button_event)
+
self._button_event = view.connect("button-press-event", self.on_button_press_event)
# remove old view, set new view
@@ -124,6 +133,14 @@ class ViewFrame (gtk.Frame):
if not self.focused:
self.focus()
+ def on_drag_data_received(self, widget, drag_context, x, y, selection, info, timestamp):
+ treestore, path = selection.tree_get_row_drag_data()
+ iter = treestore.get_iter(path)
+ obj = treestore.get_value(iter,2)
+ if isinstance(obj, Plot):
+ self.set_view(obj)
+
+
class MainView (gtk.Notebook):
def __init__(self):
gtk.Notebook.__init__(self)