[ease/themes: 20/24] Merge branch 'builder'
- From: Nate Stedman <natesm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ease/themes: 20/24] Merge branch 'builder'
- Date: Wed, 21 Jul 2010 20:17:08 +0000 (UTC)
commit 87ea4c188b8feb2497ecbdcab1059eb1abd7f282
Merge: ff47ef5 320a2a5
Author: Nate Stedman <natesm gmail com>
Date: Wed Jul 21 00:44:55 2010 -0400
Merge branch 'builder'
Conflicts:
src/ease-handle.vala
src/ease-welcome-window.vala
data/ui/welcome-window.ui | 90 ++++++++++++
src/ease-document.vala | 2 +-
src/ease-editor-window.vala | 3 +-
src/ease-handle.vala | 2 +-
src/ease-utilities.vala | 45 +++++-
src/ease-welcome-actor.vala | 12 +-
src/ease-welcome-window.vala | 314 +++++++++++++++++++++---------------------
7 files changed, 291 insertions(+), 177 deletions(-)
---
diff --cc src/ease-handle.vala
index c2eb7ab,9b6efcd..f24516c
--- a/src/ease-handle.vala
+++ b/src/ease-handle.vala
@@@ -44,17 -49,14 +44,17 @@@ public class Ease.Handle : Clutter.Cair
*/
public Handle(HandlePosition pos)
{
+ // set the handle's size
+ width = height = surface_width = surface_height = SIZE;
+
+ // draw the default handle appearance
+ redraw();
+
// set the handle's position
position = pos;
--
- // load the handle texture
- filename = data_path(Path.build_filename(Temp.IMG_DIR, W_PATH));
-
++
// set the handle's anchor
- set_anchor_point(width / 2, height / 2);
+ set_anchor_point(SIZE / 2, SIZE / 2);
// react to clicks
reactive = true;
diff --cc src/ease-welcome-window.vala
index 54d6ac6,40a7b23..eb65ee3
--- a/src/ease-welcome-window.vala
+++ b/src/ease-welcome-window.vala
@@@ -86,58 -86,94 +86,94 @@@ public class Ease.WelcomeWindow : Gtk.W
{
assert(RESOLUTIONS_X.length == RESOLUTIONS_Y.length);
- title = _("New Presentation");
- set_default_size(640, 480);
+ this.title = _("Pick a theme and start editing");
+ this.set_default_size(640, 480);
- // build the bottom UI
- var hbox = new Gtk.HBox(false, 5);
- resolution = new Gtk.ComboBox.text();
- resolution.append_text(_("Custom"));
- for (var i = 0; i < RESOLUTIONS_X.length; i++)
- {
- resolution.append_text(_("%i by %i").printf(RESOLUTIONS_X[i],
- RESOLUTIONS_Y[i]));
+ var builder = new Gtk.Builder ();
+ try {
+ string ui_path = data_path(Path.build_filename(Temp.UI_DIR,
+ "welcome-window.ui"));
+ builder.add_from_file (ui_path);
+ } catch (Error e) {
+ error ("Unable to load UI : %s", e.message);
}
-
- var align = new Gtk.Alignment(0, 0.5f, 0, 0);
- align.add(resolution);
- hbox.pack_start(align, false, false, 0);
-
+
+ var vbox = builder.get_object ("vbox1") as Gtk.VBox;
+ var hbox = builder.get_object ("hbox1") as Gtk.HBox;
+ combores = builder.get_object ("combo_resolution") as Gtk.ComboBox;
+ x_res = builder.get_object ("horiz_spin") as Gtk.SpinButton;
+ y_res = builder.get_object ("vert_spin") as Gtk.SpinButton;
+ new_pres_button = builder.get_object ("newpres") as Gtk.Button;
+ open_pres_button = builder.get_object ("openpres") as Gtk.Button;
+
+ // zoom slider
+ zoom_slider = new ZoomSlider(new Gtk.Adjustment(100, 100, 400, 10,
+ 50, 50), ZOOM_VALUES);
+ hbox.pack_start (zoom_slider, false, false);
+ hbox.reorder_child (zoom_slider, 4);
+
+ // Resolutions combo box
+ // FIXME : not re-create it, or do it from Glade.
+ hbox.remove (combores);
+ combores = new Gtk.ComboBox.text ();
+ combores.insert_text (0, _("Custom"));
+ for (var i = 0; i < RESOLUTIONS_X.length; i++) {
+ combores.append_text(_("%i by %i").printf(RESOLUTIONS_X[i],
+ RESOLUTIONS_Y[i]));
+ }
+
+ combores.changed.connect ( () =>
+ {
+ var val = combores.get_active ();
+ if (val > 0) {
+ x_res.set_value (RESOLUTIONS_X[val - 1]);
+ y_res.set_value (RESOLUTIONS_Y[val - 1]);
+ }
+ reflow_previews();
+ });
+
+ hbox.pack_start (combores);
+ hbox.reorder_child (combores, 0);
+
+ // resolutions spin buttons
+ // FIXME : new SpinButton.with_range () avoid the need
+ // of a Gtk.Adjustments, but here I had to create them with
+ // Glade. Find a way to use the older, simpler way.
var resolution_count = RESOLUTIONS_X.length;
- x_res = new Gtk.SpinButton.with_range(RESOLUTIONS_X[0],
- RESOLUTIONS_X[resolution_count-1],
- 1);
-
- align = new Gtk.Alignment(0, 0.5f, 0, 0);
- align.add(x_res);
- hbox.pack_start(align, false, false, 0);
-
- y_res = new Gtk.SpinButton.with_range(RESOLUTIONS_Y[0],
- RESOLUTIONS_Y[resolution_count-1],
- 1);
-
- align = new Gtk.Alignment(0, 0.5f, 0, 0);
- align.add(y_res);
- hbox.pack_start(align, false, false, 0);
-
- new_button = new Gtk.Button.with_label(_("New Presentation"));
- new_button.sensitive = false;
- new_button.image = new Gtk.Image.from_stock("gtk-new",
- Gtk.IconSize.BUTTON);
- align = new Gtk.Alignment(0, 0.5f, 0, 0);
- align.add(new_button);
- hbox.pack_start(align, false, false, 0);
-
- zoom_slider = new AnimatedZoomSlider(new Gtk.Adjustment(100, 100, 400, 10,
- 50, 50), ZOOM_VALUES);
- hbox.pack_start(zoom_slider, false, false, 0);
-
- open_button = new Gtk.Button.from_stock("gtk-open");
- align = new Gtk.Alignment(0, 0.5f, 0, 0);
- align.add(open_button);
- hbox.pack_end(align, false, false, 0);
+ x_res.set_range(RESOLUTIONS_X[0],
+ RESOLUTIONS_X[resolution_count-1]);
+
+ y_res.set_range(RESOLUTIONS_Y[0],
+ RESOLUTIONS_Y[resolution_count-1]);
+
+ x_res.value_changed.connect(() =>
+ {
+ set_resolution_box((int)(x_res.get_value()),
+ (int)(y_res.get_value()));
+ foreach (var p in previews) {
+ p.set_slide_size((int)x_res.get_value(),
+ (int)y_res.get_value());
+ }
+ });
+
+ y_res.value_changed.connect(() =>
+ {
+ set_resolution_box((int)(x_res.get_value()),
+ (int)(y_res.get_value()));
+ foreach (var p in previews) {
+ p.set_slide_size((int)x_res.get_value(),
+ (int)y_res.get_value());
+ }
+ });
+
+ // buttons
+ new_pres_button.sensitive = false;
+ // FIXME : that image doesn't show up in my config...
+ new_pres_button.image = new Gtk.Image.from_stock("gtk-new",
+ Gtk.IconSize.BUTTON);
-
+
// create the upper UI - the embed
+ // FIXME (or don't) : the next line throws a vblank_mode warning for me
embed = new ScrollableEmbed(false, false);
embed.get_stage().use_fog = false;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]