Skip to content

Commit

Permalink
--enable-unity flag to deal with GtkHeaderBar issues: Refs bgo#727624
Browse files Browse the repository at this point in the history
Unity doesn't deal well with pure GtkHeaderBar apps, so this allows
for the GtkHeaderBar to be treated like a toolbar and the window
retain its chrome.
  • Loading branch information
jimbonator committed May 27, 2014
1 parent e44d505 commit ce269c7
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
6 changes: 6 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ configure_help() {
--disable-fatal-warnings
Disable Vala fatal warnings when compiling.
--enable-unity
Enable Unity interface changes.
--enable-ref-tracking
Enable reference tracking which is dumped to stdout when the program exits.
--disable-schemas-compile
Expand Down Expand Up @@ -90,6 +92,10 @@ do
CMDLINE="${CMDLINE} -DREF_TRACKING=ON"
;;

--enable-unity)
CMDLINE="${CMDLINE} -DENABLE_UNITY=ON"
;;

--disable-schemas-compile)
CMDLINE="${CMDLINE} -DGSETTINGS_COMPILE=OFF"
CMDLINE="${CMDLINE} -DGSETTINGS_COMPILE_IN_PLACE=OFF"
Expand Down
2 changes: 1 addition & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
dh $@ --parallel

override_dh_auto_configure:
./configure --prefix=/usr
./configure --prefix=/usr --enable-unity

override_dh_strip:
dh_strip --dbg-package=geary-dbg
Expand Down
10 changes: 10 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,16 @@ else ()
message(STATUS "Reference tracking: OFF")
endif ()

if (ENABLE_UNITY)
message(STATUS "Unity interface changes: ON")
set(EXTRA_VALA_OPTIONS
${EXTRA_VALA_OPTIONS}
--define=ENABLE_UNITY
)
else ()
message(STATUS "Unity interface changes: OFF")
endif ()

set(LIB_PATHS ${DEPS_LIBRARY_DIRS})
link_directories(${LIB_PATHS})
add_definitions(${CFLAGS})
Expand Down
9 changes: 7 additions & 2 deletions src/client/components/main-window.vala
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,14 @@ public class MainWindow : Gtk.ApplicationWindow {
Geary.Engine.instance.account_available.connect(on_account_available);
Geary.Engine.instance.account_unavailable.connect(on_account_unavailable);

create_layout();

// Toolbar.
main_toolbar = new MainToolbar();
#if !ENABLE_UNITY
main_toolbar.show_close_button = true;
set_titlebar(main_toolbar);
#endif

create_layout();
}

public override void show_all() {
Expand Down Expand Up @@ -171,6 +173,9 @@ public class MainWindow : Gtk.ApplicationWindow {
folder_paned.pack1(status_bar_box, false, false);
folder_paned.pack2(conversations_paned, true, false);

#if ENABLE_UNITY
main_layout.pack_start(main_toolbar, false, true, 0);
#endif
main_layout.pack_end(folder_paned, true, true, 0);

add(main_layout);
Expand Down

0 comments on commit ce269c7

Please sign in to comment.