Merge lp:~midori/midori/toolbarImprovements into lp:midori

Proposed by Cris Dywan
Status: Merged
Approved by: Paweł Forysiuk
Approved revision: 6600
Merged at revision: 6624
Proposed branch: lp:~midori/midori/toolbarImprovements
Merge into: lp:midori
Diff against target: 131 lines (+30/-13)
3 files modified
extensions/toolbar-editor.c (+0/-5)
midori/midori-browser.c (+1/-1)
midori/midori-locationaction.c (+29/-7)
To merge this branch: bzr merge lp:~midori/midori/toolbarImprovements
Reviewer Review Type Date Requested Status
Paweł Forysiuk Approve
Review via email: mp+211182@code.launchpad.net

Commit message

Correctly apply saved entry state and treat urlbar as a regular editable item

To post a comment you must log in.
6600. By Paweł Forysiuk

Drop actions that dont have assiociated icons for now

Revision history for this message
Paweł Forysiuk (tuxator) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'extensions/toolbar-editor.c'
2--- extensions/toolbar-editor.c 2014-03-03 22:11:32 +0000
3+++ extensions/toolbar-editor.c 2014-03-25 00:34:42 +0000
4@@ -181,7 +181,6 @@
5 if (gtk_tree_selection_get_selected(selection_used, &model_used, &iter_used))
6 {
7 gtk_tree_model_get(model_used, &iter_used, TB_EDITOR_COL_ACTION, &action_name, -1);
8- if (g_strcmp0(action_name, "Location") != 0)
9 {
10 if (gtk_list_store_remove(tbw->store_used, &iter_used))
11 gtk_tree_selection_select_iter(selection_used, &iter_used);
12@@ -290,10 +289,6 @@
13
14 text = (gchar*) gtk_selection_data_get_data (data);
15
16- /* We allow re-ordering the Location item but not removing it from the list. */
17- if (g_strcmp0(text, "Location") == 0 && widget != tbw->drag_source)
18- return;
19-
20 is_sep = (g_strcmp0(text, "Separator") == 0);
21 /* If the source of the action is equal to the target, we do just re-order and so need
22 * to delete the separator to get it moved, not just copied. */
23
24=== modified file 'midori/midori-browser.c'
25--- midori/midori-browser.c 2014-03-16 22:37:47 +0000
26+++ midori/midori-browser.c 2014-03-25 00:34:42 +0000
27@@ -2970,7 +2970,7 @@
28 static const gchar* actions[] = {
29 "WindowNew", "TabNew", "Open", "SaveAs", "Print", "Find",
30 "Fullscreen", "Preferences", "Window", "Bookmarks",
31- "ReloadStop", "ZoomIn", "TabClose", "NextForward",
32+ "ReloadStop", "ZoomIn", "TabClose", "NextForward", "Location",
33 "ZoomOut", "Separator", "Back", "Forward", "Homepage",
34 "Panel", "Trash", "Search", "BookmarkAdd", "Previous", "Next", NULL };
35
36
37=== modified file 'midori/midori-locationaction.c'
38--- midori/midori-locationaction.c 2014-03-21 06:26:51 +0000
39+++ midori/midori-locationaction.c 2014-03-25 00:34:42 +0000
40@@ -34,10 +34,12 @@
41 {
42 GtkAction parent_instance;
43
44+ GIcon* icon;
45 gchar* text;
46 KatzeArray* search_engines;
47 gdouble progress;
48 gchar* secondary_icon;
49+ gchar* tooltip;
50
51 gchar* key;
52 MidoriAutocompleter* autocompleter;
53@@ -842,7 +844,10 @@
54 {
55 MidoriLocationAction* location_action = MIDORI_LOCATION_ACTION (object);
56
57+ katze_object_assign (location_action->icon, NULL);
58 katze_assign (location_action->text, NULL);
59+ katze_assign (location_action->secondary_icon, NULL);
60+ katze_assign (location_action->tooltip, NULL);
61 katze_object_assign (location_action->search_engines, NULL);
62 katze_assign (location_action->autocompleter, NULL);
63
64@@ -950,9 +955,21 @@
65 }
66 }
67
68+static void
69+midori_location_action_entry_set_secondary_icon (GtkEntry* entry,
70+ const gchar* stock_id)
71+{
72+ GtkStockItem stock_item;
73+ if (stock_id && gtk_stock_lookup (stock_id, &stock_item))
74+ gtk_entry_set_icon_from_stock (entry, GTK_ENTRY_ICON_SECONDARY, stock_id);
75+ else
76+ gtk_entry_set_icon_from_icon_name (entry, GTK_ENTRY_ICON_SECONDARY, stock_id);
77+}
78+
79 static GtkWidget*
80 midori_location_action_create_tool_item (GtkAction* action)
81 {
82+ MidoriLocationAction* location_action = MIDORI_LOCATION_ACTION (action);
83 GtkWidget* toolitem;
84 GtkWidget* alignment;
85 GtkWidget* entry;
86@@ -975,6 +992,12 @@
87 gtk_entry_set_icon_activatable (GTK_ENTRY (entry),
88 GTK_ENTRY_ICON_SECONDARY, TRUE);
89
90+ if (location_action->text != NULL)
91+ gtk_entry_set_text (GTK_ENTRY (entry), location_action->text);
92+ midori_location_action_entry_set_secondary_icon (GTK_ENTRY (entry), location_action->secondary_icon);
93+ gtk_entry_set_icon_from_gicon (GTK_ENTRY (entry), GTK_ENTRY_ICON_PRIMARY, location_action->icon);
94+ gtk_entry_set_icon_tooltip_text (GTK_ENTRY (entry), GTK_ENTRY_ICON_PRIMARY, location_action->tooltip);
95+
96 targetlist = gtk_target_list_new (NULL, 0);
97 gtk_target_list_add_uri_targets (targetlist, 0);
98 gtk_entry_set_icon_drag_source (GTK_ENTRY (entry), GTK_ENTRY_ICON_PRIMARY, targetlist, GDK_ACTION_ASK | GDK_ACTION_COPY | GDK_ACTION_LINK);
99@@ -1755,7 +1778,6 @@
100 const gchar* stock_id)
101 {
102 GSList* proxies;
103- GtkStockItem stock_item;
104
105 g_return_if_fail (MIDORI_IS_LOCATION_ACTION (location_action));
106
107@@ -1767,12 +1789,7 @@
108 if (GTK_IS_TOOL_ITEM (proxies->data))
109 {
110 GtkWidget* entry = midori_location_action_entry_for_proxy (proxies->data);
111- if (stock_id && gtk_stock_lookup (stock_id, &stock_item))
112- gtk_entry_set_icon_from_stock (GTK_ENTRY (entry),
113- GTK_ENTRY_ICON_SECONDARY, stock_id);
114- else
115- gtk_entry_set_icon_from_icon_name (GTK_ENTRY (entry),
116- GTK_ENTRY_ICON_SECONDARY, stock_id);
117+ midori_location_action_entry_set_secondary_icon (GTK_ENTRY (entry), stock_id);
118 }
119 }
120
121@@ -1794,6 +1811,11 @@
122 GSList* proxies;
123
124 g_return_if_fail (MIDORI_IS_LOCATION_ACTION (location_action));
125+ g_return_if_fail (G_IS_ICON (icon));
126+ g_return_if_fail (tooltip != NULL);
127+
128+ katze_object_assign (location_action->icon, g_object_ref (icon));
129+ katze_assign (location_action->tooltip, g_strdup (tooltip));
130
131 proxies = gtk_action_get_proxies (GTK_ACTION (location_action));
132

Subscribers

People subscribed via source and target branches

to all changes: