Don't reserve a column of space the for icons in app chooser button
In order to more consistently present the items regardless of whether they have icons or not.
This commit is contained in:
@ -315,6 +315,7 @@ static void
|
|||||||
gtk_app_chooser_button_build_ui (GtkAppChooserButton *self)
|
gtk_app_chooser_button_build_ui (GtkAppChooserButton *self)
|
||||||
{
|
{
|
||||||
GtkCellRenderer *cell;
|
GtkCellRenderer *cell;
|
||||||
|
GtkCellArea *area;
|
||||||
|
|
||||||
self->priv->store = gtk_list_store_new (NUM_COLUMNS,
|
self->priv->store = gtk_list_store_new (NUM_COLUMNS,
|
||||||
G_TYPE_APP_INFO,
|
G_TYPE_APP_INFO,
|
||||||
@ -327,23 +328,29 @@ gtk_app_chooser_button_build_ui (GtkAppChooserButton *self)
|
|||||||
gtk_combo_box_set_model (GTK_COMBO_BOX (self),
|
gtk_combo_box_set_model (GTK_COMBO_BOX (self),
|
||||||
GTK_TREE_MODEL (self->priv->store));
|
GTK_TREE_MODEL (self->priv->store));
|
||||||
|
|
||||||
|
area = gtk_cell_layout_get_area (GTK_CELL_LAYOUT (self));
|
||||||
|
|
||||||
gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (self),
|
gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (self),
|
||||||
row_separator_func, NULL, NULL);
|
row_separator_func, NULL, NULL);
|
||||||
|
|
||||||
cell = gtk_cell_renderer_pixbuf_new ();
|
cell = gtk_cell_renderer_pixbuf_new ();
|
||||||
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (self), cell, FALSE);
|
gtk_cell_area_add_with_properties (area, cell,
|
||||||
|
"align", FALSE,
|
||||||
|
"expand", FALSE,
|
||||||
|
"fixed-size", FALSE,
|
||||||
|
NULL);
|
||||||
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (self), cell,
|
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (self), cell,
|
||||||
"gicon", COLUMN_ICON,
|
"gicon", COLUMN_ICON,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
cell = gtk_cell_renderer_text_new ();
|
cell = gtk_cell_renderer_text_new ();
|
||||||
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (self), cell, TRUE);
|
gtk_cell_area_add_with_properties (area, cell,
|
||||||
|
"align", FALSE,
|
||||||
|
"expand", TRUE,
|
||||||
|
NULL);
|
||||||
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (self), cell,
|
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (self), cell,
|
||||||
"text", COLUMN_LABEL,
|
"text", COLUMN_LABEL,
|
||||||
NULL);
|
NULL);
|
||||||
g_object_set (cell,
|
|
||||||
"xpad", 6,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
gtk_app_chooser_button_populate (self);
|
gtk_app_chooser_button_populate (self);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user