From 75c6a39274ebc534b9abeb97973fb0871261b8d3 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Tue, 25 Mar 2008 20:30:46 +0000 Subject: [PATCH] Increase wrap width for icon labels. --- rox/shell/shell.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rox/shell/shell.py b/rox/shell/shell.py index 1333205..68154b3 100644 --- a/rox/shell/shell.py +++ b/rox/shell/shell.py @@ -8,6 +8,7 @@ from zeroinstall.support import tasks # tmp import _gio as gio import gobject import gtk +import pango from gtk import keysyms import vte import support @@ -36,6 +37,8 @@ def get_default_command(args): FILER_PAGE = 0 TERMINAL_PAGE = 1 +WRAP_WIDTH = 20 # Wrap width in chars (approx) + class ShellView: terminal = None user_seen_terminal_contents = False @@ -74,6 +77,9 @@ class ShellView: text = self.iv.get_cells()[0] self.iv.set_attributes(text, text = DirModel.NAME, foreground = DirModel.COLOUR) + pango_context = self.iv.get_pango_context() + font_metrics = pango_context.get_metrics(self.iv.style.font_desc, pango_context.get_language()) + text.set_property('wrap-width', WRAP_WIDTH * font_metrics.get_approximate_char_width() / pango.SCALE) ui = builder.get_object('uimanager') -- 2.11.4.GIT