brasero r1202 - in trunk: . src
- From: philippr svn gnome org
- To: svn-commits-list gnome org
- Subject: brasero r1202 - in trunk: . src
- Date: Thu, 28 Aug 2008 13:23:46 +0000 (UTC)
Author: philippr
Date: Thu Aug 28 13:23:46 2008
New Revision: 1202
URL: http://svn.gnome.org/viewvc/brasero?rev=1202&view=rev
Log:
Improve size of button in yellow notify zone when the main text is
wrapped
* src/brasero-disc-message.c (brasero_disc_message_add_button),
(brasero_disc_message_add_close_button),
(brasero_disc_message_init):
Modified:
trunk/ChangeLog
trunk/src/brasero-disc-message.c
Modified: trunk/src/brasero-disc-message.c
==============================================================================
--- trunk/src/brasero-disc-message.c (original)
+++ trunk/src/brasero-disc-message.c Thu Aug 28 13:23:46 2008
@@ -284,13 +284,19 @@
GtkResponseType response)
{
GtkWidget *button;
+ PangoLayout *layout;
BraseroDiscMessagePrivate *priv;
priv = BRASERO_DISC_MESSAGE_PRIVATE (self);
button = gtk_button_new_with_mnemonic (text);
- gtk_size_group_add_widget (group, button);
- gtk_size_group_add_widget (priv->group, button);
+
+ /* only add buttons to group if the text is not wrapped. Otherwise
+ * buttons would be too big. */
+ layout = gtk_label_get_layout (priv->primary);
+ if (!pango_layout_is_wrapped (layout))
+ gtk_size_group_add_widget (priv->group, button);
+
gtk_widget_set_tooltip_text (button, tooltip);
gtk_widget_show (button);
g_signal_connect (button,
@@ -312,13 +318,19 @@
brasero_disc_message_add_close_button (BraseroDiscMessage *self)
{
GtkWidget *button;
+ PangoLayout *layout;
GtkWidget *alignment;
BraseroDiscMessagePrivate *priv;
priv = BRASERO_DISC_MESSAGE_PRIVATE (self);
button = gtk_button_new ();
- gtk_size_group_add_widget (priv->group, button);
+
+ /* only add buttons to group if the text is not wrapped. Otherwise
+ * buttons would be too big. */
+ layout = gtk_label_get_layout (priv->primary);
+ if (pango_layout_is_wrapped (layout))
+ gtk_size_group_add_widget (priv->group, button);
alignment = gtk_alignment_new (1.0, 0.0, 0.0, 0.0);
gtk_widget_show (alignment);
@@ -549,11 +561,15 @@
gtk_label_set_line_wrap (GTK_LABEL (priv->primary), TRUE);
gtk_size_group_add_widget (priv->group, priv->primary);
gtk_misc_set_alignment (GTK_MISC (priv->primary), 0.0, 0.5);
- gtk_box_pack_start (GTK_BOX (priv->text_box), priv->primary, FALSE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (priv->text_box), priv->primary, TRUE, TRUE, 0);
priv->button_box = gtk_vbox_new (FALSE, 8);
gtk_widget_show (priv->button_box);
- gtk_box_pack_start (GTK_BOX (main_box), priv->button_box, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (main_box),
+ priv->button_box,
+ FALSE,
+ FALSE,
+ 0);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]