[geary/wip/765516-gtk-widget-conversation-viewer: 6/58] Remove conditional compilation for GTK+ 3.12.
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/765516-gtk-widget-conversation-viewer: 6/58] Remove conditional compilation for GTK+ 3.12.
- Date: Fri, 13 May 2016 02:16:52 +0000 (UTC)
commit 1adbdc457e0ce0aec0f6cf4c66b971fedd41d5eb
Author: Michael James Gratton <mike vee net>
Date: Sun Apr 10 00:44:15 2016 +1000
Remove conditional compilation for GTK+ 3.12.
src/CMakeLists.txt | 9 -------
src/client/components/main-toolbar.vala | 32 +--------------------------
src/client/components/pill-toolbar.vala | 6 +----
src/client/composer/composer-headerbar.vala | 15 ------------
4 files changed, 2 insertions(+), 60 deletions(-)
---
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 2dd15aa..f55e160 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -519,15 +519,6 @@ else ()
message(FATAL_ERROR "WebKitGTK not installed / unknown version detected")
endif ()
-if (GTK312X_FOUND)
- message(STATUS "GTK+ 3.12 support: ON")
-
- set(EXTRA_VALA_OPTIONS
- ${EXTRA_VALA_OPTIONS}
- -D GTK_3_12
- )
-endif ()
-
if (NO_FATAL_WARNINGS)
message(STATUS "Vala fatal warnings: OFF")
else ()
diff --git a/src/client/components/main-toolbar.vala b/src/client/components/main-toolbar.vala
index a03a37f..1212105 100644
--- a/src/client/components/main-toolbar.vala
+++ b/src/client/components/main-toolbar.vala
@@ -87,15 +87,9 @@ public class MainToolbar : Gtk.Box {
insert.add(search_button);
Gtk.Box search = folder_header.create_pill_buttons(insert, false);
-#if !GTK_3_12
- folder_header.add_end(empty);
- folder_header.add_end(search);
- folder_header.add_end(new Gtk.Separator(Gtk.Orientation.VERTICAL));
-#else
folder_header.add_end(new Gtk.Separator(Gtk.Orientation.VERTICAL));
folder_header.add_end(search);
folder_header.add_end(empty);
-#endif
// Reply buttons
insert.clear();
@@ -127,11 +121,6 @@ public class MainToolbar : Gtk.Box {
false));
Gtk.Box undo = conversation_header.create_pill_buttons(insert);
- // pack_end() ordering is reversed in GtkHeaderBar in 3.12 and above
-#if !GTK_3_12
- conversation_header.add_end(archive_trash_delete);
- conversation_header.add_end(undo);
-#endif
// Application button. If we exported an app menu, we don't need this.
if (!Gtk.Settings.get_default().gtk_shell_shows_app_menu) {
insert.clear();
@@ -141,21 +130,14 @@ public class MainToolbar : Gtk.Box {
application_menu, GearyController.ACTION_GEAR_MENU));
conversation_header.add_end(conversation_header.create_pill_buttons(insert));
}
-#if GTK_3_12
conversation_header.add_end(undo);
conversation_header.add_end(archive_trash_delete);
-#endif
pack_start(folder_header, false, false);
pack_start(conversation_header, true, true);
-#if GTK_3_12
Gtk.Settings.get_default().notify["gtk-decoration-layout"].connect(set_window_buttons);
realize.connect(set_window_buttons);
-#else
- get_style_context().changed.connect(set_close_buttons_side);
- realize.connect(set_close_buttons_side);
-#endif
}
/// Updates the trash button as trash or delete, and shows or hides the archive button.
@@ -174,9 +156,7 @@ public class MainToolbar : Gtk.Box {
guest_header_binding = bind_property("show-close-button-right", header,
"show-close-button", BindingFlags.SYNC_CREATE);
pack_start(header, true, true);
-#if GTK_3_12
header.decoration_layout = conversation_header.decoration_layout;
-#endif
}
public void remove_conversation_header(Gtk.HeaderBar header) {
@@ -185,13 +165,10 @@ public class MainToolbar : Gtk.Box {
header.get_style_context().remove_class("geary-titlebar-right");
GtkUtil.unbind(guest_header_binding);
header.show_close_button = false;
-#if GTK_3_12
header.decoration_layout = Gtk.Settings.get_default().gtk_decoration_layout;
-#endif
conversation_header.show();
}
-#if GTK_3_12
private void set_window_buttons() {
string[] buttons = Gtk.Settings.get_default().gtk_decoration_layout.split(":");
if (buttons.length != 2) {
@@ -203,12 +180,5 @@ public class MainToolbar : Gtk.Box {
folder_header.decoration_layout = buttons[0] + ":";
conversation_header.decoration_layout = ":" + buttons[1];
}
-#else
- private void set_close_buttons_side() {
- bool at_end = folder_header.close_button_at_end();
- show_close_button_left = show_close_button && !at_end;
- show_close_button_right = show_close_button && at_end;
- }
-#endif
-}
+}
diff --git a/src/client/components/pill-toolbar.vala b/src/client/components/pill-toolbar.vala
index 688937a..26a9b73 100644
--- a/src/client/components/pill-toolbar.vala
+++ b/src/client/components/pill-toolbar.vala
@@ -133,11 +133,7 @@ public class PillHeaderbar : Gtk.HeaderBar, PillBar {
public bool close_button_at_end() {
string layout;
bool at_end = false;
-#if GTK_3_12
- layout = Gtk.Settings.get_default().gtk_decoration_layout;
-#else
- get_toplevel().style_get("decoration-button-layout", out layout);
-#endif
+ layout = decoration_layout;
// Based on logic of close_button_at_end in gtkheaderbar.c: Close button appears
// at end iff "close" follows a colon in the layout string.
if (layout != null) {
diff --git a/src/client/composer/composer-headerbar.vala b/src/client/composer/composer-headerbar.vala
index 018a562..86590d5 100644
--- a/src/client/composer/composer-headerbar.vala
+++ b/src/client/composer/composer-headerbar.vala
@@ -83,11 +83,6 @@ public class ComposerHeaderbar : PillHeaderbar {
add_start(detach_start);
add_start(attach_buttons);
add_start(recipients);
-#if !GTK_3_12
- add_end(send_button);
- add_end(close_buttons);
- add_end(detach_end);
-#endif
// Application button for when taking over main header bar. If we exported an app menu,
// we don't need this.
if (!Gtk.Settings.get_default().gtk_shell_shows_app_menu) {
@@ -102,25 +97,15 @@ public class ComposerHeaderbar : PillHeaderbar {
return true;
});
}
-#if GTK_3_12
add_end(detach_end);
add_end(close_buttons);
add_end(send_button);
-#endif
-#if GTK_3_12
notify["decoration-layout"].connect(set_detach_button_side);
-#else
- get_style_context().changed.connect(set_detach_button_side);
-#endif
realize.connect(set_detach_button_side);
notify["state"].connect((s, p) => {
if (state == ComposerWidget.ComposerState.DETACHED) {
-#if GTK_3_12
notify["decoration-layout"].disconnect(set_detach_button_side);
-#else
- get_style_context().changed.disconnect(set_detach_button_side);
-#endif
detach_start.visible = detach_end.visible = false;
}
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]