From 2f20402a327d639a7ff7307b098b1eed17706dfa Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Fri, 06 Jan 2012 02:36:42 +0000 Subject: more consolidation of toolbars for smaller displays --- diff --git a/TurtleArt/tabasics.py b/TurtleArt/tabasics.py index 4ef6db0..8b949da 100644 --- a/TurtleArt/tabasics.py +++ b/TurtleArt/tabasics.py @@ -67,7 +67,7 @@ from gettext import gettext as _ from tapalette import make_palette, define_logo_function from talogo import primitive_dictionary, logoerror from tautils import convert, chr_to_ord, round_int, strtype -from taconstants import BLACK, WHITE, CONSTANTS +from taconstants import BLACK, WHITE, CONSTANTS, XO30 def _num_type(x): """ Is x a number type? """ @@ -350,9 +350,14 @@ start fill block)')) def _color_palette(self): """ The basic Turtle Art color palette """ - palette = make_palette('colors', - colors=["#00FFFF", "#00A0A0"], - help_string=_('Palette of pen colors')) + if self.tw.hw == XO30: + palette = make_palette('pen', + colors=["#00FFFF", "#00A0A0"], + help_string=_('Palette of pen colors')) + else: + palette = make_palette('colors', + colors=["#00FFFF", "#00A0A0"], + help_string=_('Palette of pen colors')) palette.add_block('setcolor', style='basic-style-1arg', diff --git a/TurtleArtActivity.py b/TurtleArtActivity.py index 5b67469..073ca63 100644 --- a/TurtleArtActivity.py +++ b/TurtleArtActivity.py @@ -500,8 +500,6 @@ class TurtleArtActivity(activity.Activity): self._palette_toolbar_button.show() self._toolbox.toolbar.insert(self._palette_toolbar_button, -1) - self._make_project_buttons(self._toolbox.toolbar) - _logger.debug('set_toolbar_box') self.set_toolbar_box(self._toolbox) self._palette_toolbar_button.set_expanded(True) @@ -562,6 +560,10 @@ class TurtleArtActivity(activity.Activity): self._toolbox.set_current_toolbar(1) def _setup_extra_controls(self): + ''' Add the rest of the buttons to the main toolbar ''' + if self.has_toolbarbox: + self._make_project_buttons(self._toolbox.toolbar) + if self.tw.hw in [XO1, XO15, XO175]: self._add_separator(self._toolbox.toolbar, expand=True, visible=False) @@ -655,8 +657,9 @@ class TurtleArtActivity(activity.Activity): 'run-fastoff', _('Run'), self.do_run_cb, toolbar, _('r')) self.step_button = self._add_button( 'run-slowoff', _('Step'), self.do_step_cb, toolbar, _('w')) - self.debug_button = self._add_button( - 'debugoff', _('Debug'), self.do_debug_cb, toolbar, _('d')) + if self.tw.hw not in [XO30]: + self.debug_button = self._add_button( + 'debugoff', _('Debug'), self.do_debug_cb, toolbar, _('d')) self.stop_turtle_button = self._add_button( 'stopitoff', _('Stop turtle'), self.do_stop_cb, toolbar, _('s')) -- cgit v0.9.1