[libadwaita/wip/exalm/message-dialog: 2/3] message-dialog: Use max width instead of min width when there's no parent
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libadwaita/wip/exalm/message-dialog: 2/3] message-dialog: Use max width instead of min width when there's no parent
- Date: Wed, 31 Aug 2022 14:10:49 +0000 (UTC)
commit fa8d110ceac10063de5dec73e968c53f9311b139
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Wed Aug 31 18:02:28 2022 +0400
message-dialog: Use max width instead of min width when there's no parent
While we mever recommend that, we do use it for doc screenshots.
src/adw-message-dialog.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/adw-message-dialog.c b/src/adw-message-dialog.c
index f6c3ea09..b3358fdf 100644
--- a/src/adw-message-dialog.c
+++ b/src/adw-message-dialog.c
@@ -510,8 +510,12 @@ adw_message_dialog_measure (GtkWidget *widget,
min_size = MAX (min_size, DIALOG_MIN_WIDTH);
- max_size = priv->parent_width - DIALOG_MARGIN * 2;
- max_size = MIN (max_size, DIALOG_MAX_WIDTH);
+ if (priv->parent_window) {
+ max_size = priv->parent_width - DIALOG_MARGIN * 2;
+ max_size = MIN (max_size, DIALOG_MAX_WIDTH);
+ } else {
+ max_size = DIALOG_MAX_WIDTH;
+ }
gtk_widget_measure (GTK_WIDGET (priv->wide_response_box),
GTK_ORIENTATION_HORIZONTAL, -1,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]