Commit ef6bd8f9 authored by Jim Nelson's avatar Jim Nelson
Browse files

Fix candidate.

parent 82b18950
......@@ -68,23 +68,6 @@ AM_CONDITIONAL(HAVE__NL_TIME_FIRST_WEEKDAY, test "$california_ok" = "yes")
AC_CHECK_PROG([XDG_EMAIL], [xdg-email], [yes], [no])
AS_IF([test "x$XDG_EMAIL" != xyes], [AC_MSG_ERROR([xdg-email required. Please install xdg-utils package.])])
#
# 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
#
......@@ -99,8 +82,3 @@ AC_CONFIG_FILES([
AC_OUTPUT
AC_MSG_RESULT([
Options:
Unity support: $unity
])
......@@ -13,7 +13,7 @@
dh $@ --parallel
configure:
./autogen.sh --prefix=/usr --enable-unity
./autogen.sh --prefix=/usr
build-arch: configure
dh $@
......
......@@ -216,10 +216,6 @@ california_RC = \
california_OPTIONAL_VALAFLAGS =
if ENABLE_UNITY
california_OPTIONAL_VALAFLAGS += --define ENABLE_UNITY
endif
if HAVE__NL_TIME_FIRST_WEEKDAY
california_OPTIONAL_VALAFLAGS += --define HAVE__NL_TIME_FIRST_WEEKDAY
endif
......
......@@ -126,8 +126,15 @@ public class Application : Gtk.Application {
*/
public Host.MainWindow? main_window { get; private set; default = null; }
/**
* Indicates application is running under Ubuntu's Unity shell.
*/
public bool is_running_unity { get; private set; }
private Application() {
Object (application_id: ID);
is_running_unity = String.ci_equal(Environment.get_variable("XDG_CURRENT_DESKTOP"), "Unity");
}
~Application() {
......
......@@ -149,12 +149,12 @@ public class MainWindow : Gtk.ApplicationWindow {
// if not on Unity, use headerbar as the titlebar (removes window chrome) and provide close
// button for users who might have trouble finding it otherwise
#if !ENABLE_UNITY
// Unity doesn't support GtkHeaderBar-as-title-bar very well yet; when set, the main
// window can't be resized no matter what additional GtkWindow properties are set
set_titlebar(headerbar);
headerbar.show_close_button = true;
#endif
if (!Application.instance.is_running_unity) {
// Unity doesn't support GtkHeaderBar-as-title-bar very well yet; when set, the main
// window can't be resized no matter what additional GtkWindow properties are set
set_titlebar(headerbar);
headerbar.show_close_button = true;
}
// Use custom headerbar title
headerbar.custom_title = custom_title;
......@@ -211,9 +211,8 @@ public class MainWindow : Gtk.ApplicationWindow {
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
#if ENABLE_UNITY
layout.pack_start(headerbar, false, true, 0);
#endif
if (Application.instance.is_running_unity)
layout.pack_start(headerbar, false, true, 0);
layout.pack_end(view_stack, true, true, 0);
add(layout);
......@@ -370,13 +369,13 @@ public class MainWindow : Gtk.ApplicationWindow {
}
private void on_quick_create_event() {
#if ENABLE_UNITY
// Unity/Ambiance has display problems with GtkPopovers attached to GtkHeaderBars, so use
// a DeckWindow
quick_create_event(null, null, null);
#else
quick_create_event(null, quick_add_button, null);
#endif
if (Application.instance.is_running_unity) {
// Unity/Ambiance has display problems with GtkPopovers attached to GtkHeaderBars, so use
// a DeckWindow
quick_create_event(null, null, null);
} else {
quick_create_event(null, quick_add_button, null);
}
}
private void on_jump_to_today() {
......
......@@ -314,10 +314,10 @@ public class Deck : Gtk.Stack {
// this overrides the color and uses the toplevel's background color for the Card. See:
// https://bugzilla.gnome.org/show_bug.cgi?id=735421
private void on_card_realized(Gtk.Widget card) {
#if ENABLE_UNITY
Gdk.RGBA bg = card.get_toplevel().get_style_context().get_background_color(Gtk.StateFlags.NORMAL);
card.override_background_color(Gtk.StateFlags.NORMAL, bg);
#endif
if (Application.instance.is_running_unity) {
Gdk.RGBA bg = card.get_toplevel().get_style_context().get_background_color(Gtk.StateFlags.NORMAL);
card.override_background_color(Gtk.StateFlags.NORMAL, bg);
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment