Skip to content

Commit

Permalink
Update lattice config buttons to reference component
Browse files Browse the repository at this point in the history
  • Loading branch information
proy30 committed Feb 25, 2025
1 parent 3bf7849 commit fd6998a
Showing 1 changed file with 19 additions and 26 deletions.
45 changes: 19 additions & 26 deletions src/python/impactx/dashboard/Input/latticeConfiguration/helper.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from ... import setup_server, vuetify
from .. import CardComponents

server, state, ctrl = setup_server()

Expand All @@ -8,18 +9,19 @@ class LatticeConfigurationHelper:
Helper class to build the Lattice Configuration section of the dashboard
"""

BUTTON_COLOR = "secondary"

@staticmethod
def settings() -> vuetify.VBtn:
"""
A button which opens the lattice configuration settings.
"""

with vuetify.VBtn(
CardComponents.card_button(
"mdi-cog",
color=LatticeConfigurationHelper.BUTTON_COLOR,
click="lattice_configuration_dialog_settings = true",
icon=True,
small=True,
):
vuetify.VIcon("mdi-cog")
)

@staticmethod
def move_element_up() -> vuetify.VBtn:
Expand All @@ -28,14 +30,11 @@ def move_element_up() -> vuetify.VBtn:
move a lattice element's index upward.
"""

with vuetify.VBtn(
CardComponents.card_button(
"mdi-menu-up",
color=LatticeConfigurationHelper.BUTTON_COLOR,
click=(ctrl.move_latticeElementIndex_up, "[index]"),
icon=True,
small=True,
):
vuetify.VIcon(
"mdi-menu-up",
)
)

@staticmethod
def move_element_down() -> vuetify.VBtn:
Expand All @@ -44,14 +43,11 @@ def move_element_down() -> vuetify.VBtn:
move a lattice element's index downward.
"""

with vuetify.VBtn(
CardComponents.card_button(
"mdi-menu-down",
color=LatticeConfigurationHelper.BUTTON_COLOR,
click=(ctrl.move_latticeElementIndex_down, "[index]"),
icon=True,
small=True,
):
vuetify.VIcon(
"mdi-menu-down",
)
)

@staticmethod
def delete_element() -> vuetify.VBtn:
Expand All @@ -60,11 +56,8 @@ def delete_element() -> vuetify.VBtn:
move a lattice element's index downward.
"""

with vuetify.VBtn(
CardComponents.card_button(
"mdi-delete",
color=LatticeConfigurationHelper.BUTTON_COLOR,
click=(ctrl.deleteLatticeElement, "[index]"),
icon=True,
small=True,
):
vuetify.VIcon(
"mdi-delete",
)
)

0 comments on commit fd6998a

Please sign in to comment.