changeset 2916:3ef909ed3056 trunk

fix clearing textbox when short text is displayed
author Tomasz Mon <desowin@gmail.com>
date Fri, 29 Jun 2007 09:57:17 +0200
parents 8d35fb41459f
children e968134f11ed
files src/audacious/ui_skinned_textbox.c
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/ui_skinned_textbox.c	Fri Jun 29 01:50:38 2007 -0500
+++ b/src/audacious/ui_skinned_textbox.c	Fri Jun 29 09:57:17 2007 +0200
@@ -616,7 +616,16 @@
     priv->is_scrollable = FALSE;
 
     priv->is_scrollable = ui_skinned_textbox_should_scroll(textbox);
-    pixmaptext = g_strdup(priv->pixmap_text);
+
+    if (!priv->is_scrollable && !priv->font && length <= wl) {
+        gint pad = wl - length;
+        gchar *padchars = g_strnfill(pad, ' ');
+
+        pixmaptext = g_strconcat(priv->pixmap_text, padchars, NULL);
+        g_free(padchars);
+        length += pad;
+    } else
+        pixmaptext = g_strdup(priv->pixmap_text);
 
     if (priv->is_scrollable) {
         if (priv->scroll_enabled && !priv->scroll_timeout) {