[gitg/wip/headerbar] Show or hide buttons depending on mode
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg/wip/headerbar] Show or hide buttons depending on mode
- Date: Sat, 6 Jul 2013 19:47:39 +0000 (UTC)
commit 77c04c0ed7903f251a04ea9e0ae30977f15c1bc9
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Sat Jul 6 21:27:56 2013 +0200
Show or hide buttons depending on mode
gitg/gitg-header-bar.vala | 17 +++++++++++++++++
gitg/resources/ui/gitg-header-bar.ui | 8 +-------
2 files changed, 18 insertions(+), 7 deletions(-)
---
diff --git a/gitg/gitg-header-bar.vala b/gitg/gitg-header-bar.vala
index b880711..8072d8f 100644
--- a/gitg/gitg-header-bar.vala
+++ b/gitg/gitg-header-bar.vala
@@ -38,6 +38,11 @@ public class HeaderBar : Gtk.HeaderBar
[GtkChild]
private Gtk.StackSwitcher d_activities_switcher;
+ [GtkChild]
+ private Gtk.Separator d_close_button_separator;
+ [GtkChild]
+ private Gtk.Button d_close_button;
+
public signal void request_dash();
public enum Mode
@@ -58,10 +63,22 @@ public class HeaderBar : Gtk.HeaderBar
if (d_mode == Mode.COMMIT)
{
get_style_context().add_class("selection-mode");
+
+ d_gear_menu.hide();
+ d_dash_button.hide();
+ d_search_button.hide();
+ d_activities_switcher.hide();
+ d_close_button_separator.hide();
+ d_close_button.hide();
}
else
{
get_style_context().remove_class("selection-mode");
+
+ d_gear_menu.show();
+ d_search_button.show();
+ d_close_button_separator.show();
+ d_close_button.show();
}
if (d_mode == Mode.DASH)
diff --git a/gitg/resources/ui/gitg-header-bar.ui b/gitg/resources/ui/gitg-header-bar.ui
index d75eec2..cb34fc8 100644
--- a/gitg/resources/ui/gitg-header-bar.ui
+++ b/gitg/resources/ui/gitg-header-bar.ui
@@ -3,7 +3,6 @@
<template class="GitgHeaderBar" parent="Gtk.HeaderBar">
<child>
<object class="GtkButton" id="d_dash_button">
- <property name="visible">False</property>
<property name="valign">center</property>
<property name="can_focus">False</property>
<signal name="clicked" handler="dash_button_clicked" swapped="no"/>
@@ -24,7 +23,6 @@
</child>
<child>
<object class="GtkToggleButton" id="d_search_button">
- <property name="visible">True</property>
<property name="valign">center</property>
<property name="can_focus">False</property>
<property name="action_name">win.search</property>
@@ -45,7 +43,6 @@
</child>
<child>
<object class="GtkStackSwitcher" id="d_activities_switcher">
- <property name="visible">False</property>
</object>
<packing>
<property name="pack_type">end</property>
@@ -53,7 +50,6 @@
</child>
<child>
<object class="GtkMenuButton" id="d_gear_menu">
- <property name="visible">True</property>
<property name="valign">center</property>
<property name="can_focus">False</property>
<property name="action_name">win.gear-menu</property>
@@ -73,8 +69,7 @@
</packing>
</child>
<child>
- <object class="GtkSeparator" id="close_button_separator">
- <property name="visible">True</property>
+ <object class="GtkSeparator" id="d_close_button_separator">
<property name="orientation">vertical</property>
<property name="valign">fill</property>
</object>
@@ -84,7 +79,6 @@
</child>
<child>
<object class="GtkButton" id="d_close_button">
- <property name="visible">True</property>
<property name="valign">center</property>
<property name="relief">none</property>
<signal name="clicked" handler="close_button_clicked" swapped="no"/>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]