Merge lp:~lukas-kde/indicator-keyboard/fallbackIconAndTitle into lp:indicator-keyboard

Proposed by Lukáš Tinkl
Status: Merged
Approved by: Charles Kerr
Approved revision: no longer in the source branch.
Merged at revision: 1042
Proposed branch: lp:~lukas-kde/indicator-keyboard/fallbackIconAndTitle
Merge into: lp:indicator-keyboard
Prerequisite: lp:~lukas-kde/indicator-keyboard/launch-uss-under-u8
Diff against target: 80 lines (+22/-6)
3 files modified
lib/main.vala (+7/-0)
lib/source.vala (+2/-1)
po/indicator-keyboard.pot (+13/-5)
To merge this branch: bzr merge lp:~lukas-kde/indicator-keyboard/fallbackIconAndTitle
Reviewer Review Type Date Requested Status
Charles Kerr (community) Approve
Michał Sawicz Approve
Review via email: mp+301910@code.launchpad.net

Commit message

Implement the "title" property and a fallback icon, if no keymap is configured yet

Description of the change

For unity 8, implement the "title" property and a fallback icon, if no keymap is configured yet.

Fixes a too long subtitle text when the panel is expanded and the default ugly "cog" icon.

See https://imgur.com/a/IOqTk for an example of the changes made

To post a comment you must log in.
Revision history for this message
Michał Sawicz (saviq) wrote :

So no fallback for the per-language icons?

review: Needs Information
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

> So no fallback for the per-language icons?

Yup, I can try

As for the -symbolic icon, sure

1045. By Lukáš Tinkl

default to -symbolic

1046. By Lukáš Tinkl

per-keymap fallback icon

Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

Alright, tested this and it works fine in both cases

1047. By Lukáš Tinkl

input-keyboard as the last resort

1048. By Lukáš Tinkl

make update-po

Revision history for this message
Michał Sawicz (saviq) wrote :

Looks fine, thanks!

review: Approve
Revision history for this message
Charles Kerr (charlesk) wrote :

Looks sensible. One suggestion inline for paranoid null checking.

Revision history for this message
Charles Kerr (charlesk) wrote :

Thanks Lukáš!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/main.vala'
2--- lib/main.vala 2016-08-03 17:16:40 +0000
3+++ lib/main.vala 2016-08-03 17:16:40 +0000
4@@ -812,10 +812,17 @@
5 builder.add ("{sv}", "visible", indicator_settings.get_value ("visible"));
6 if (name != null) {
7 var description = _ ("%s input source").printf ((!) name);
8+ builder.add ("{sv}", "title", new Variant.string ((!) name));
9 builder.add ("{sv}", "accessible-desc", new Variant.string (description));
10+ } else {
11+ builder.add ("{sv}", "title", new Variant.string (_("Keyboard Layout")));
12+ builder.add ("{sv}", "accessible-desc", new Variant.string (_("Input source selection")));
13 }
14 if (icon != null) {
15 builder.add ("{sv}", "icon", ((!) icon).serialize ());
16+ } else {
17+ var fallbackIcon = new ThemedIcon.with_default_fallbacks("input-keyboard-symbolic");
18+ builder.add ("{sv}", "icon", fallbackIcon.serialize());
19 }
20
21 get_indicator_action ().set_state (builder.end ());
22
23=== modified file 'lib/source.vala'
24--- lib/source.vala 2015-02-18 16:19:40 +0000
25+++ lib/source.vala 2016-08-03 17:16:40 +0000
26@@ -471,7 +471,8 @@
27 Gtk.IconInfo? icon_info = icon_theme.lookup_icon (icon_name, 22, 0);
28
29 if (icon_info != null) {
30- icon = new ThemedIcon (icon_name);
31+ string [] iconNames = {icon_name, "input-keyboard-symbolic", "input-keyboard"};
32+ icon = new ThemedIcon.from_names (iconNames);
33 }
34 } else {
35 icon = new ThemedIcon (icon_name);
36
37=== modified file 'po/indicator-keyboard.pot'
38--- po/indicator-keyboard.pot 2014-04-04 22:53:34 +0000
39+++ po/indicator-keyboard.pot 2016-08-03 17:16:40 +0000
40@@ -8,7 +8,7 @@
41 msgstr ""
42 "Project-Id-Version: PACKAGE VERSION\n"
43 "Report-Msgid-Bugs-To: \n"
44-"POT-Creation-Date: 2014-04-05 11:53+1300\n"
45+"POT-Creation-Date: 2016-08-03 18:45+0200\n"
46 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
47 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
48 "Language-Team: LANGUAGE <LL@li.org>\n"
49@@ -17,19 +17,27 @@
50 "Content-Type: text/plain; charset=CHARSET\n"
51 "Content-Transfer-Encoding: 8bit\n"
52
53-#: ../lib/main.vala:706
54+#: ../lib/main.vala:814
55 #, c-format
56 msgid "%s input source"
57 msgstr ""
58
59-#: ../lib/indicator-menu.vala:48
60+#: ../lib/main.vala:818
61+msgid "Keyboard Layout"
62+msgstr ""
63+
64+#: ../lib/main.vala:819
65+msgid "Input source selection"
66+msgstr ""
67+
68+#: ../lib/indicator-menu.vala:54
69 msgid "Character Map"
70 msgstr ""
71
72-#: ../lib/indicator-menu.vala:49
73+#: ../lib/indicator-menu.vala:55
74 msgid "Keyboard Layout Chart"
75 msgstr ""
76
77-#: ../lib/indicator-menu.vala:50
78+#: ../lib/indicator-menu.vala:56
79 msgid "Text Entry Settings..."
80 msgstr ""

Subscribers

People subscribed via source and target branches

to all changes: