[ease] Add new Inspector class, potential future InspectorWindow class.
- From: Nate Stedman <natesm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ease] Add new Inspector class, potential future InspectorWindow class.
- Date: Fri, 28 May 2010 06:55:51 +0000 (UTC)
commit 15abfc59025c8c392056b48b009488d1f1f4c909
Author: Nate Stedman <natesm gmail com>
Date: Fri May 28 02:54:49 2010 -0400
Add new Inspector class, potential future InspectorWindow class.
Makefile.am | 2 +
src/EditorWindow.vala | 61 +++-------------------------------------------
src/Inspector.vala | 48 ++++++++++++++++++++++++++++++++++++
src/InspectorWindow.vala | 28 +++++++++++++++++++++
src/SlidePane.vala | 14 ++++++----
src/TransitionPane.vala | 58 +++++++++++++++++++++++++++++++++++++------
6 files changed, 140 insertions(+), 71 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 24624b2..239c2ab 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -23,6 +23,8 @@ ease_SOURCES = \
src/Handle.vala \
src/HTMLExporter.vala \
src/ImageActor.vala \
+ src/Inspector.vala\
+ src/InspectorWindow.vala\
src/MainToolbar.vala \
src/Main.vala \
src/OpenDialog.vala \
diff --git a/src/EditorWindow.vala b/src/EditorWindow.vala
index d2da865..e965213 100644
--- a/src/EditorWindow.vala
+++ b/src/EditorWindow.vala
@@ -28,9 +28,7 @@ public class Ease.EditorWindow : Gtk.Window
// interface elements
public EditorEmbed embed;
public MainToolbar main_toolbar;
- public Gtk.HBox inspector;
public Gtk.HBox slides;
- public TransitionPane pane_transition;
public SlidePane pane_slide;
public ZoomSlider zoom_slider;
@@ -40,6 +38,8 @@ public class Ease.EditorWindow : Gtk.Window
public Document document;
public Slide slide;
+ private Inspector inspector;
+
// the UndoController for this window
private UndoController undo;
@@ -75,18 +75,7 @@ public class Ease.EditorWindow : Gtk.Window
undo = new UndoController();
// the inspector
- inspector = new Gtk.HBox(false, 0);
- var notebook = new Gtk.Notebook();
- notebook.scrollable = true;
- pane_transition = new TransitionPane();
- pane_slide = new SlidePane();
- notebook.append_page(pane_slide,
- new Gtk.Image.from_stock("gtk-page-setup",
- Gtk.IconSize.SMALL_TOOLBAR));
- notebook.append_page(pane_transition,
- new Gtk.Image.from_stock("gtk-media-forward",
- Gtk.IconSize.SMALL_TOOLBAR));
- inspector.pack_start(notebook, false, false, 0);
+ inspector = new Inspector();
// main editor
embed = new EditorEmbed(document, this);
@@ -175,42 +164,6 @@ public class Ease.EditorWindow : Gtk.Window
document.export_to_html(this);
});
- // inspector
-
- // transition pane
- pane_transition.effect.changed.connect(() => {
- var variants = Transitions.get_variants(pane_transition.effect.active);
- pane_transition.variant_align.remove(pane_transition.variant);
- pane_transition.variant = new Gtk.ComboBox.text();
- pane_transition.variant_align.add(pane_transition.variant);
- pane_transition.variant.show();
- pane_transition.variant.changed.connect(() => {
- slide.variant = Transitions.get_variants(pane_transition.effect.active)[pane_transition.variant.active];
- });
- var variant_count = Transitions.get_variant_count(pane_transition.effect.active);
- if (variant_count > 0)
- {
- for (var i = 0; i < variant_count; i++)
- {
- pane_transition.variant.append_text(variants[i]);
- }
- pane_transition.variant.set_active(0);
- slide.variant = Transitions.get_variants(pane_transition.effect.active)[pane_transition.variant.active];
- }
- slide.transition = Transitions.get_name(pane_transition.effect.active);
- });
-
- pane_transition.start_transition.changed.connect(() => {
- if (pane_transition.start_transition.active == 0)
- {
- pane_transition.delay.sensitive = false;
- }
- else
- {
- pane_transition.delay.sensitive = true;
- }
- });
-
// change the embed's zoom when the zoom slider is moved
zoom_slider.value_changed.connect(() => {
embed.set_zoom((float)zoom_slider.get_value());
@@ -232,13 +185,7 @@ public class Ease.EditorWindow : Gtk.Window
slide = document.slides.get(index);
// update ui elements for this new slide
- pane_transition.effect.set_active(Transitions.get_transition_id(slide.transition));
- if (slide.variant != "" && slide.variant != null)
- {
- pane_transition.variant.set_active(Transitions.get_variant_id(slide.transition, slide.variant));
- pane_transition.slide = slide;
- }
-
+ inspector.slide = slide;
embed.set_slide(slide);
}
diff --git a/src/Inspector.vala b/src/Inspector.vala
new file mode 100644
index 0000000..d0b7441
--- /dev/null
+++ b/src/Inspector.vala
@@ -0,0 +1,48 @@
+/* Ease, a GTK presentation application
+ Copyright (C) 2010 Nate Stedman
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+public class Ease.Inspector : Gtk.Notebook
+{
+ private TransitionPane transition_pane;
+ private SlidePane slide_pane;
+
+ private Slide slide_priv;
+ public Slide slide
+ {
+ get { return slide_priv; }
+ set {
+ slide_priv = value;
+ transition_pane.slide = value;
+ slide_pane.slide = value;
+ }
+ }
+
+ public Inspector()
+ {
+ transition_pane = new TransitionPane();
+ slide_pane = new SlidePane();
+
+ // add pages
+ append_page(slide_pane,
+ new Gtk.Image.from_stock("gtk-page-setup",
+ Gtk.IconSize.SMALL_TOOLBAR));
+ append_page(transition_pane,
+ new Gtk.Image.from_stock("gtk-media-forward",
+ Gtk.IconSize.SMALL_TOOLBAR));
+ }
+}
+
diff --git a/src/InspectorWindow.vala b/src/InspectorWindow.vala
new file mode 100644
index 0000000..79875f3
--- /dev/null
+++ b/src/InspectorWindow.vala
@@ -0,0 +1,28 @@
+/* Ease, a GTK presentation application
+ Copyright (C) 2010 Nate Stedman
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+public class Ease.InspectorWindow : Gtk.Window
+{
+ private Inspector inspector;
+
+ public InspectorWindow()
+ {
+ inspector = new Inspector();
+
+ add(inspector);
+ }
+}
diff --git a/src/SlidePane.vala b/src/SlidePane.vala
index eac6140..aa6359b 100644
--- a/src/SlidePane.vala
+++ b/src/SlidePane.vala
@@ -20,12 +20,14 @@
*/
public class Ease.SlidePane : Gtk.VBox
{
- public Gtk.ComboBox effect { get; set; }
- public Gtk.SpinButton duration { get; set; }
- public Gtk.ComboBox variant { get; set; }
- public Gtk.Label variant_label { get; set; }
- public Gtk.ComboBox start_transition { get; set; }
- public Gtk.SpinButton delay { get; set; }
+ public Gtk.ComboBox effect;
+ public Gtk.SpinButton duration;
+ public Gtk.ComboBox variant;
+ public Gtk.Label variant_label;
+ public Gtk.ComboBox start_transition;
+ public Gtk.SpinButton delay;
+
+ public Slide slide { get; set; }
public SlidePane()
{
diff --git a/src/TransitionPane.vala b/src/TransitionPane.vala
index 9aadd57..95b7f9b 100644
--- a/src/TransitionPane.vala
+++ b/src/TransitionPane.vala
@@ -21,14 +21,14 @@
*/
public class Ease.TransitionPane : Gtk.VBox
{
- public Gtk.ComboBox effect { get; set; }
- public Gtk.SpinButton transition_time { get; set; }
- public Gtk.ComboBox variant { get; set; }
- public Gtk.Alignment variant_align { get; set; }
- public Gtk.Label variant_label { get; set; }
- public Gtk.ComboBox start_transition { get; set; }
- public Gtk.SpinButton delay { get; set; }
- public GtkClutter.Embed preview;
+ public Gtk.ComboBox effect;
+ private Gtk.SpinButton transition_time;
+ public Gtk.ComboBox variant;
+ private Gtk.Alignment variant_align;
+ private Gtk.Label variant_label;
+ private Gtk.ComboBox start_transition;
+ private Gtk.SpinButton delay;
+ private GtkClutter.Embed preview;
private Slide slide_priv;
@@ -37,7 +37,14 @@ public class Ease.TransitionPane : Gtk.VBox
get { return slide_priv; }
set {
slide_priv = value;
+
transition_time.set_value(value.transition_time);
+ effect.set_active(Transitions.get_transition_id(slide.transition));
+ if (slide.variant != "" && slide.variant != null)
+ {
+ variant.set_active(Transitions.get_variant_id(slide.transition,
+ slide.variant));
+ }
}
}
@@ -132,6 +139,41 @@ public class Ease.TransitionPane : Gtk.VBox
vbox.pack_start(align, true, true, 0);
hbox.pack_start(vbox, false, false, 5);
pack_start(hbox, false, false, 5);
+
+
+ // signal handlers
+ effect.changed.connect(() => {
+ var variants = Transitions.get_variants(effect.active);
+ variant_align.remove(variant);
+ variant = new Gtk.ComboBox.text();
+ variant_align.add(variant);
+ variant.show();
+ variant.changed.connect(() => {
+ slide.variant = Transitions.get_variants(effect.active)[variant.active];
+ });
+ var variant_count = Transitions.get_variant_count(effect.active);
+ if (variant_count > 0)
+ {
+ for (var i = 0; i < variant_count; i++)
+ {
+ variant.append_text(variants[i]);
+ }
+ variant.set_active(0);
+ slide.variant = Transitions.get_variants(effect.active)[variant.active];
+ }
+ slide.transition = Transitions.get_name(effect.active);
+ });
+
+ start_transition.changed.connect(() => {
+ if (start_transition.active == 0)
+ {
+ delay.sensitive = false;
+ }
+ else
+ {
+ delay.sensitive = true;
+ }
+ });
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]