diff --git a/NEWS b/NEWS index 4af53309..c2206648 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ +* #1825: Fix tab label padding. (marco) * #1823: Margin at the toolbar tabs bottom. (marco) * #1872, #1934: Hide palettes when closing activities or switching views. (tomeu) diff --git a/sugar/graphics/style.py b/sugar/graphics/style.py index cab2cbd9..b26ca56c 100644 --- a/sugar/graphics/style.py +++ b/sugar/graphics/style.py @@ -43,6 +43,7 @@ class Font(object): return pango.FontDescription(self._desc) _FOCUS_LINE_WIDTH = 2 +_TAB_CURVATURE = 1 ZOOM_FACTOR = _compute_zoom_factor() @@ -53,3 +54,5 @@ FONT_BOLD = Font('Bitstream Vera Sans bold %d' % FONT_SIZE) TOOLBOX_SEPARATOR_HEIGHT = _zoom(9) TOOLBOX_HORIZONTAL_PADDING = _zoom(75) TOOLBOX_TAB_VBORDER = int((_zoom(36) - FONT_SIZE - _FOCUS_LINE_WIDTH) / 2) +TOOLBOX_TAB_HBORDER = _zoom(15) - _FOCUS_LINE_WIDTH - _TAB_CURVATURE +TOOLBOX_TAB_LABEL_WIDTH = _zoom(150 - 15 * 2) diff --git a/sugar/graphics/toolbox.py b/sugar/graphics/toolbox.py index 34109c00..c24f4f07 100644 --- a/sugar/graphics/toolbox.py +++ b/sugar/graphics/toolbox.py @@ -21,8 +21,6 @@ import gobject from sugar.graphics.toolbutton import ToolButton from sugar.graphics import style -_N_TABS = 8 - class Toolbox(gtk.VBox): __gtype_name__ = 'SugarToolbox' @@ -40,6 +38,7 @@ class Toolbox(gtk.VBox): self._notebook.set_show_border(False) self._notebook.set_show_tabs(False) self._notebook.props.tab_vborder = style.TOOLBOX_TAB_VBORDER + self._notebook.props.tab_hborder = style.TOOLBOX_TAB_HBORDER self.pack_start(self._notebook) self._notebook.show() @@ -65,7 +64,7 @@ class Toolbox(gtk.VBox): def add_toolbar(self, name, toolbar): label = gtk.Label(name) - label.set_size_request(gtk.gdk.screen_width() / _N_TABS, -1) + label.set_size_request(style.TOOLBOX_TAB_LABEL_WIDTH, -1) label.set_alignment(0.0, 0.5) toolbar_box = gtk.HBox()