Merge lp:~midori/midori/noRocksHere into lp:midori

Proposed by Cris Dywan
Status: Merged
Approved by: André Stösel
Approved revision: 6603
Merged at revision: 6654
Proposed branch: lp:~midori/midori/noRocksHere
Merge into: lp:midori
Diff against target: 113 lines (+0/-60)
2 files modified
midori/midori-completion.vala (+0/-2)
midori/midori-locationaction.c (+0/-58)
To merge this branch: bzr merge lp:~midori/midori/noRocksHere
Reviewer Review Type Date Requested Status
André Stösel Approve
Review via email: mp+211202@code.launchpad.net

Commit message

Drop pseudo Granite distinction in completion layout

To post a comment you must log in.
lp:~midori/midori/noRocksHere updated
6603. By Cris Dywan

Drop another gowan from the completer

Revision history for this message
André Stösel (ivaldi) wrote :

I really like the "new" look!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'midori/midori-completion.vala'
--- midori/midori-completion.vala 2014-02-11 23:01:05 +0000
+++ midori/midori-completion.vala 2014-03-16 12:17:33 +0000
@@ -112,7 +112,6 @@
112 };112 };
113 model.foreach(find_index);113 model.foreach(find_index);
114 int count = 0;114 int count = 0;
115#if HAVE_GRANITE
116 if (completion.description != null) {115 if (completion.description != null) {
117 model.insert_with_values (null, start,116 model.insert_with_values (null, start,
118 Columns.URI, "about:completion-description",117 Columns.URI, "about:completion-description",
@@ -124,7 +123,6 @@
124 Columns.PRIORITY, completion.position);123 Columns.PRIORITY, completion.position);
125 count++;124 count++;
126 }125 }
127#endif
128126
129 foreach (var suggestion in suggestions) {127 foreach (var suggestion in suggestions) {
130 if (suggestion.uri == null) {128 if (suggestion.uri == null) {
131129
=== modified file 'midori/midori-locationaction.c'
--- midori/midori-locationaction.c 2014-02-23 11:30:04 +0000
+++ midori/midori-locationaction.c 2014-03-16 12:17:33 +0000
@@ -360,7 +360,6 @@
360 return desc_title;360 return desc_title;
361}361}
362362
363#ifdef HAVE_GRANITE
364static void363static void
365midori_location_entry_render_title_cb (GtkCellLayout* layout,364midori_location_entry_render_title_cb (GtkCellLayout* layout,
366 GtkCellRenderer* renderer,365 GtkCellRenderer* renderer,
@@ -435,50 +434,6 @@
435 g_free (desc);434 g_free (desc);
436 g_free (title);435 g_free (title);
437}436}
438#else
439static void
440midori_location_entry_render_text_cb (GtkCellLayout* layout,
441 GtkCellRenderer* renderer,
442 GtkTreeModel* model,
443 GtkTreeIter* iter,
444 gpointer data)
445{
446 MidoriLocationAction* action = data;
447 gchar* uri_escaped;
448 gchar* title;
449 gchar* desc;
450
451 gtk_tree_model_get (model, iter,
452 MIDORI_AUTOCOMPLETER_COLUMNS_URI, &uri_escaped,
453 MIDORI_AUTOCOMPLETER_COLUMNS_MARKUP, &title,
454 -1);
455
456 if (strchr (title, '\n')) /* A search engine or action suggestion */
457 {
458 desc = title;
459 g_free (uri_escaped);
460 }
461 else
462 {
463 gchar* key = g_utf8_strdown (action->key ? action->key : "", -1);
464 gchar** keys = g_strsplit_set (key, " %", -1);
465 g_free (key);
466 gchar* desc_uri = midori_location_action_render_uri (keys, uri_escaped);
467 gchar* desc_title = midori_location_action_render_title (keys, title);
468 desc = g_strdup_printf ("%s\n<span color='gray45'>%s</span>", desc_title, desc_uri);
469 g_free (uri_escaped);
470 g_free (title);
471 g_strfreev (keys);
472 g_free (desc_uri);
473 g_free (desc_title);
474 }
475
476 g_object_set (renderer, "markup", desc,
477 "ellipsize-set", TRUE, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
478 g_free (desc);
479}
480#endif
481
482437
483static void438static void
484midori_location_action_popup_position (MidoriLocationAction* action,439midori_location_action_popup_position (MidoriLocationAction* action,
@@ -740,15 +695,10 @@
740 "cell-background", MIDORI_AUTOCOMPLETER_COLUMNS_BACKGROUND,695 "cell-background", MIDORI_AUTOCOMPLETER_COLUMNS_BACKGROUND,
741 NULL);696 NULL);
742 renderer = gtk_cell_renderer_text_new ();697 renderer = gtk_cell_renderer_text_new ();
743 #ifdef HAVE_GRANITE
744 gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (column), renderer, FALSE);698 gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (column), renderer, FALSE);
745 #else
746 gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (column), renderer, TRUE);
747 #endif
748 gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (column), renderer,699 gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (column), renderer,
749 "cell-background", MIDORI_AUTOCOMPLETER_COLUMNS_BACKGROUND,700 "cell-background", MIDORI_AUTOCOMPLETER_COLUMNS_BACKGROUND,
750 NULL);701 NULL);
751 #ifdef HAVE_GRANITE
752 gtk_tree_view_column_set_expand (column, TRUE);702 gtk_tree_view_column_set_expand (column, TRUE);
753 gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (column), renderer,703 gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (column), renderer,
754 midori_location_entry_render_title_cb, action, NULL);704 midori_location_entry_render_title_cb, action, NULL);
@@ -759,14 +709,6 @@
759 "cell-background", MIDORI_AUTOCOMPLETER_COLUMNS_BACKGROUND, NULL);709 "cell-background", MIDORI_AUTOCOMPLETER_COLUMNS_BACKGROUND, NULL);
760 gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (column), renderer,710 gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (column), renderer,
761 midori_location_entry_render_uri_cb, action, NULL);711 midori_location_entry_render_uri_cb, action, NULL);
762 #else
763 gtk_cell_renderer_set_fixed_size (renderer, 1, -1);
764 gtk_cell_renderer_text_set_fixed_height_from_font (
765 GTK_CELL_RENDERER_TEXT (renderer), 2);
766 gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (column), renderer,
767 midori_location_entry_render_text_cb,
768 action, NULL);
769 #endif
770 gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column);712 gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column);
771713
772 action->popup = popup;714 action->popup = popup;

Subscribers

People subscribed via source and target branches

to all changes: