Verified Commit 01d86c84 authored by Zander Brown's avatar Zander Brown 🔲
Browse files

headerbar: "new" tooltip specific to current panel

This allows translators to probide differing translations for to different contexts

Also answer the question of "New what?"
parent cea01d06
......@@ -136,7 +136,7 @@
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="action_name">win.new</property>
<property name="tooltip-text" translatable="yes">New</property>
<property name="tooltip-text" bind-source="ClocksHeaderBar" bind-property="new-label" bind-flags="sync-create" />
<child>
<object class="GtkImage">
<property name="visible">True</property>
......
......@@ -560,7 +560,7 @@ private class RingingPanel : Gtk.Grid {
if (alarm.state != Item.State.SNOOZING) {
alarm.snooze ();
} else {
// The alarm is already snoozed, simply dismiss the panel.
// The alarm is already snoozed, simply dismiss the panel.
dismiss ();
}
}
......@@ -589,6 +589,8 @@ public class Face : Gtk.Stack, Clocks.Clock {
public bool n_selected { get; set; }
public string title { get; set; default = _("Clocks"); }
public string subtitle { get; set; }
// Translators: Tooltip for the + button
public string new_label { get; default = _("New Alarm"); }
private ContentStore alarms;
private GLib.Settings settings;
......
......@@ -32,6 +32,7 @@ public interface Clocks.Clock : GLib.Object {
public abstract bool n_selected { get; set; }
public abstract string title { get; protected set; }
public abstract string subtitle { get; protected set; }
public abstract string new_label { get; }
public virtual void activate_new () {
}
......
......@@ -114,6 +114,7 @@ public class Clocks.HeaderBar : Hdy.HeaderBar {
public Gtk.Stack stack { get; set; }
public Hdy.ViewSwitcherBar switcher_bar { get; set; }
public uint n_selected { get; set; }
public string new_label { get; set; }
private bool _can_select;
private ViewMode _mode;
......
......@@ -119,6 +119,7 @@ public class Face : Gtk.Box, Clocks.Clock {
public bool n_selected { get; set; }
public string title { get; set; default = _("Clocks"); }
public string subtitle { get; set; }
public string new_label { get; default = null; }
public State state { get; private set; default = State.RESET; }
......
......@@ -78,6 +78,8 @@ public class Face : Gtk.Stack, Clocks.Clock {
public bool n_selected { get; set; }
public string title { get; set; default = _("Clocks"); }
public string subtitle { get; set; }
// Translators: Tooltip for the + button
public string new_label { get; default = _("New Timer"); }
public State state { get; private set; default = State.STOPPED; }
......
......@@ -57,6 +57,7 @@ public class Window : Gtk.ApplicationWindow {
private Binding bind_selected = null;
private Binding bind_title = null;
private Binding bind_subtitle = null;
private Binding bind_new_label = null;
private bool inited = false;
......@@ -364,6 +365,14 @@ public class Window : Gtk.ApplicationWindow {
"subtitle",
SYNC_CREATE);
if (bind_new_label != null) {
bind_new_label.unbind ();
}
bind_new_label = panel.bind_property ("new-label",
header_bar,
"new-label",
SYNC_CREATE);
stack.visible_child.grab_focus ();
}
}
......
......@@ -345,6 +345,8 @@ public class Face : Gtk.Stack, Clocks.Clock {
public bool n_selected { get; set; }
public string title { get; set; default = _("Clocks"); }
public string subtitle { get; set; }
// Translators: Tooltip for the + button
public string new_label { get; default = _("Add Location"); }
private ContentStore locations;
private GLib.Settings settings;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment