ebs-linuxnode-gui-kivy-core 3.3.4__tar.gz → 3.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ebs_linuxnode_gui_kivy_core-3.3.4/ebs_linuxnode_gui_kivy_core.egg-info → ebs_linuxnode_gui_kivy_core-3.4.0}/PKG-INFO +1 -1
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/ebs/linuxnode/gui/kivy/utils/application.py +11 -1
- ebs_linuxnode_gui_kivy_core-3.4.0/ebs/linuxnode/gui/kivy/utils/keyboard.py +31 -0
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/ebs/linuxnode/gui/kivy/utils/launcher.py +8 -0
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0/ebs_linuxnode_gui_kivy_core.egg-info}/PKG-INFO +1 -1
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/ebs_linuxnode_gui_kivy_core.egg-info/SOURCES.txt +1 -0
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/.gitignore +0 -0
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/MANIFEST.in +0 -0
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/ebs/__init__.py +0 -0
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/ebs/linuxnode/__init__.py +0 -0
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/ebs/linuxnode/gui/__init__.py +0 -0
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/ebs/linuxnode/gui/kivy/__init__.py +0 -0
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/ebs/linuxnode/gui/kivy/animations/__init__.py +0 -0
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/ebs/linuxnode/gui/kivy/animations/composite.py +0 -0
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/ebs/linuxnode/gui/kivy/background/__init__.py +0 -0
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/ebs/linuxnode/gui/kivy/background/color.py +0 -0
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/ebs/linuxnode/gui/kivy/background/image.py +0 -0
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/ebs/linuxnode/gui/kivy/background/images/background.png +0 -0
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/ebs/linuxnode/gui/kivy/background/mixin.py +0 -0
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/ebs/linuxnode/gui/kivy/background/overlay.py +0 -0
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/ebs/linuxnode/gui/kivy/background/structured.py +0 -0
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/ebs/linuxnode/gui/kivy/core/__init__.py +0 -0
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/ebs/linuxnode/gui/kivy/core/basemixin.py +0 -0
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/ebs/linuxnode/gui/kivy/core/basenode.py +0 -0
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/ebs/linuxnode/gui/kivy/core/busy.py +0 -0
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/ebs/linuxnode/gui/kivy/core/display.py +0 -0
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/ebs/linuxnode/gui/kivy/core/log.py +0 -0
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/ebs/linuxnode/gui/kivy/core/nodeid.py +0 -0
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/ebs/linuxnode/gui/kivy/core/structure.py +0 -0
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/ebs/linuxnode/gui/kivy/core/text.py +0 -0
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/ebs/linuxnode/gui/kivy/utils/__init__.py +0 -0
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/ebs_linuxnode_gui_kivy_core.egg-info/dependency_links.txt +0 -0
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/ebs_linuxnode_gui_kivy_core.egg-info/requires.txt +0 -0
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/ebs_linuxnode_gui_kivy_core.egg-info/top_level.txt +0 -0
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/example/app.py +0 -0
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/example/image.jpg +0 -0
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/example/node.py +0 -0
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/example/run.py +0 -0
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/setup.cfg +0 -0
- {ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/setup.py +0 -0
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
from kivy.app import App
|
|
4
3
|
from twisted.internet import reactor
|
|
4
|
+
import os
|
|
5
|
+
framework = os.environ.get('EBS_APP_FRAMEWORK', None)
|
|
6
|
+
|
|
7
|
+
if not framework or framework == 'kivy':
|
|
8
|
+
from kivy.app import App
|
|
9
|
+
elif framework == 'kivymd':
|
|
10
|
+
from kivymd.app import MDApp as App
|
|
5
11
|
|
|
6
12
|
from ebs.linuxnode.gui.kivy.core.basenode import BaseIoTNodeGui
|
|
13
|
+
from . import keyboard
|
|
7
14
|
|
|
8
15
|
|
|
9
16
|
class BaseIOTNodeApplication(App):
|
|
@@ -31,6 +38,9 @@ class BaseIOTNodeApplication(App):
|
|
|
31
38
|
print(" ", root)
|
|
32
39
|
|
|
33
40
|
print("Building GUI for node {0}".format(self._node))
|
|
41
|
+
if framework == 'kivymd':
|
|
42
|
+
self.theme_cls.primary_palette = self._config.primary_palette
|
|
43
|
+
self.theme_cls.theme_style = self._config.theme_style
|
|
34
44
|
return self._node.gui_setup()
|
|
35
45
|
|
|
36
46
|
def on_start(self):
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
from kivy.core.window import Window
|
|
4
|
+
from kivy.uix.textinput import TextInput
|
|
5
|
+
|
|
6
|
+
_orig_request_keyboard = Window.request_keyboard
|
|
7
|
+
|
|
8
|
+
def _single_keyboard_request(callback, target, **kwargs):
|
|
9
|
+
Window.release_all_keyboards()
|
|
10
|
+
keyboard = _orig_request_keyboard(callback, target, **kwargs)
|
|
11
|
+
try:
|
|
12
|
+
if hasattr(keyboard, "widget") and keyboard.widget:
|
|
13
|
+
kb = keyboard.widget
|
|
14
|
+
focus_widget = getattr(target, "_proxy_ref", None) or target
|
|
15
|
+
if hasattr(focus_widget, "to_window"):
|
|
16
|
+
x, y = focus_widget.to_window(focus_widget.x, focus_widget.y)
|
|
17
|
+
w, h = focus_widget.size
|
|
18
|
+
win_w, win_h = Window.size
|
|
19
|
+
kb_w, kb_h = kb.size
|
|
20
|
+
new_x = max(0, min(x, win_w - kb_w))
|
|
21
|
+
new_y = y - kb_h - 10
|
|
22
|
+
if new_y < 0:
|
|
23
|
+
new_y = y + h + 10
|
|
24
|
+
if new_y + kb_h > win_h:
|
|
25
|
+
new_y = max(0, win_h - kb_h)
|
|
26
|
+
kb.pos = (new_x, new_y)
|
|
27
|
+
except Exception:
|
|
28
|
+
pass
|
|
29
|
+
return keyboard
|
|
30
|
+
|
|
31
|
+
Window.request_keyboard = _single_keyboard_request
|
|
@@ -21,6 +21,9 @@ def prepare_config(appname):
|
|
|
21
21
|
node_config = IoTNodeConfig(appname=appname)
|
|
22
22
|
|
|
23
23
|
items = [
|
|
24
|
+
('framework', ElementSpec('app', 'framework', ItemSpec(fallback='kivy'))),
|
|
25
|
+
('theme_style', ElementSpec('app', 'theme_style', ItemSpec(fallback='Dark'))),
|
|
26
|
+
('primary_palette', ElementSpec('app', 'primary_palette', ItemSpec(fallback='Yellowgreen'))),
|
|
24
27
|
('platform', ElementSpec('platform', 'platform', ItemSpec(fallback='native'))),
|
|
25
28
|
('fullscreen', ElementSpec('display', 'fullscreen', ItemSpec(bool, fallback=True))),
|
|
26
29
|
('portrait', ElementSpec('display', 'portrait', ItemSpec(bool, fallback=False))),
|
|
@@ -39,6 +42,11 @@ def prepare_environment(node_config):
|
|
|
39
42
|
print("Using Python Logging")
|
|
40
43
|
os.environ["KCFG_KIVY_LOG_LEVEL"] = "info"
|
|
41
44
|
os.environ["KIVY_LOG_MODE"] = "PYTHON"
|
|
45
|
+
|
|
46
|
+
if node_config.framework != 'kivy':
|
|
47
|
+
print(f"Using framework {node_config.framework}")
|
|
48
|
+
os.environ["EBS_APP_FRAMEWORK"] = node_config.framework
|
|
49
|
+
|
|
42
50
|
print("Using pango Text Provider")
|
|
43
51
|
os.environ['KIVY_TEXT'] = 'pango'
|
|
44
52
|
if node_config.platform == 'rpi':
|
|
@@ -25,6 +25,7 @@ ebs/linuxnode/gui/kivy/core/structure.py
|
|
|
25
25
|
ebs/linuxnode/gui/kivy/core/text.py
|
|
26
26
|
ebs/linuxnode/gui/kivy/utils/__init__.py
|
|
27
27
|
ebs/linuxnode/gui/kivy/utils/application.py
|
|
28
|
+
ebs/linuxnode/gui/kivy/utils/keyboard.py
|
|
28
29
|
ebs/linuxnode/gui/kivy/utils/launcher.py
|
|
29
30
|
ebs_linuxnode_gui_kivy_core.egg-info/PKG-INFO
|
|
30
31
|
ebs_linuxnode_gui_kivy_core.egg-info/SOURCES.txt
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ebs_linuxnode_gui_kivy_core-3.3.4 → ebs_linuxnode_gui_kivy_core-3.4.0}/ebs/linuxnode/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|