mirror of
https://github.com/bec-project/bec_widgets.git
synced 2026-09-03 23:30:42 +02:00
fix(toolbar): update plugin toolbar action titles to use pascal_to_title formatting
This commit is contained in:
@@ -26,6 +26,7 @@ from bec_widgets.utils.bec_plugin_helper import (
|
||||
get_plugin_widget_icons,
|
||||
)
|
||||
from bec_widgets.utils.colors import apply_theme
|
||||
from bec_widgets.utils.name_utils import pascal_to_title
|
||||
from bec_widgets.utils.plugin_utils import get_rpc_widget_registry
|
||||
from bec_widgets.utils.rpc_decorator import rpc_timeout
|
||||
from bec_widgets.utils.rpc_widget_handler import widget_handler
|
||||
@@ -88,7 +89,11 @@ def _plugin_toolbar_actions() -> dict[str, tuple[str, str, str]]:
|
||||
plugin_icons = get_plugin_widget_icons()
|
||||
|
||||
return {
|
||||
widget_name: (plugin_icons.get(widget_name, "widgets"), f"Add {widget_name}", widget_name)
|
||||
widget_name: (
|
||||
plugin_icons.get(widget_name, "widgets"),
|
||||
pascal_to_title(widget_name),
|
||||
widget_name,
|
||||
)
|
||||
for widget_name in sorted(plugin_registry)
|
||||
if widget_name not in internal_registry
|
||||
}
|
||||
|
||||
@@ -1083,7 +1083,7 @@ class TestToolbarFunctionality:
|
||||
plugin_actions = dock_area_module._plugin_toolbar_actions()
|
||||
|
||||
assert plugin_actions == {
|
||||
"FakePluginWidget": ("star", "Add FakePluginWidget", "FakePluginWidget")
|
||||
"FakePluginWidget": ("star", "Fake Plugin Widget", "FakePluginWidget")
|
||||
}
|
||||
|
||||
def test_plugin_toolbar_actions_ignore_builtin_name_collisions(
|
||||
|
||||
Reference in New Issue
Block a user