Merge lp:~danleweb/midori/bug_lp-1108182 into lp:midori

Proposed by Dan
Status: Merged
Approved by: Cris Dywan
Approved revision: 6790
Merged at revision: 6795
Proposed branch: lp:~danleweb/midori/bug_lp-1108182
Merge into: lp:midori
Diff against target: 90 lines (+26/-1)
2 files modified
midori/midori-browser.c (+1/-0)
midori/midori-locationaction.c (+25/-1)
To merge this branch: bzr merge lp:~danleweb/midori/bug_lp-1108182
Reviewer Review Type Date Requested Status
Cris Dywan Approve
Review via email: mp+232933@code.launchpad.net

Commit message

Set a placeholder text on the URL entry

Description of the change

To post a comment you must log in.
Revision history for this message
Cris Dywan (kalikiana) wrote :

Looks good!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'midori/midori-browser.c'
2--- midori/midori-browser.c 2014-08-31 10:33:28 +0000
3+++ midori/midori-browser.c 2014-09-01 20:01:10 +0000
4@@ -5914,6 +5914,7 @@
5 "label", _("_Location…"),
6 "stock-id", GTK_STOCK_JUMP_TO,
7 "tooltip", _("Open a particular location"),
8+ "placeholder-text", _("Search or enter an address"),
9 NULL);
10 g_object_connect (action,
11 "signal::activate",
12
13=== modified file 'midori/midori-locationaction.c'
14--- midori/midori-locationaction.c 2014-08-10 11:41:32 +0000
15+++ midori/midori-locationaction.c 2014-09-01 20:01:10 +0000
16@@ -40,6 +40,7 @@
17 gdouble progress;
18 gchar* secondary_icon;
19 gchar* tooltip;
20+ gchar* placeholder;
21
22 gchar* key;
23 MidoriAutocompleter* autocompleter;
24@@ -64,7 +65,8 @@
25
26 PROP_PROGRESS,
27 PROP_SECONDARY_ICON,
28- PROP_HISTORY
29+ PROP_HISTORY,
30+ PROP_PLACEHOLDER_TEXT
31 };
32
33 enum
34@@ -251,6 +253,20 @@
35 "The list of history items",
36 KATZE_TYPE_ARRAY,
37 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
38+
39+ /**
40+ * MidoriLocationAction:placeholder-text:
41+ *
42+ * Hint displayed if entry text is empty.
43+ */
44+ g_object_class_install_property (gobject_class,
45+ PROP_PLACEHOLDER_TEXT,
46+ g_param_spec_string (
47+ "placeholder-text",
48+ "Placeholder Text",
49+ "Hint displayed if entry text is empty",
50+ NULL,
51+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
52 }
53
54 gchar*
55@@ -795,6 +811,7 @@
56 katze_assign (location_action->text, NULL);
57 katze_assign (location_action->secondary_icon, NULL);
58 katze_assign (location_action->tooltip, NULL);
59+ katze_assign (location_action->placeholder, NULL);
60 katze_object_assign (location_action->search_engines, NULL);
61 katze_assign (location_action->autocompleter, NULL);
62
63@@ -832,6 +849,9 @@
64 katze_assign (location_action->history, g_value_dup_object (value));
65 break;
66 }
67+ case PROP_PLACEHOLDER_TEXT:
68+ katze_assign (location_action->placeholder, g_strdup(g_value_get_string (value)));
69+ break;
70 default:
71 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
72 break;
73@@ -857,6 +877,9 @@
74 case PROP_HISTORY:
75 g_value_set_object (value, location_action->history);
76 break;
77+ case PROP_PLACEHOLDER_TEXT:
78+ g_value_set_string (value, location_action->placeholder);
79+ break;
80 default:
81 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
82 break;
83@@ -944,6 +967,7 @@
84 midori_location_action_entry_set_secondary_icon (GTK_ENTRY (entry), location_action->secondary_icon);
85 gtk_entry_set_icon_from_gicon (GTK_ENTRY (entry), GTK_ENTRY_ICON_PRIMARY, location_action->icon);
86 gtk_entry_set_icon_tooltip_text (GTK_ENTRY (entry), GTK_ENTRY_ICON_PRIMARY, location_action->tooltip);
87+ gtk_entry_set_placeholder_text(GTK_ENTRY (entry), location_action->placeholder);
88
89 targetlist = gtk_target_list_new (NULL, 0);
90 gtk_target_list_add_uri_targets (targetlist, 0);

Subscribers

People subscribed via source and target branches

to all changes: