-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add formats setup page with color picker for digits
fix: extend functionality of saving dispatcher
- Loading branch information
Showing
8 changed files
with
103 additions
and
25 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
rotary_controller_python/components/setup/formats_panel.kv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#: import StringItem components.forms.string_item | ||
|
||
<FormatsPanel>: | ||
orientation: "vertical" | ||
ScrollView: | ||
do_scroll_x: False | ||
do_scroll_y: True | ||
GridLayout: | ||
id: grid_layout | ||
cols: 1 | ||
spacing: 1 | ||
size_hint_y: None | ||
StringItem: | ||
name: "Metric Position" | ||
value: root.formats.metric_position | ||
on_value: root.formats.metric_position = self.value | ||
StringItem: | ||
name: "Metric Speed" | ||
value: root.formats.metric_speed | ||
on_value: root.formats.metric_speed = self.value | ||
StringItem: | ||
name: "Imperial Position" | ||
value: root.formats.imperial_position | ||
on_value: root.formats.imperial_position = self.value | ||
StringItem: | ||
name: "Imperial Speed" | ||
value: root.formats.imperial_speed | ||
on_value: root.formats.imperial_speed = self.value | ||
StringItem: | ||
name: "Angle Format" | ||
value: root.formats.angle_format | ||
on_value: root.formats.angle_format = self.value | ||
Label: | ||
size_hint_y: None | ||
height: 32 | ||
text: "Digits Color" | ||
ColorPicker: | ||
padding: 10 | ||
size_hint_y: None | ||
height: 320 | ||
color: root.formats.display_color | ||
on_color: root.formats.display_color = self.color |
22 changes: 22 additions & 0 deletions
22
rotary_controller_python/components/setup/formats_panel.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import os | ||
|
||
from kivy.lang import Builder | ||
from kivy.logger import Logger | ||
from kivy.properties import ObjectProperty | ||
from kivy.uix.boxlayout import BoxLayout | ||
|
||
|
||
log = Logger.getChild(__name__) | ||
kv_file = os.path.join(os.path.dirname(__file__), __file__.replace(".py", ".kv")) | ||
if os.path.exists(kv_file): | ||
log.info(f"Loading KV file: {kv_file}") | ||
Builder.load_file(kv_file) | ||
|
||
|
||
class FormatsPanel(BoxLayout): | ||
formats = ObjectProperty() | ||
|
||
def __init__(self, formats, **kv): | ||
self.formats = formats | ||
super().__init__(**kv) | ||
self.ids['grid_layout'].bind(minimum_height=self.ids['grid_layout'].setter('height')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters