[libadwaita/wip/exalm/combo-row: 2/2] combo-row: Fix padding with hidden dropdown arrow
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libadwaita/wip/exalm/combo-row: 2/2] combo-row: Fix padding with hidden dropdown arrow
- Date: Tue, 18 Jan 2022 11:56:17 +0000 (UTC)
commit adbf0631d66c2a17df4f967a4279b3346553fe10
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Tue Jan 18 16:11:40 2022 +0500
combo-row: Fix padding with hidden dropdown arrow
src/adw-combo-row.c | 8 ++++----
src/adw-combo-row.ui | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/adw-combo-row.c b/src/adw-combo-row.c
index 80d9d217..2b541ad7 100644
--- a/src/adw-combo-row.c
+++ b/src/adw-combo-row.c
@@ -53,7 +53,7 @@
typedef struct
{
- GtkImage *image;
+ GtkWidget *arrow_box;
GtkListView *current;
GtkListView *list;
GtkPopover *popover;
@@ -141,7 +141,7 @@ model_changed (AdwComboRow *self)
guint n_items = priv->model ? g_list_model_get_n_items (priv->model) : 0;
gtk_widget_set_sensitive (GTK_WIDGET (self), n_items > 0);
- gtk_widget_set_visible (GTK_WIDGET (priv->image), n_items > 1);
+ gtk_widget_set_visible (priv->arrow_box, n_items > 1);
gtk_list_box_row_set_activatable (GTK_LIST_BOX_ROW (self), n_items > 1);
}
@@ -172,7 +172,7 @@ adw_combo_row_activate (AdwActionRow *row)
AdwComboRow *self = ADW_COMBO_ROW (row);
AdwComboRowPrivate *priv = adw_combo_row_get_instance_private (self);
- if (gtk_widget_get_visible (GTK_WIDGET (priv->image)))
+ if (gtk_widget_get_visible (priv->arrow_box))
gtk_popover_popup (priv->popover);
}
@@ -528,7 +528,7 @@ adw_combo_row_class_init (AdwComboRowClass *klass)
gtk_widget_class_set_template_from_resource (widget_class,
"/org/gnome/Adwaita/ui/adw-combo-row.ui");
gtk_widget_class_bind_template_child_private (widget_class, AdwComboRow, current);
- gtk_widget_class_bind_template_child_private (widget_class, AdwComboRow, image);
+ gtk_widget_class_bind_template_child_private (widget_class, AdwComboRow, arrow_box);
gtk_widget_class_bind_template_child_private (widget_class, AdwComboRow, list);
gtk_widget_class_bind_template_child_private (widget_class, AdwComboRow, popover);
gtk_widget_class_bind_template_callback (widget_class, row_activated_cb);
diff --git a/src/adw-combo-row.ui b/src/adw-combo-row.ui
index 3167f8ac..ae7a4370 100644
--- a/src/adw-combo-row.ui
+++ b/src/adw-combo-row.ui
@@ -17,10 +17,10 @@
</object>
</child>
<child>
- <object class="GtkBox">
+ <object class="GtkBox" id="arrow_box">
<property name="valign">center</property>
<child>
- <object class="GtkImage" id="image">
+ <object class="GtkImage">
<property name="icon_name">pan-down-symbolic</property>
<style>
<class name="dropdown-arrow"/>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]