Bug #700249 - Progress dialog does not wrap
This commit is contained in:
parent
210b073bcd
commit
b5460887fb
13
src/msg.c
13
src/msg.c
@ -149,13 +149,12 @@ zenity_msg (ZenityData *data, ZenityMsgData *msg_data)
|
|||||||
if (data->width > -1 || data->height > -1)
|
if (data->width > -1 || data->height > -1)
|
||||||
gtk_window_set_default_size (GTK_WINDOW (dialog), data->width, data->height);
|
gtk_window_set_default_size (GTK_WINDOW (dialog), data->width, data->height);
|
||||||
|
|
||||||
if (data->width > -1)
|
if (data->width > -1)
|
||||||
gtk_widget_set_size_request (GTK_WIDGET (text), data->width, -1);
|
gtk_widget_set_size_request (GTK_WIDGET (text), data->width, -1);
|
||||||
else
|
else
|
||||||
if (!msg_data->ellipsize)
|
if (!msg_data->ellipsize)
|
||||||
g_signal_connect_after (G_OBJECT (text), "size-allocate",
|
g_signal_connect_after (G_OBJECT (text), "size-allocate",
|
||||||
G_CALLBACK (zenity_text_size_allocate), data);
|
G_CALLBACK (zenity_text_size_allocate), data);
|
||||||
|
|
||||||
|
|
||||||
if (data->modal)
|
if (data->modal)
|
||||||
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
|
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
|
||||||
|
@ -262,6 +262,12 @@ zenity_progress_read_info (ZenityProgressData *progress_data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
zenity_text_size_allocate (GtkWidget *widget, GtkAllocation *allocation, gpointer data)
|
||||||
|
{
|
||||||
|
gtk_widget_set_size_request (widget, allocation->width/2, -1);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
zenity_progress (ZenityData *data, ZenityProgressData *progress_data)
|
zenity_progress (ZenityData *data, ZenityProgressData *progress_data)
|
||||||
{
|
{
|
||||||
@ -281,6 +287,8 @@ zenity_progress (ZenityData *data, ZenityProgressData *progress_data)
|
|||||||
|
|
||||||
gtk_builder_connect_signals (builder, NULL);
|
gtk_builder_connect_signals (builder, NULL);
|
||||||
|
|
||||||
|
text = gtk_builder_get_object (builder, "zenity_progress_text");
|
||||||
|
|
||||||
dialog = GTK_WIDGET (gtk_builder_get_object (builder,
|
dialog = GTK_WIDGET (gtk_builder_get_object (builder,
|
||||||
"zenity_progress_dialog"));
|
"zenity_progress_dialog"));
|
||||||
|
|
||||||
@ -295,6 +303,16 @@ zenity_progress (ZenityData *data, ZenityProgressData *progress_data)
|
|||||||
if (data->width > -1 || data->height > -1)
|
if (data->width > -1 || data->height > -1)
|
||||||
gtk_window_set_default_size (GTK_WINDOW (dialog), data->width, data->height);
|
gtk_window_set_default_size (GTK_WINDOW (dialog), data->width, data->height);
|
||||||
|
|
||||||
|
if (data->width > -1) {
|
||||||
|
gtk_widget_set_size_request (GTK_WIDGET (text), data->width, -1);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
g_signal_connect_after (G_OBJECT (text), "size-allocate",
|
||||||
|
G_CALLBACK (zenity_text_size_allocate), data);
|
||||||
|
g_signal_connect_after (G_OBJECT (progress_bar), "size-allocate",
|
||||||
|
G_CALLBACK (zenity_text_size_allocate), data);
|
||||||
|
}
|
||||||
|
|
||||||
if (data->modal)
|
if (data->modal)
|
||||||
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
|
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
|
||||||
|
|
||||||
@ -312,8 +330,6 @@ zenity_progress (ZenityData *data, ZenityProgressData *progress_data)
|
|||||||
gtk_image_new_from_stock (GTK_STOCK_CANCEL, GTK_ICON_SIZE_BUTTON));
|
gtk_image_new_from_stock (GTK_STOCK_CANCEL, GTK_ICON_SIZE_BUTTON));
|
||||||
}
|
}
|
||||||
|
|
||||||
text = gtk_builder_get_object (builder, "zenity_progress_text");
|
|
||||||
|
|
||||||
if (progress_data->dialog_text)
|
if (progress_data->dialog_text)
|
||||||
gtk_label_set_markup (GTK_LABEL (text), g_strcompress (progress_data->dialog_text));
|
gtk_label_set_markup (GTK_LABEL (text), g_strcompress (progress_data->dialog_text));
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!-- Generated with glade 3.18.3 -->
|
|
||||||
<interface>
|
<interface>
|
||||||
<requires lib="gtk+" version="3.0"/>
|
<!-- interface-requires gtk+ 3.0 -->
|
||||||
|
<!-- interface-naming-policy toplevel-contextual -->
|
||||||
<object class="GtkAdjustment" id="adjustment1">
|
<object class="GtkAdjustment" id="adjustment1">
|
||||||
<property name="upper">100</property>
|
<property name="upper">100</property>
|
||||||
<property name="step_increment">1</property>
|
<property name="step_increment">1</property>
|
||||||
@ -21,7 +21,7 @@
|
|||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<child internal-child="action_area">
|
<child internal-child="action_area">
|
||||||
<object class="GtkVButtonBox" id="dialog-action_area11">
|
<object class="GtkHButtonBox" id="dialog-action_area11">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="layout_style">end</property>
|
<property name="layout_style">end</property>
|
||||||
@ -127,7 +127,7 @@
|
|||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="spacing">2</property>
|
<property name="spacing">2</property>
|
||||||
<child internal-child="action_area">
|
<child internal-child="action_area">
|
||||||
<object class="GtkVButtonBox" id="dialog-action_area5">
|
<object class="GtkHButtonBox" id="dialog-action_area5">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="layout_style">end</property>
|
<property name="layout_style">end</property>
|
||||||
@ -239,7 +239,7 @@
|
|||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="spacing">2</property>
|
<property name="spacing">2</property>
|
||||||
<child internal-child="action_area">
|
<child internal-child="action_area">
|
||||||
<object class="GtkVButtonBox" id="dialog-action_area2">
|
<object class="GtkHButtonBox" id="dialog-action_area2">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="layout_style">end</property>
|
<property name="layout_style">end</property>
|
||||||
@ -370,7 +370,7 @@
|
|||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="spacing">2</property>
|
<property name="spacing">2</property>
|
||||||
<child internal-child="action_area">
|
<child internal-child="action_area">
|
||||||
<object class="GtkVButtonBox" id="dialog-action_area4">
|
<object class="GtkHButtonBox" id="dialog-action_area4">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="layout_style">end</property>
|
<property name="layout_style">end</property>
|
||||||
@ -474,7 +474,7 @@
|
|||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="spacing">14</property>
|
<property name="spacing">14</property>
|
||||||
<child internal-child="action_area">
|
<child internal-child="action_area">
|
||||||
<object class="GtkVButtonBox" id="dialog-action_area7">
|
<object class="GtkHButtonBox" id="dialog-action_area7">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="layout_style">end</property>
|
<property name="layout_style">end</property>
|
||||||
@ -518,7 +518,7 @@
|
|||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="yalign">0</property>
|
<property name="yalign">0</property>
|
||||||
<property name="stock">gtk-dialog-error</property>
|
<property name="stock">gtk-dialog-error</property>
|
||||||
<property name="icon_size">6</property>
|
<property name="icon-size">6</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">True</property>
|
<property name="expand">True</property>
|
||||||
@ -571,7 +571,7 @@
|
|||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="spacing">2</property>
|
<property name="spacing">2</property>
|
||||||
<child internal-child="action_area">
|
<child internal-child="action_area">
|
||||||
<object class="GtkVButtonBox" id="dialog-action_area12">
|
<object class="GtkHButtonBox" id="dialog-action_area12">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="layout_style">end</property>
|
<property name="layout_style">end</property>
|
||||||
@ -666,6 +666,12 @@
|
|||||||
<child>
|
<child>
|
||||||
<placeholder/>
|
<placeholder/>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
@ -707,7 +713,7 @@
|
|||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="spacing">14</property>
|
<property name="spacing">14</property>
|
||||||
<child internal-child="action_area">
|
<child internal-child="action_area">
|
||||||
<object class="GtkVButtonBox" id="dialog-action_area3">
|
<object class="GtkHButtonBox" id="dialog-action_area3">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="layout_style">end</property>
|
<property name="layout_style">end</property>
|
||||||
@ -746,7 +752,7 @@
|
|||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="yalign">0</property>
|
<property name="yalign">0</property>
|
||||||
<property name="stock">gtk-dialog-info</property>
|
<property name="stock">gtk-dialog-info</property>
|
||||||
<property name="icon_size">6</property>
|
<property name="icon-size">6</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">True</property>
|
<property name="expand">True</property>
|
||||||
@ -795,7 +801,7 @@
|
|||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="spacing">2</property>
|
<property name="spacing">2</property>
|
||||||
<child internal-child="action_area">
|
<child internal-child="action_area">
|
||||||
<object class="GtkVButtonBox" id="dialog-action_area6">
|
<object class="GtkHButtonBox" id="dialog-action_area6">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="layout_style">end</property>
|
<property name="layout_style">end</property>
|
||||||
@ -851,6 +857,7 @@
|
|||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="xalign">0</property>
|
<property name="xalign">0</property>
|
||||||
<property name="label" translatable="yes">Running...</property>
|
<property name="label" translatable="yes">Running...</property>
|
||||||
|
<property name="wrap">True</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
@ -885,7 +892,7 @@
|
|||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
<property name="fill">True</property>
|
<property name="fill">False</property>
|
||||||
<property name="position">1</property>
|
<property name="position">1</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
@ -909,7 +916,7 @@
|
|||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="spacing">14</property>
|
<property name="spacing">14</property>
|
||||||
<child internal-child="action_area">
|
<child internal-child="action_area">
|
||||||
<object class="GtkVButtonBox" id="zenity_question_button_box">
|
<object class="GtkHButtonBox" id="zenity_question_button_box">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="layout_style">end</property>
|
<property name="layout_style">end</property>
|
||||||
@ -934,7 +941,7 @@
|
|||||||
<property name="xalign">0</property>
|
<property name="xalign">0</property>
|
||||||
<property name="yalign">0</property>
|
<property name="yalign">0</property>
|
||||||
<property name="stock">gtk-dialog-question</property>
|
<property name="stock">gtk-dialog-question</property>
|
||||||
<property name="icon_size">6</property>
|
<property name="icon-size">6</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
@ -981,7 +988,7 @@
|
|||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<child internal-child="action_area">
|
<child internal-child="action_area">
|
||||||
<object class="GtkVButtonBox" id="dialog-action_area8">
|
<object class="GtkHButtonBox" id="dialog-action_area8">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="layout_style">end</property>
|
<property name="layout_style">end</property>
|
||||||
@ -1047,15 +1054,11 @@
|
|||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="shadow_type">in</property>
|
<property name="shadow_type">in</property>
|
||||||
<property name="expand">True</property>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkTreeView" id="zenity_tree_view">
|
<object class="GtkTreeView" id="zenity_tree_view">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="has_focus">True</property>
|
<property name="has_focus">True</property>
|
||||||
<child internal-child="selection">
|
|
||||||
<object class="GtkTreeSelection" id="treeview-selection1"/>
|
|
||||||
</child>
|
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
@ -1092,7 +1095,7 @@
|
|||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="spacing">14</property>
|
<property name="spacing">14</property>
|
||||||
<child internal-child="action_area">
|
<child internal-child="action_area">
|
||||||
<object class="GtkVButtonBox" id="dialog-action_area1">
|
<object class="GtkHButtonBox" id="dialog-action_area1">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="layout_style">end</property>
|
<property name="layout_style">end</property>
|
||||||
@ -1133,7 +1136,7 @@
|
|||||||
<property name="xalign">0</property>
|
<property name="xalign">0</property>
|
||||||
<property name="yalign">0</property>
|
<property name="yalign">0</property>
|
||||||
<property name="stock">gtk-dialog-warning</property>
|
<property name="stock">gtk-dialog-warning</property>
|
||||||
<property name="icon_size">6</property>
|
<property name="icon-size">6</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
|
Reference in New Issue
Block a user