1
0
Fork 0
mirror of https://github.com/shlomif/PySolFC.git synced 2025-04-05 00:02:29 -04:00

Kivy/Android version:

- toolbar posions top and bottom implemented
- localisation (de) updates
This commit is contained in:
lufebe16 2023-09-28 18:00:14 +02:00
parent 529e8c006f
commit 96699c8fa2
5 changed files with 49 additions and 20 deletions

View file

@ -2905,7 +2905,7 @@ msgstr "Markieren und Ziel klicken"
#: pysollib/kivy/menubar.py:1003 pysollib/tile/toolbar.py:202 #: pysollib/kivy/menubar.py:1003 pysollib/tile/toolbar.py:202
#: pysollib/tk/toolbar.py:211 #: pysollib/tk/toolbar.py:211
msgid "Toolbar" msgid "Toolbar"
msgstr "Toolbar" msgstr "Werkzeugleiste"
#: pysollib/kivy/menubar.py:1006 pysollib/ui/tktile/menubar.py:41 #: pysollib/kivy/menubar.py:1006 pysollib/ui/tktile/menubar.py:41
msgid "Hide" msgid "Hide"
@ -4860,15 +4860,15 @@ msgstr ""
#: pysollib/ui/tktile/menubar.py:44 #: pysollib/ui/tktile/menubar.py:44
msgid "Top" msgid "Top"
msgstr "" msgstr "Oben"
#: pysollib/ui/tktile/menubar.py:47 #: pysollib/ui/tktile/menubar.py:47
msgid "Bottom" msgid "Bottom"
msgstr "" msgstr "Unten"
#: pysollib/ui/tktile/menubar.py:64 #: pysollib/ui/tktile/menubar.py:64
msgid "Visible buttons" msgid "Visible buttons"
msgstr "" msgstr "Verfügbare Symbole"
#: pysollib/ui/tktile/menubar.py:296 #: pysollib/ui/tktile/menubar.py:296
#, python-format #, python-format

View file

@ -1595,6 +1595,7 @@ class LMainWindow(BoxLayout, LTkBase):
self.menuArea = LMenuBar() self.menuArea = LMenuBar()
self.workContainer = LBoxLayout(orientation='horizontal') self.workContainer = LBoxLayout(orientation='horizontal')
self.workContainerO = LBoxLayout(orientation='horizontal') self.workContainerO = LBoxLayout(orientation='horizontal')
self.workContainer1 = LBoxLayout(orientation='vertical')
self.workArea = None self.workArea = None
self.toolBar = None self.toolBar = None
self.toolBarPos = 0 self.toolBarPos = 0
@ -1732,13 +1733,22 @@ class LMainWindow(BoxLayout, LTkBase):
def removeContainer(self): def removeContainer(self):
self.workContainer.clear_widgets() self.workContainer.clear_widgets()
self.workContainerO.clear_widgets() self.workContainerO.clear_widgets()
self.workContainer1.clear_widgets()
def buildContainer(self): def buildContainer(self):
# (hbox)
if self.toolBar is not None and self.toolBarPos == 3: if self.toolBar is not None and self.toolBarPos == 3:
self.workContainerO.add_widget(self.toolBar) 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: if self.toolBar is not None and self.toolBarPos == 4:
self.workContainerO.add_widget(self.toolBar) 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: for w in self.workStack.items:
self.workContainer.add_widget(w[1]) self.workContainer.add_widget(w[1])

View file

@ -1109,17 +1109,14 @@ class OptionsMenuDialog(LMenuDialog):
self.menubar.tkopt.toolbar, 0, self.menubar.tkopt.toolbar, 0,
self.menubar.mOptToolbar) self.menubar.mOptToolbar)
# not supported: Top, Bottom self.addRadioNode(tv, rg,
# self.addRadioNode(tv, rg, _('Top'),
# 'Top', self.menubar.tkopt.toolbar, 1,
# self.menubar.tkopt.toolbar, 1, self.menubar.mOptToolbar)
# self.menubar.mOptToolbar) self.addRadioNode(tv, rg,
_('Bottom'),
# self.addRadioNode(tv, rg, self.menubar.tkopt.toolbar, 2,
# _('Bottom'), self.menubar.mOptToolbar)
# self.menubar.tkopt.toolbar, 2,
# self.menubar.mOptToolbar)
self.addRadioNode(tv, rg, self.addRadioNode(tv, rg,
_('Left'), _('Left'),
self.menubar.tkopt.toolbar, 3, self.menubar.tkopt.toolbar, 3,
@ -1130,13 +1127,13 @@ class OptionsMenuDialog(LMenuDialog):
self.menubar.mOptToolbar) self.menubar.mOptToolbar)
rg1 = tv.add_node( rg1 = tv.add_node(
LTreeNode(text=_('Buttons:')), rg) LTreeNode(text=_('Visible buttons')), rg)
if rg1: if rg1:
for w in TOOLBAR_BUTTONS: for w in TOOLBAR_BUTTONS:
ww = w w0 = w[0].upper()
ww[0].upper() ww = w[1:]
self.addCheckNode(tv, rg, self.addCheckNode(tv, rg,
_(ww), # noqa _(w0+ww), # noqa
self.menubar.tkopt.toolbar_vars[w], self.menubar.tkopt.toolbar_vars[w],
self.make_vars_command(self.menubar.mOptToolbarConfig, w)) # noqa self.make_vars_command(self.menubar.mOptToolbarConfig, w)) # noqa

View file

@ -808,6 +808,7 @@ class MfxCanvas(Widget):
def showAllItems(self): def showAllItems(self):
print('MfxCanvas: showAllItems') print('MfxCanvas: showAllItems')
# TBD # TBD
# Brauchts darum auch nicht.
pass pass
# Erweiterungen fuer Tk Canvas (prüfen was noch nötig!!). # Erweiterungen fuer Tk Canvas (prüfen was noch nötig!!).

View file

@ -23,6 +23,7 @@ import os
from kivy.cache import Cache from kivy.cache import Cache
from kivy.clock import Clock from kivy.clock import Clock
from kivy.core.window import Window
from kivy.properties import BooleanProperty from kivy.properties import BooleanProperty
from kivy.uix.behaviors import ButtonBehavior from kivy.uix.behaviors import ButtonBehavior
from kivy.uix.boxlayout import BoxLayout from kivy.uix.boxlayout import BoxLayout
@ -308,11 +309,31 @@ class PysolToolbarTk(BoxLayout):
opt.bind(value=b.set_config) opt.bind(value=b.set_config)
self.redraw() self.redraw()
Window.bind(size=self.doResize)
def doResize(self, *args):
self.show(True)
def show(self, on, **kw): def show(self, on, **kw):
side = self.menubar.tkopt.toolbar.get() side = self.menubar.tkopt.toolbar.get()
self.win.setTool(None, side) self.win.setTool(None, side)
print('******** toolbar show', on, side, kw) 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 return False
def mHoldAndQuit(self, *args): def mHoldAndQuit(self, *args):