diff --git a/po/de_pysol.po b/po/de_pysol.po index 904c32e1..962266ab 100644 --- a/po/de_pysol.po +++ b/po/de_pysol.po @@ -2905,7 +2905,7 @@ msgstr "Markieren und Ziel klicken" #: pysollib/kivy/menubar.py:1003 pysollib/tile/toolbar.py:202 #: pysollib/tk/toolbar.py:211 msgid "Toolbar" -msgstr "Toolbar" +msgstr "Werkzeugleiste" #: pysollib/kivy/menubar.py:1006 pysollib/ui/tktile/menubar.py:41 msgid "Hide" @@ -4860,15 +4860,15 @@ msgstr "" #: pysollib/ui/tktile/menubar.py:44 msgid "Top" -msgstr "" +msgstr "Oben" #: pysollib/ui/tktile/menubar.py:47 msgid "Bottom" -msgstr "" +msgstr "Unten" #: pysollib/ui/tktile/menubar.py:64 msgid "Visible buttons" -msgstr "" +msgstr "Verfügbare Symbole" #: pysollib/ui/tktile/menubar.py:296 #, python-format diff --git a/pysollib/kivy/LApp.py b/pysollib/kivy/LApp.py index b6651ddb..10e87abd 100644 --- a/pysollib/kivy/LApp.py +++ b/pysollib/kivy/LApp.py @@ -1595,6 +1595,7 @@ class LMainWindow(BoxLayout, LTkBase): self.menuArea = LMenuBar() self.workContainer = LBoxLayout(orientation='horizontal') self.workContainerO = LBoxLayout(orientation='horizontal') + self.workContainer1 = LBoxLayout(orientation='vertical') self.workArea = None self.toolBar = None self.toolBarPos = 0 @@ -1732,13 +1733,22 @@ class LMainWindow(BoxLayout, LTkBase): def removeContainer(self): self.workContainer.clear_widgets() self.workContainerO.clear_widgets() + self.workContainer1.clear_widgets() def buildContainer(self): + # (hbox) if self.toolBar is not None and self.toolBarPos == 3: self.workContainerO.add_widget(self.toolBar) - self.workContainerO.add_widget(self.workContainer) + self.workContainerO.add_widget(self.workContainer1) if self.toolBar is not None and self.toolBarPos == 4: self.workContainerO.add_widget(self.toolBar) + # (vbox) + if self.toolBar is not None and self.toolBarPos == 1: + self.workContainer1.add_widget(self.toolBar) + self.workContainer1.add_widget(self.workContainer) + if self.toolBar is not None and self.toolBarPos == 2: + self.workContainer1.add_widget(self.toolBar) + # (workcontainer) for w in self.workStack.items: self.workContainer.add_widget(w[1]) diff --git a/pysollib/kivy/menubar.py b/pysollib/kivy/menubar.py index 325706fb..bd265d50 100644 --- a/pysollib/kivy/menubar.py +++ b/pysollib/kivy/menubar.py @@ -1109,17 +1109,14 @@ class OptionsMenuDialog(LMenuDialog): self.menubar.tkopt.toolbar, 0, self.menubar.mOptToolbar) - # not supported: Top, Bottom - # self.addRadioNode(tv, rg, - # 'Top', - # self.menubar.tkopt.toolbar, 1, - # self.menubar.mOptToolbar) - - # self.addRadioNode(tv, rg, - # _('Bottom'), - # self.menubar.tkopt.toolbar, 2, - # self.menubar.mOptToolbar) - + self.addRadioNode(tv, rg, + _('Top'), + self.menubar.tkopt.toolbar, 1, + self.menubar.mOptToolbar) + self.addRadioNode(tv, rg, + _('Bottom'), + self.menubar.tkopt.toolbar, 2, + self.menubar.mOptToolbar) self.addRadioNode(tv, rg, _('Left'), self.menubar.tkopt.toolbar, 3, @@ -1130,13 +1127,13 @@ class OptionsMenuDialog(LMenuDialog): self.menubar.mOptToolbar) rg1 = tv.add_node( - LTreeNode(text=_('Buttons:')), rg) + LTreeNode(text=_('Visible buttons')), rg) if rg1: for w in TOOLBAR_BUTTONS: - ww = w - ww[0].upper() + w0 = w[0].upper() + ww = w[1:] self.addCheckNode(tv, rg, - _(ww), # noqa + _(w0+ww), # noqa self.menubar.tkopt.toolbar_vars[w], self.make_vars_command(self.menubar.mOptToolbarConfig, w)) # noqa diff --git a/pysollib/kivy/tkcanvas.py b/pysollib/kivy/tkcanvas.py index bdc1bc98..8c8c4cfb 100644 --- a/pysollib/kivy/tkcanvas.py +++ b/pysollib/kivy/tkcanvas.py @@ -808,6 +808,7 @@ class MfxCanvas(Widget): def showAllItems(self): print('MfxCanvas: showAllItems') # TBD + # Brauchts darum auch nicht. pass # Erweiterungen fuer Tk Canvas (prüfen was noch nötig!!). diff --git a/pysollib/kivy/toolbar.py b/pysollib/kivy/toolbar.py index 06305acd..50527a91 100644 --- a/pysollib/kivy/toolbar.py +++ b/pysollib/kivy/toolbar.py @@ -23,6 +23,7 @@ import os from kivy.cache import Cache from kivy.clock import Clock +from kivy.core.window import Window from kivy.properties import BooleanProperty from kivy.uix.behaviors import ButtonBehavior from kivy.uix.boxlayout import BoxLayout @@ -308,11 +309,31 @@ class PysolToolbarTk(BoxLayout): opt.bind(value=b.set_config) self.redraw() + Window.bind(size=self.doResize) + + def doResize(self, *args): + self.show(True) def show(self, on, **kw): side = self.menubar.tkopt.toolbar.get() self.win.setTool(None, side) print('******** toolbar show', on, side, kw) + + # size_hint dependent on screen orientation: + asp = Window.width/Window.height + + if side in [1, 2]: + self.orientation = "horizontal" + if asp > 1.0: + self.size_hint = (1.0, 0.09) + else: + self.size_hint = (1.0, 0.06) + else: + self.orientation = "vertical" + if asp > 1.0: + self.size_hint = (0.06, 1.0) + else: + self.size_hint = (0.09, 1.0) return False def mHoldAndQuit(self, *args):