Commit 89ac59fc authored by Andre Miranda's avatar Andre Miranda

Limit popup completion width to be same as entry

parent 460deebe
...@@ -216,6 +216,7 @@ xfce_appfinder_window_init (XfceAppfinderWindow *window) ...@@ -216,6 +216,7 @@ xfce_appfinder_window_init (XfceAppfinderWindow *window)
GtkWidget *bbox; GtkWidget *bbox;
GtkWidget *button; GtkWidget *button;
GtkEntryCompletion *completion; GtkEntryCompletion *completion;
GtkCellRenderer *cell;
gint integer; gint integer;
window->channel = xfconf_channel_get ("xfce4-appfinder"); window->channel = xfconf_channel_get ("xfce4-appfinder");
...@@ -281,10 +282,16 @@ xfce_appfinder_window_init (XfceAppfinderWindow *window) ...@@ -281,10 +282,16 @@ xfce_appfinder_window_init (XfceAppfinderWindow *window)
window->completion = completion = gtk_entry_completion_new (); window->completion = completion = gtk_entry_completion_new ();
gtk_entry_completion_set_model (completion, GTK_TREE_MODEL (window->model)); gtk_entry_completion_set_model (completion, GTK_TREE_MODEL (window->model));
gtk_entry_completion_set_match_func (completion, xfce_appfinder_window_completion_match_func, window, NULL); gtk_entry_completion_set_match_func (completion, xfce_appfinder_window_completion_match_func, window, NULL);
gtk_entry_completion_set_text_column (completion, XFCE_APPFINDER_MODEL_COLUMN_COMMAND); g_object_set (G_OBJECT (completion), "text-column", XFCE_APPFINDER_MODEL_COLUMN_COMMAND, NULL);
gtk_entry_completion_set_popup_single_match (completion, TRUE); gtk_entry_completion_set_popup_single_match (completion, TRUE);
gtk_entry_completion_set_inline_completion (completion, TRUE); gtk_entry_completion_set_inline_completion (completion, TRUE);
cell = gtk_cell_renderer_text_new ();
g_object_set (G_OBJECT (cell), "ellipsize", PANGO_ELLIPSIZE_END, NULL);
gtk_cell_renderer_set_fixed_size (cell, 1, -1);
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (completion), cell, TRUE);
gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (completion), cell, "text", XFCE_APPFINDER_MODEL_COLUMN_COMMAND);
if (xfconf_channel_get_bool (window->channel, "/disable-completion", FALSE)) if (xfconf_channel_get_bool (window->channel, "/disable-completion", FALSE))
gtk_entry_completion_set_popup_completion (completion, FALSE); gtk_entry_completion_set_popup_completion (completion, FALSE);
......
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