[california/wip/726075-unity] Add --enable-unity to disable full GtkHeaderBar use



commit f5b52e0082e11113b9f45184cbdf23c2d8b8d5a3
Author: Jim Nelson <jim yorba org>
Date:   Wed Mar 12 16:20:34 2014 -0700

    Add --enable-unity to disable full GtkHeaderBar use

 configure.ac                   |   26 ++++++++++++++++++++++++++
 src/Makefile.am                |    7 +++++++
 src/host/host-main-window.vala |    7 ++++++-
 3 files changed, 39 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index e4dd944..c2483d8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -38,9 +38,35 @@ PKG_CHECK_MODULES(CALIFORNIA, \
 AC_SUBST(CALIFORNIA_CFLAGS)
 AC_SUBST(CALIFORNIA_LIBS)
 
+#
+# configure switches
+#
+# Unity support
+#
+
+AC_MSG_CHECKING([Unity support])
+AC_ARG_ENABLE(unity,
+       [  --enable-unity          enable Unity support [[default=disabled]]],
+       [ unity=$enableval ],
+       [ unity=no ]
+)
+
+AC_MSG_RESULT($unity)
+AM_CONDITIONAL(ENABLE_UNITY, test "x$unity" = "xyes")
+
+#
+# /configure switches
+#
+
 AC_CONFIG_FILES([
        Makefile
        src/Makefile
        po/Makefile.in])
 
 AC_OUTPUT
+
+AC_MSG_RESULT([
+Options:
+       Unity support:          $unity
+])
+
diff --git a/src/Makefile.am b/src/Makefile.am
index 44fa9ba..0effdca 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -91,9 +91,16 @@ california_RC = \
        rc/show-event.ui \
        $(NULL)
 
+california_OPTIONAL_VALAFLAGS =
+
+if ENABLE_UNITY
+california_OPTIONAL_VALAFLAGS += --define ENABLE_UNITY
+endif
+
 california_VALAFLAGS = \
        --fatal-warnings -g --enable-checking --vapidir $(top_srcdir)/vapi --target-glib=2.38 \
        --gresources=california-resources.xml \
+       $(california_OPTIONAL_VALAFLAGS) \
        --pkg gtk+-3.0 \
        --pkg gio-2.0 \
        --pkg posix \
diff --git a/src/host/host-main-window.vala b/src/host/host-main-window.vala
index c4d7619..9317c03 100644
--- a/src/host/host-main-window.vala
+++ b/src/host/host-main-window.vala
@@ -32,8 +32,10 @@ public class MainWindow : Gtk.ApplicationWindow {
         
         // create GtkHeaderBar and pack it in
         Gtk.HeaderBar headerbar = new Gtk.HeaderBar();
+#if !ENABLE_UNITY
         headerbar.show_close_button = true;
-        set_titlebar (headerbar);
+        set_titlebar(headerbar);
+#endif
         
         bool rtl = get_direction () == Gtk.TextDirection.RTL;
         
@@ -64,6 +66,9 @@ public class MainWindow : Gtk.ApplicationWindow {
         headerbar.pack_end(new_event);
         
         Gtk.Box layout = new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
+#if ENABLE_UNITY
+        layout.pack_start(headerbar, false, true, 0);
+#endif
         layout.pack_end(month_view, true, true, 0);
         
         // current host bindings and signals


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