[ease/inspector] Added the inspector as a single window.
- From: Nate Stedman <natesm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ease/inspector] Added the inspector as a single window.
- Date: Wed, 9 Jun 2010 22:00:57 +0000 (UTC)
commit fe24dd02323ade4aebf9149a18adaf3c2f8db9e3
Author: Nate Stedman <natesm gmail com>
Date: Thu Jun 3 02:34:28 2010 -0400
Added the inspector as a single window.
src/EditorWindow.vala | 23 +++--------------------
src/InspectorWindow.vala | 17 ++++++++++++++++-
src/TransitionPane.vala | 1 +
3 files changed, 20 insertions(+), 21 deletions(-)
---
diff --git a/src/EditorWindow.vala b/src/EditorWindow.vala
index bf90467..ab7d2da 100644
--- a/src/EditorWindow.vala
+++ b/src/EditorWindow.vala
@@ -40,14 +40,11 @@ public class Ease.EditorWindow : Gtk.Window
public Document document;
public Slide slide;
- private Inspector inspector;
-
// the UndoController for this window
private UndoController undo;
// interface variables
- public bool inspector_shown { get; set; }
- public bool slides_shown { get; set; }
+ private bool slides_shown;
// constants
private int[] ZOOM_LEVELS = {10, 25, 33, 50, 66, 75, 100, 125, 150,
@@ -76,9 +73,6 @@ public class Ease.EditorWindow : Gtk.Window
// undo controller
undo = new UndoController();
- // the inspector
- inspector = new Inspector();
-
// main editor
embed = new EditorEmbed(document, this);
@@ -86,7 +80,6 @@ public class Ease.EditorWindow : Gtk.Window
var hbox = new Gtk.HBox(false, 0);
hbox.pack_start(slide_button_panel, false, false, 0);
hbox.pack_start(embed, true, true, 0);
- hbox.pack_start(inspector, false, false, 0);
// assemble window contents
var vbox = new Gtk.VBox(false, 0);
@@ -100,8 +93,6 @@ public class Ease.EditorWindow : Gtk.Window
add(vbox);
show_all();
embed.show();
- inspector.hide();
- inspector_shown = false;
slides_shown = true;
// USER INTERFACE SIGNALS
@@ -124,15 +115,7 @@ public class Ease.EditorWindow : Gtk.Window
// show and hide inspector
main_toolbar.inspector.clicked.connect(() => {
- if (inspector_shown)
- {
- inspector.hide();
- }
- else
- {
- inspector.show();
- }
- inspector_shown = !inspector_shown;
+ InspectorWindow.toggle();
});
// show and hide slides
@@ -240,7 +223,7 @@ public class Ease.EditorWindow : Gtk.Window
slide = document.slides.get(index);
// update ui elements for this new slide
- inspector.slide = slide;
+ InspectorWindow.slide = slide;
embed.set_slide(slide);
}
diff --git a/src/InspectorWindow.vala b/src/InspectorWindow.vala
index d426cbf..bf7ac93 100644
--- a/src/InspectorWindow.vala
+++ b/src/InspectorWindow.vala
@@ -22,11 +22,19 @@
public class Ease.InspectorWindow : Gtk.Window
{
private Inspector inspector;
+ private const bool SKIP_TASKBAR = true;
+ private const int MIN_WIDTH = 200;
+ private const int MIN_HEIGHT = 500;
public InspectorWindow()
{
inspector = new Inspector();
+ title = _("Inspector");
+
+ height_request = MIN_HEIGHT;
+ skip_taskbar_hint = SKIP_TASKBAR;
+
add(inspector);
}
@@ -41,6 +49,10 @@ public class Ease.InspectorWindow : Gtk.Window
if (instance == null)
{
instance = new InspectorWindow();
+ if (slide_priv != null)
+ {
+ instance.slide = slide_priv;
+ }
}
if (instance.visible)
@@ -66,7 +78,10 @@ public class Ease.InspectorWindow : Gtk.Window
{
if (slide_priv != value)
{
- instance.inspector.slide = value;
+ if (instance != null)
+ {
+ instance.inspector.slide = value;
+ }
slide_priv = value;
}
}
diff --git a/src/TransitionPane.vala b/src/TransitionPane.vala
index 1306f25..68f1146 100644
--- a/src/TransitionPane.vala
+++ b/src/TransitionPane.vala
@@ -189,6 +189,7 @@ public class Ease.TransitionPane : InspectorPane
// automatically scale the preview to fit in the embed
preview.get_stage().allocation_changed.connect((box, flags) => {
+ if (slide == null) return;
preview_group.scale_x = (box.x2 - box.x1) / slide.parent.width;
preview_group.scale_y = (box.y2 - box.y1) / slide.parent.height;
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]