Add selectable mode button tooltip

https://bugzilla.gnome.org/show_bug.cgi?id=765537
This commit is contained in:
Jesse van den Kieboom 2016-06-05 11:08:57 +02:00
parent 1901580c31
commit 78b3d44c49
3 changed files with 18 additions and 1 deletions

View File

@ -82,6 +82,11 @@ class DashView : Gtk.Grid, GitgExt.UIElement, GitgExt.Activity, GitgExt.Selectab
}
}
public string selectable_mode_tooltip
{
owned get { return _("Select and manage projects"); }
}
public bool has_repositories
{
get { return d_repository_list_box.get_children().length() != 0; }

View File

@ -701,13 +701,23 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
}
var selectable = (current as GitgExt.Selectable);
d_select_button.visible = (selectable != null);
d_selectable_mode_binding = null;
d_selectable_available_binding = null;
if (selectable != null)
{
d_select_button.visible = true;
var tooltip = selectable.selectable_mode_tooltip;
if (tooltip == null)
{
tooltip = _("Select items");
}
d_select_button.tooltip_text = tooltip;
d_selectable_mode_binding = selectable.bind_property("selectable-mode",
this,
"selectable-mode",
@ -721,6 +731,7 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
}
else
{
d_select_button.visible = false;
d_select_button.active = false;
d_select_button.sensitive = false;
}

View File

@ -36,6 +36,7 @@ public interface Selectable : Object, Activity
{
public abstract SelectionMode selectable_mode { get; set; }
public abstract bool selectable_available { get; }
public abstract string selectable_mode_tooltip { owned get; }
public abstract Gtk.Widget? action_widget { owned get; }