|
|
be4a84 |
From 4f1e06a69e42ce8dc56f2101b98e1a1021fd324d Mon Sep 17 00:00:00 2001
|
|
|
be4a84 |
From: David King <amigadave@amigadave.com>
|
|
|
be4a84 |
Date: Mon, 25 Apr 2022 13:42:41 +0100
|
|
|
be4a84 |
Subject: [PATCH 1/2] msg: Fix maximum width to 60 characters
|
|
|
be4a84 |
|
|
|
be4a84 |
Commit 3b64d05e8a1aae1581d2bec7288d80ac4699e1b1 mentioned that labels in
|
|
|
be4a84 |
message dialogs were set to a maximum width of 60 characters, with
|
|
|
be4a84 |
inspiration from GtkMessageDialog, but in fact a typo meant that they
|
|
|
be4a84 |
were set to both a width and maximum width of just 10 characters. This
|
|
|
be4a84 |
lead to text layout problems, which can be fixed by using the intended
|
|
|
be4a84 |
maximum of 60 characters.
|
|
|
be4a84 |
|
|
|
be4a84 |
https://bugzilla.redhat.com/show_bug.cgi?id=2053530
|
|
|
be4a84 |
---
|
|
|
be4a84 |
src/msg.c | 10 ++++------
|
|
|
be4a84 |
1 file changed, 4 insertions(+), 6 deletions(-)
|
|
|
be4a84 |
|
|
|
be4a84 |
diff --git a/src/msg.c b/src/msg.c
|
|
|
be4a84 |
index ca14d86..9265152 100644
|
|
|
be4a84 |
--- a/src/msg.c
|
|
|
be4a84 |
+++ b/src/msg.c
|
|
|
be4a84 |
@@ -202,12 +202,10 @@ zenity_msg (ZenityData *data, ZenityMsgData *msg_data) {
|
|
|
be4a84 |
if (data->width > -1)
|
|
|
be4a84 |
gtk_widget_set_size_request (GTK_WIDGET (text), data->width, -1);
|
|
|
be4a84 |
else if (!msg_data->ellipsize && !msg_data->no_wrap) {
|
|
|
be4a84 |
- // the magic number 60 is picked from gtk+/gtk/ui/gtkmessagedialog.ui
|
|
|
be4a84 |
- // however, 60 would increase the distance between the icon and the
|
|
|
be4a84 |
- // text,
|
|
|
be4a84 |
- // decreasing to 10 fix it.
|
|
|
be4a84 |
- gtk_label_set_width_chars (text, 10);
|
|
|
be4a84 |
- gtk_label_set_max_width_chars (text, 10);
|
|
|
be4a84 |
+ /* The magic number 60 is taken from gtk+/gtk/ui/gtkmessagedialog.ui
|
|
|
be4a84 |
+ with 10 as a minimum width. */
|
|
|
be4a84 |
+ gtk_label_set_width_chars (GTK_LABEL (text), 10);
|
|
|
be4a84 |
+ gtk_label_set_max_width_chars (GTK_LABEL (text), 60);
|
|
|
be4a84 |
}
|
|
|
be4a84 |
|
|
|
be4a84 |
if (data->modal)
|
|
|
be4a84 |
--
|
|
|
be4a84 |
2.36.1
|
|
|
be4a84 |
|
|
|
be4a84 |
|
|
|
be4a84 |
From 28f865111bb890a7af06a7767f16f2502aa2f213 Mon Sep 17 00:00:00 2001
|
|
|
be4a84 |
From: David King <amigadave@amigadave.com>
|
|
|
be4a84 |
Date: Tue, 26 Apr 2022 08:18:18 +0100
|
|
|
be4a84 |
Subject: [PATCH 2/2] zenity.ui: make message dialogs non-resizable
|
|
|
be4a84 |
|
|
|
be4a84 |
Use the approach of GtkMessageDialog, to avoid problems with narrow
|
|
|
be4a84 |
labels when the dialog text is long.
|
|
|
be4a84 |
---
|
|
|
be4a84 |
src/zenity.ui | 4 ++++
|
|
|
be4a84 |
1 file changed, 4 insertions(+)
|
|
|
be4a84 |
|
|
|
be4a84 |
diff --git a/src/zenity.ui b/src/zenity.ui
|
|
|
be4a84 |
index 1359442..546a622 100644
|
|
|
be4a84 |
--- a/src/zenity.ui
|
|
|
be4a84 |
+++ b/src/zenity.ui
|
|
|
be4a84 |
@@ -465,6 +465,7 @@
|
|
|
be4a84 |
<property name="title" translatable="yes">Error</property>
|
|
|
be4a84 |
<property name="window_position">center</property>
|
|
|
be4a84 |
<property name="type_hint">dialog</property>
|
|
|
be4a84 |
+ <property name="resizable">false</property>
|
|
|
be4a84 |
<signal name="destroy" handler="gtk_main_quit" swapped="no"/>
|
|
|
be4a84 |
<child internal-child="vbox">
|
|
|
be4a84 |
<object class="GtkBox" id="dialog-vbox7">
|
|
|
be4a84 |
@@ -681,6 +682,7 @@
|
|
|
be4a84 |
<property name="title" translatable="yes">Information</property>
|
|
|
be4a84 |
<property name="window_position">center</property>
|
|
|
be4a84 |
<property name="type_hint">dialog</property>
|
|
|
be4a84 |
+ <property name="resizable">false</property>
|
|
|
be4a84 |
<signal name="destroy" handler="gtk_main_quit" swapped="no"/>
|
|
|
be4a84 |
<child internal-child="vbox">
|
|
|
be4a84 |
<object class="GtkBox" id="dialog-vbox9">
|
|
|
be4a84 |
@@ -882,6 +884,7 @@
|
|
|
be4a84 |
<property name="title" translatable="yes">Question</property>
|
|
|
be4a84 |
<property name="window_position">center</property>
|
|
|
be4a84 |
<property name="type_hint">dialog</property>
|
|
|
be4a84 |
+ <property name="resizable">false</property>
|
|
|
be4a84 |
<signal name="destroy" handler="gtk_main_quit" swapped="no"/>
|
|
|
be4a84 |
<child internal-child="vbox">
|
|
|
be4a84 |
<object class="GtkBox" id="dialog-vbox3">
|
|
|
be4a84 |
@@ -1064,6 +1067,7 @@
|
|
|
be4a84 |
<property name="title" translatable="yes">Warning</property>
|
|
|
be4a84 |
<property name="window_position">center</property>
|
|
|
be4a84 |
<property name="type_hint">dialog</property>
|
|
|
be4a84 |
+ <property name="resizable">false</property>
|
|
|
be4a84 |
<signal name="destroy" handler="gtk_main_quit" swapped="no"/>
|
|
|
be4a84 |
<child internal-child="vbox">
|
|
|
be4a84 |
<object class="GtkBox" id="dialog-vbox1">
|
|
|
be4a84 |
--
|
|
|
be4a84 |
2.36.1
|
|
|
be4a84 |
|