Fix back-portable header bar positions

This reverts dbb2e0feb0 and adds a
temporary fix for gtk+ >= 3.11. This commit can be reverted once we
bump our gtk+ requirement to 3.12.
This commit is contained in:
Jesse van den Kieboom 2014-01-09 22:39:25 +01:00
parent 9cbc47296f
commit 1ea17027e3
4 changed files with 36 additions and 9 deletions

View file

@ -107,6 +107,16 @@ PKG_CHECK_MODULES(LIBGITG, [
json-glib-1.0 json-glib-1.0
]) ])
dnl temporary check for 3.11 to switch header bar buttons. This check can
dnl be removed when we bump the gtk+ requirement to 3.12
PKG_CHECK_EXISTS(gtk+-3.0 >= 3.11,
[GTK_VERSION_AT_LEAST_3_11=TRUE],
[GTK_VERSION_AT_LEAST_3_11=FALSE])
AC_DEFINE_UNQUOTED([GTK_VERSION_AT_LEAST_3_11],
$GTK_VERSION_AT_LEAST_3_11,
[Set if the gtk+ version is at least 3.11])
AC_MSG_CHECKING([for libgit2-glib threading support]) AC_MSG_CHECKING([for libgit2-glib threading support])
cflags_save="${CFLAGS}" cflags_save="${CFLAGS}"

View file

@ -171,6 +171,19 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
{ {
dash_image.icon_name = "go-previous-symbolic"; dash_image.icon_name = "go-previous-symbolic";
} }
// temporary check for 3.11 to switch header bar buttons. This check can
// be removed when we bump the gtk+ requirement to 3.12
if (Config.GTK_VERSION_AT_LEAST_3_11)
{
d_header_bar.remove(d_activities_switcher);
d_header_bar.remove(d_search_button);
d_header_bar.remove(d_gear_menu);
d_header_bar.pack_end(d_gear_menu);
d_header_bar.pack_end(d_search_button);
d_header_bar.pack_end(d_activities_switcher);
}
} }
private void on_close_activated() private void on_close_activated()

View file

@ -35,19 +35,20 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkMenuButton" id="d_gear_menu"> <object class="GtkToggleButton" id="d_search_button">
<property name="visible">True</property> <property name="visible">True</property>
<property name="valign">center</property> <property name="valign">center</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="action_name">win.gear-menu</property> <property name="action_name">win.search</property>
<signal name="toggled" handler="search_button_toggled" swapped="no"/>
<style> <style>
<class name="image-button"/> <class name="image-button"/>
</style> </style>
<child> <child>
<object class="GtkImage" id="gear_image"> <object class="GtkImage" id="search_image">
<property name="visible">True</property> <property name="visible">True</property>
<property name="icon_size">1</property> <property name="icon_size">1</property>
<property name="icon_name">emblem-system-symbolic</property> <property name="icon_name">edit-find-symbolic</property>
</object> </object>
</child> </child>
</object> </object>
@ -64,20 +65,19 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkToggleButton" id="d_search_button"> <object class="GtkMenuButton" id="d_gear_menu">
<property name="visible">True</property> <property name="visible">True</property>
<property name="valign">center</property> <property name="valign">center</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="action_name">win.search</property> <property name="action_name">win.gear-menu</property>
<signal name="toggled" handler="search_button_toggled" swapped="no"/>
<style> <style>
<class name="image-button"/> <class name="image-button"/>
</style> </style>
<child> <child>
<object class="GtkImage" id="search_image"> <object class="GtkImage" id="gear_image">
<property name="visible">True</property> <property name="visible">True</property>
<property name="icon_size">1</property> <property name="icon_size">1</property>
<property name="icon_name">edit-find-symbolic</property> <property name="icon_name">emblem-system-symbolic</property>
</object> </object>
</child> </child>
</object> </object>

View file

@ -9,6 +9,10 @@ namespace Gitg.Config
public const string GITG_LOCALEDIR; public const string GITG_LOCALEDIR;
public const string GITG_LIBDIR; public const string GITG_LIBDIR;
public const string VERSION; public const string VERSION;
// temporary check for 3.11 to switch header bar buttons. This check can
// be removed when we bump the gtk+ requirement to 3.12
public const bool GTK_VERSION_AT_LEAST_3_11;
} }
// ex:ts=4 noet // ex:ts=4 noet