[california/wip/732029-gtk-312: 4/4] More cleanup, removed GTK_312 conditional compilation



commit 72b1baf9a5f33d402bf109deb49a3e9ceabf2519
Author: Jim Nelson <jim yorba org>
Date:   Fri Jul 18 13:26:46 2014 -0700

    More cleanup, removed GTK_312 conditional compilation

 configure.ac                         |    3 ---
 src/Makefile.am                      |    4 ----
 src/host/host-main-window.vala       |   12 +++---------
 src/host/host-show-event.vala        |   17 +++++++++++------
 src/rc/create-update-event.ui        |    6 ++----
 src/rc/create-update-recurring.ui    |    6 ++----
 src/rc/show-event.ui                 |    5 ++++-
 src/toolkit/toolkit-deck-window.vala |   13 ++++++++++++-
 8 files changed, 34 insertions(+), 32 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 614db5c..cd77fdf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,9 +45,6 @@ PKG_CHECK_MODULES(CALIFORNIA, [
        gobject-introspection-1.0 >= $GOBJECT_INTROSPECTION_REQUIRED
 ])
 
-# Look for GTK+ 3.12 or better
-AM_CONDITIONAL(IS_GTK_312, pkg-config --exists 'gtk+-3.0 >= 3.12')
-
 AC_SUBST(CALIFORNIA_CFLAGS)
 AC_SUBST(CALIFORNIA_LIBS)
 
diff --git a/src/Makefile.am b/src/Makefile.am
index 3976255..d821db8 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -195,10 +195,6 @@ if ENABLE_UNITY
 california_OPTIONAL_VALAFLAGS += --define ENABLE_UNITY
 endif
 
-if IS_GTK_312
-california_OPTIONAL_VALAFLAGS += --define GTK_312
-endif
-
 california_VALAFLAGS = \
        --fatal-warnings --debug --enable-checking --vapidir $(top_srcdir)/vapi --target-glib=2.38 \
        --enable-deprecated \
diff --git a/src/host/host-main-window.vala b/src/host/host-main-window.vala
index 00eb985..f96f325 100644
--- a/src/host/host-main-window.vala
+++ b/src/host/host-main-window.vala
@@ -187,7 +187,7 @@ public class MainWindow : Gtk.ApplicationWindow {
         view_switcher.get_style_context().add_class(Gtk.STYLE_CLASS_LINKED);
         view_switcher.get_style_context().add_class(Gtk.STYLE_CLASS_RAISED);
         
-        // pack left-side of window
+        // pack left-side of header bar
         headerbar.pack_start(today);
         headerbar.pack_start(nav_buttons);
         headerbar.pack_start(view_switcher);
@@ -219,17 +219,10 @@ public class MainWindow : Gtk.ApplicationWindow {
         size.add_widget(calendar_button);
         size.add_widget(window_menu);
         
-        // pack right-side of window ... note that this was fixed in 3.12, reversing the order of
-        // how widgets need to be packed at the end
-#if GTK_312
+        // pack right-side of header bar
         headerbar.pack_end(window_menu);
         headerbar.pack_end(calendar_button);
         headerbar.pack_end(quick_add_button);
-#else
-        headerbar.pack_end(quick_add_button);
-        headerbar.pack_end(calendars);
-        headerbar.pack_end(window_menu);
-#endif
         
         Gtk.Box layout = new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
         // if on Unity, since headerbar is not the titlebar, need to pack it like any other widget
@@ -346,6 +339,7 @@ public class MainWindow : Gtk.ApplicationWindow {
         // when the dialog closes, reset View.Controllable state (selection is maintained while
         // use is viewing/editing interaction) and destroy widgets
         deck_window.dismiss.connect(() => {
+            debug("dismissed");
             current_controller.unselect_all();
             deck_window.hide();
             // give the dialog a change to hide before allowing other signals to fire, which may
diff --git a/src/host/host-show-event.vala b/src/host/host-show-event.vala
index 0f82cdf..ebd1bc1 100644
--- a/src/host/host-show-event.vala
+++ b/src/host/host-show-event.vala
@@ -41,6 +41,9 @@ public class ShowEvent : Gtk.Grid, Toolkit.Card {
     private Gtk.Label where_text;
     
     [GtkChild]
+    private Gtk.ScrolledWindow description_text_window;
+    
+    [GtkChild]
     private Gtk.Label description_text;
     
     [GtkChild]
@@ -53,10 +56,10 @@ public class ShowEvent : Gtk.Grid, Toolkit.Card {
     private Gtk.Button close_button = new Gtk.Button.with_mnemonic(_("_Close"));
     private Gtk.Button update_button = new Gtk.Button.with_mnemonic(_("_Update"));
     private Gtk.Button remove_button = new Gtk.Button.with_mnemonic(_("_Remove"));
-    private Gtk.Button remove_all_button = new Gtk.Button.with_mnemonic(_("Remove A_ll Events"));
-    private Gtk.Button remove_this_button = new Gtk.Button.with_mnemonic(_("Remove _This Event"));
+    private Gtk.Button remove_all_button = new Gtk.Button.with_mnemonic(_("A_ll Events"));
+    private Gtk.Button remove_this_button = new Gtk.Button.with_mnemonic(_("_This Event"));
     private Gtk.Button remove_this_future_button = new Gtk.Button.with_mnemonic(
-        _("Remove This and _Future Events"));
+        _("This and _Future Events"));
     private Gtk.Button cancel_remove_button = new Gtk.Button.with_mnemonic(_("_Cancel"));
     
     public ShowEvent() {
@@ -104,6 +107,11 @@ public class ShowEvent : Gtk.Grid, Toolkit.Card {
         event = message as Component.Event;
         assert(event != null);
         
+        description_text.bind_property("visible", description_text_window, "visible",
+            BindingFlags.SYNC_CREATE);
+        description_text.bind_property("no-show-all", description_text_window, "no-show-all",
+            BindingFlags.SYNC_CREATE);
+        
         build_display();
     }
     
@@ -169,9 +177,6 @@ public class ShowEvent : Gtk.Grid, Toolkit.Card {
     private void on_remove_button_clicked() {
         // If recurring (and so this is a generated instance of the VEVENT, not the VEVENT itself),
         // reveal additional remove buttons
-        //
-        // TODO: Gtk.Stack would be a better widget for this animation, but it's unavailable in
-        // Glade as of GTK+ 3.12.
         if (event.is_generated_instance) {
             rotating_button_box.family = FAMILY_REMOVING;
             
diff --git a/src/rc/create-update-event.ui b/src/rc/create-update-event.ui
index 92b2637..c8e75f0 100644
--- a/src/rc/create-update-event.ui
+++ b/src/rc/create-update-event.ui
@@ -6,10 +6,8 @@
     <property name="name">grid</property>
     <property name="visible">True</property>
     <property name="can_focus">False</property>
-    <property name="margin_left">8</property>
-    <property name="margin_right">8</property>
-    <property name="margin_top">8</property>
-    <property name="margin_bottom">8</property>
+    <property name="hexpand">True</property>
+    <property name="vexpand">True</property>
     <property name="row_spacing">8</property>
     <property name="column_homogeneous">True</property>
     <child>
diff --git a/src/rc/create-update-recurring.ui b/src/rc/create-update-recurring.ui
index 205cef3..92e7f7c 100644
--- a/src/rc/create-update-recurring.ui
+++ b/src/rc/create-update-recurring.ui
@@ -5,10 +5,8 @@
   <template class="CaliforniaHostCreateUpdateRecurring" parent="GtkGrid">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
-    <property name="margin_left">8</property>
-    <property name="margin_right">8</property>
-    <property name="margin_top">8</property>
-    <property name="margin_bottom">8</property>
+    <property name="hexpand">True</property>
+    <property name="vexpand">True</property>
     <property name="row_spacing">6</property>
     <child>
       <object class="GtkCheckButton" id="make_recurring_checkbutton">
diff --git a/src/rc/show-event.ui b/src/rc/show-event.ui
index 561e38a..21eeec1 100644
--- a/src/rc/show-event.ui
+++ b/src/rc/show-event.ui
@@ -5,6 +5,8 @@
   <template class="CaliforniaHostShowEvent" parent="GtkGrid">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
+    <property name="hexpand">True</property>
+    <property name="vexpand">True</property>
     <property name="row_spacing">6</property>
     <child>
       <object class="GtkLabel" id="summary_text">
@@ -27,7 +29,7 @@
       </packing>
     </child>
     <child>
-      <object class="GtkScrolledWindow" id="scrolledwindow1">
+      <object class="GtkScrolledWindow" id="description_text_window">
         <property name="visible">True</property>
         <property name="can_focus">True</property>
         <property name="margin_top">6</property>
@@ -154,6 +156,7 @@
       <object class="GtkBox" id="rotating_button_box_container">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
+        <property name="margin_top">8</property>
         <child>
           <placeholder/>
         </child>
diff --git a/src/toolkit/toolkit-deck-window.vala b/src/toolkit/toolkit-deck-window.vala
index 5afbe22..f1d9d8f 100644
--- a/src/toolkit/toolkit-deck-window.vala
+++ b/src/toolkit/toolkit-deck-window.vala
@@ -24,6 +24,10 @@ public class DeckWindow : Gtk.Popover {
     public DeckWindow(Gtk.Widget rel_to, Gdk.Point? for_location, Deck? starter_deck) {
         Object (relative_to: rel_to);
         
+        // Toolkit.RotatingButtonBox requires DeckWindow not be modal because when rotating the
+        // buttons something occurs (probably a focus switch) that causes it to dismiss
+        modal = false;
+        
         this.deck = starter_deck ?? new Deck();
         
         if (for_location != null) {
@@ -34,14 +38,21 @@ public class DeckWindow : Gtk.Popover {
         
         deck.dismiss.connect(on_deck_dismissed);
         
-        add(deck);
+        // store Deck in box so margin can be applied
+        Gtk.Box box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0);
+        box.margin = 4;
+        box.add(deck);
+        
+        add(box);
     }
     
     ~DeckWindow() {
         deck.dismiss.disconnect(on_deck_dismissed);
+        debug("CTOR");
     }
     
     private void on_deck_dismissed(bool user_request, bool final) {
+        debug("deck dismissed");
         dismiss(user_request, final);
         if (final)
             destroy();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]