[gnome-control-center] info: Ellipsize the default app choosers



commit dd3c47de27a8cc6a4e01090e41b970132145c460
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Tue Feb 19 13:34:49 2019 +0100

    info: Ellipsize the default app choosers
    
    This allows the Default Applications panel to reach nrrower widths.

 panels/info/cc-info-default-apps-panel.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/panels/info/cc-info-default-apps-panel.c b/panels/info/cc-info-default-apps-panel.c
index 0615d3b95..107c4f6ac 100644
--- a/panels/info/cc-info-default-apps-panel.c
+++ b/panels/info/cc-info-default-apps-panel.c
@@ -137,10 +137,17 @@ info_panel_setup_default_app (CcInfoDefaultAppsPanel *self,
 {
   GtkWidget *button;
   GtkWidget *label;
+  g_autoptr(GList) cells = NULL;
+  GList *cell;
 
   button = gtk_app_chooser_button_new (data->content_type);
   g_object_set_data (G_OBJECT (button), "cc-default-app-data", data);
 
+  cells = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (button));
+  for (cell = cells; cell; cell = cell->next)
+    if (GTK_IS_CELL_RENDERER_TEXT (cell->data))
+      g_object_set (G_OBJECT (cell->data), "ellipsize", PANGO_ELLIPSIZE_END, NULL);
+
   gtk_app_chooser_button_set_show_default_item (GTK_APP_CHOOSER_BUTTON (button), TRUE);
   gtk_grid_attach (GTK_GRID (self->default_apps_grid), button, left_attach, top_attach,
                    1, 1);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]