[libadwaita/wip/exalm/view-switcher-cleanup] view-switcher-button: Increase natural size for wide mode
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libadwaita/wip/exalm/view-switcher-cleanup] view-switcher-button: Increase natural size for wide mode
- Date: Tue, 31 Aug 2021 15:24:38 +0000 (UTC)
commit c55fd4f6c2fd1482e5caaab3a3029f35557b065e
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Tue Aug 31 20:10:45 2021 +0500
view-switcher-button: Increase natural size for wide mode
src/adw-view-switcher-button.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/adw-view-switcher-button.c b/src/adw-view-switcher-button.c
index 1ba247b2..519e43bd 100644
--- a/src/adw-view-switcher-button.c
+++ b/src/adw-view-switcher-button.c
@@ -25,7 +25,8 @@ enum {
LAST_PROP = PROP_BADGE_NUMBER + 1,
};
-#define MIN_NAT_BUTTON_WIDTH 100
+#define MIN_NAT_BUTTON_WIDTH_NARROW 100
+#define MIN_NAT_BUTTON_WIDTH_WIDE 120
struct _AdwViewSwitcherButton
{
@@ -232,8 +233,13 @@ adw_view_switcher_button_measure (GtkWidget *widget,
gtk_widget_measure (GTK_WIDGET (self->stack), orientation, for_size,
minimum, natural, minimum_baseline, natural_baseline);
- if (orientation == GTK_ORIENTATION_HORIZONTAL)
- *natural = MAX (*natural, MIN_NAT_BUTTON_WIDTH);
+ if (orientation != GTK_ORIENTATION_HORIZONTAL)
+ return;
+
+ if (self->orientation == GTK_ORIENTATION_HORIZONTAL)
+ *natural = MAX (*natural, MIN_NAT_BUTTON_WIDTH_WIDE);
+ else
+ *natural = MAX (*natural, MIN_NAT_BUTTON_WIDTH_NARROW);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]