Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Silbe <silbe@activitycentral.com>2011-02-25 15:37:54 (GMT)
committer Sascha Silbe <silbe@activitycentral.com>2011-02-25 15:40:13 (GMT)
commitc00ce7ef8c5013a6627a985bd3293f1f36d5b66e (patch)
treeb7f7f6fcd4367905016ca2fe83a931924751a8f5
parent7ae1ce1eec51ba79b96ba34f514116bdfc920b5c (diff)
wrap labels if necessary
-rw-r--r--backup.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/backup.py b/backup.py
index 1ddac29..f38639b 100644
--- a/backup.py
+++ b/backup.py
@@ -83,6 +83,11 @@ def format_size(size):
return _('%4d GiB') % (size // 1024**3)
+def label_size_allocate(widget, rect):
+ """Resize label for proper text wrapping."""
+ widget.set_size_request(rect.width, -1)
+
+
class BackupButton(ToolButton):
def __init__(self, **kwargs):
@@ -583,6 +588,8 @@ class BackupActivity(activity.Activity):
label_text = _('Backing up Journal to %s') % (mount_point, )
label = gtk.Label(label_text.encode('utf-8'))
+ label.set_line_wrap(True)
+ label.connect('size-allocate', label_size_allocate)
label.show()
vbox.pack_start(label)
@@ -596,6 +603,8 @@ class BackupActivity(activity.Activity):
vbox.add(alignment)
self._message_box = gtk.Label()
+ label.set_line_wrap(True)
+ label.connect('size-allocate', label_size_allocate)
vbox.pack_start(self._message_box)
# FIXME