diff --git a/config/move_menu.conf b/config/move_menu.conf index e8521d76d..1ba8a9927 100644 --- a/config/move_menu.conf +++ b/config/move_menu.conf @@ -7,35 +7,30 @@ name: {{ gettext('Home X') }} icon: home-x method: printer.gcode.script params: {"script":"G28 X"} -active: {{ 'x' in printer.homed_axes }} [menu move homing homey] name: {{ gettext('Home Y') }} icon: home-y method: printer.gcode.script params: {"script":"G28 Y"} -active: {{ 'y' in printer.homed_axes }} [menu move homing homez] name: {{ gettext('Home Z') }} icon: home-z method: printer.gcode.script params: {"script":"G28 Z"} -active: {{ 'z' in printer.homed_axes }} [menu move homing homeall] name: {{ gettext('Home All') }} icon: home method: printer.gcode.script params: {"script":"G28"} -active: {{ 'xyz' in printer.homed_axes }} [menu move homing homexy] name: {{ gettext('Home XY') }} icon: home method: printer.gcode.script params: {"script":"G28 X Y"} -active: {{ 'xy' in printer.homed_axes }} [menu move homing quad_gantry_level] name: {{ gettext('Quad Gantry Level') }} @@ -43,7 +38,6 @@ icon: home-z method: printer.gcode.script params: {"script":"QUAD_GANTRY_LEVEL"} enable: {{ 'QUAD_GANTRY_LEVEL' in printer.available_commands }} -active: {{ printer.quad_gantry_level.applied }} [menu move homing Z-Tilt] name: {{ gettext('Z Tilt') }} @@ -51,4 +45,3 @@ icon: z-tilt method: printer.gcode.script params: {"script":"Z_TILT_ADJUST"} enable: {{ 'Z_TILT_ADJUST' in printer.available_commands }} -active: {{ printer.z_tilt.applied }} \ No newline at end of file diff --git a/ks_includes/config.py b/ks_includes/config.py index b7f9068ce..18ff70900 100644 --- a/ks_includes/config.py +++ b/ks_includes/config.py @@ -190,7 +190,7 @@ def validate_config(self, config, string="", remove=False): strs = ('gcode', '') numbers = [f'{option}' for option in config[section] if option != 'gcode'] elif section.startswith('menu '): - strs = ('name', 'icon', 'panel', 'method', 'params', 'enable', 'confirm', 'style', 'active') + strs = ('name', 'icon', 'panel', 'method', 'params', 'enable', 'confirm', 'style') elif section.startswith('graph')\ or section.startswith('displayed_macros')\ or section.startswith('spoolman'): @@ -617,8 +617,7 @@ def _build_menu_item(self, menu, name): "confirm": cfg.get("confirm", None), "enable": cfg.get("enable", "True"), "params": cfg.get("params", "{}"), - "style": cfg.get("style", None), - "active": cfg.get("active", None) + "style": cfg.get("style", None) } return {name[(len(menu) + 6):]: item} diff --git a/ks_includes/printer.py b/ks_includes/printer.py index 9265ca13b..0eb930cd4 100644 --- a/ks_includes/printer.py +++ b/ks_includes/printer.py @@ -258,9 +258,6 @@ def get_printer_status_data(self): "gcode_macros": {"count": len(self.get_gcode_macros()), "list": self.get_gcode_macros()}, "leds": {"count": self.ledcount}, "config_sections": list(self.config.keys()), - "homed_axes": self.get_stat("toolhead", "homed_axes"), - "quad_gantry_level": self.get_stat("quad_gantry_level"), - "z_tilt": self.get_stat("z_tilt"), "available_commands": self.available_commands, } } diff --git a/panels/menu.py b/panels/menu.py index 574047aaf..97761849e 100644 --- a/panels/menu.py +++ b/panels/menu.py @@ -84,31 +84,15 @@ def create_menu_items(self): b.connect("clicked", self._screen._send_action, item['method'], params) else: b.connect("clicked", self._screen._go_to_submenu, key) - b.set_name(key) self.labels[key] = b def evaluate_enable(self, enable): - if enable is None: - return False if enable == "{{ moonraker_connected }}": logging.info(f"moonraker connected {self._screen._ws.connected}") return self._screen._ws.connected try: j2_temp = Template(enable, autoescape=True) - return j2_temp.render(self._printer.get_printer_status_data()) == 'True' + return j2_temp.render(self.j2_data) == 'True' except Exception as e: logging.debug(f"Error evaluating enable statement: {enable}\n{e}") return False - - def process_update(self, action, data): - if action != "notify_status_update": - return - for item in self.autogrid: - key = item.get_name() - for item_dict in self.items: - if key in item_dict and 'active' in item_dict[key]: - if self.evaluate_enable(item_dict[key]['active']): - item.get_style_context().add_class("menu_active") - else: - item.get_style_context().remove_class("menu_active") - break diff --git a/styles/base.css b/styles/base.css index ea0a1fcf4..c03d2ec78 100644 --- a/styles/base.css +++ b/styles/base.css @@ -80,13 +80,6 @@ button.active { background-color: @active; } - -button.menu_active { - border-width: 0.25em; - border-style: dashed; - border-color: @active; -} - button:disabled, button.color1:disabled, button.color2:disabled, diff --git a/styles/colorized/style.css b/styles/colorized/style.css index ac93551ee..15b7b5550 100644 --- a/styles/colorized/style.css +++ b/styles/colorized/style.css @@ -110,12 +110,6 @@ popover button { border-color: @solarized-base03; } -button.menu_active { - border-width: 0.25em; - border-style: dashed; - border-color: @solarized-green; -} - switch { background-color: @solarized-base02; } diff --git a/styles/material-dark/style.css b/styles/material-dark/style.css index 258105a93..581786905 100644 --- a/styles/material-dark/style.css +++ b/styles/material-dark/style.css @@ -94,12 +94,6 @@ combobox menuitem { border-color: @bg; } -button.menu_active { - border-width: 0.25em; - border-style: dashed; - border-color: @echo; -} - treeview.view check, switch { background-color: @active-dark; diff --git a/styles/material-darker/style.css b/styles/material-darker/style.css index 46d3274a5..a59d55623 100644 --- a/styles/material-darker/style.css +++ b/styles/material-darker/style.css @@ -92,12 +92,6 @@ combobox menuitem { border-color: #121212; } -button.menu_active { - border-width: 0.25em; - border-style: solid; - border-color: #006412; -} - treeview.view check, switch { background-color: #1c1c1c; diff --git a/styles/material-light/style.css b/styles/material-light/style.css index c069a64a3..daad1a7ea 100644 --- a/styles/material-light/style.css +++ b/styles/material-light/style.css @@ -149,15 +149,6 @@ menu { border-color: @border; } -button.menu_active { - border-color: @border; - border-style: solid; - border-width: .25em; - background-color: @bg; - box-shadow: .1em .1em @border; - border-radius: 1em; -} - menuitem { background-color: @bg; border-color: @border; diff --git a/styles/z-bolt/style.css b/styles/z-bolt/style.css index 9ef5a26f7..73867f6ed 100644 --- a/styles/z-bolt/style.css +++ b/styles/z-bolt/style.css @@ -101,11 +101,6 @@ menu { border-color: @lines; } -button.menu_active { - border-width: 0; - background-color: @active; -} - menuitem { background-color: @bg; border-color: @lines;