Преглед изворни кода

add some window config options + update README + use rounded corner icons + update api proposal

Noah Vogt пре 2 недеља
родитељ
комит
1cd2897028
10 измењених фајлова са 26 додато и 5 уклоњено
  1. 3 3
      README.md
  2. 7 2
      VulcanBoard.py
  3. BIN
      api.pdf
  4. BIN
      api.xopp
  5. 4 0
      config/classes.py
  6. 12 0
      config/load.py
  7. BIN
      icon-non-rounded.png
  8. BIN
      icon.ico
  9. BIN
      icon.jpg
  10. BIN
      icon.png

+ 3 - 3
README.md

@@ -20,14 +20,14 @@ To setup you need to have python3 installed. In addition, to install the depende
     pip install -r requirements.txt
 
 ## Project State
-It is currently still under heavy development, here are some planned changes:
+VulcanBoard is currently used weekly in livestreaming production by the author, hence in a usable state. Here are some planned or possible future changes:
 - add documentation for the configuration and use of VulcanBoard
 - add gui window to configure keys
     - add multiple boards to config.yml
     - add edit history cache
+    - add internal commands (see api proposal)
 - add button merging
 - add possibility to choose the font family used for button texts
 - add rounded corners for buttons
 - use constants / constant dict for default values
-- add folders
-- add button signals (changing button color / text based on certain conditions)
+- add folders (which is already possible with button states, but kinda hacky)

+ 7 - 2
VulcanBoard.py

@@ -49,7 +49,7 @@ class VulcanBoardApp(App):
         self.loop = self.ensure_asyncio_loop_running()
         self.button_grid = {}
         self.button_config_map = {}
-        self.icon = "icon.jpg"
+        self.icon = "icon.png"
         config_loader = ConfigLoader(get_config_path())
         config = config_loader.get_config()  # pyright: ignore
         if isinstance(config, str):
@@ -58,7 +58,12 @@ class VulcanBoardApp(App):
             config: Config = config
 
             Window.borderless = config.borderless
-            kvConfig.set("kivy", "window_icon", "icon.ico")
+            if config.set_window_pos:
+                Window.left = config.window_pos_x
+                Window.top = config.window_pos_y
+            if config.use_auto_fullscreen_mode:
+                Window.fullscreen = "auto"
+
             kvConfig.set("kivy", "exit_on_escape", "0")
 
             self.button_config_map = {



+ 4 - 0
config/classes.py

@@ -24,3 +24,7 @@ class Config:
     spacing: int
     padding: int
     borderless: bool
+    set_window_pos: bool
+    window_pos_x: int
+    window_pos_y: int
+    use_auto_fullscreen_mode: bool

+ 12 - 0
config/load.py

@@ -41,6 +41,10 @@ class ConfigLoader:
         self.padding = 0
         self.spacing = 0
         self.borderless = False
+        self.set_window_pos = False
+        self.window_pos_x = 0
+        self.window_pos_y = 0
+        self.use_auto_fullscreen_mode = False
 
     def get_config(self) -> Config | str:
         try:
@@ -52,6 +56,10 @@ class ConfigLoader:
                 self.padding = yaml_config.get("padding", 5)
                 self.spacing = yaml_config.get("spacing", 5)
                 self.borderless = yaml_config.get("borderless", False)
+                self.set_window_pos = yaml_config.get("set_window_pos", False)
+                self.window_pos_x = yaml_config.get("window_pox_x", 0)
+                self.window_pos_y = yaml_config.get("window_pox_y", 0)
+                self.use_auto_fullscreen_mode = yaml_config.get("use_auto_fullscreen_mode", False)
                 return self.__interpret_config()
         except (FileNotFoundError, PermissionError, IOError) as error:
             return f"Error: Could not access config file at {self.config_path}. Reason: {error}"
@@ -70,6 +78,10 @@ class ConfigLoader:
             self.spacing,
             self.padding,
             self.borderless,
+            self.set_window_pos,
+            self.window_pos_x,
+            self.window_pos_y,
+            self.use_auto_fullscreen_mode,
         )
 
     def __validate_buttons(self) -> None:

BIN
icon-non-rounded.png