diff options
Diffstat (limited to 'modules/controlcenter/PaneRegistry.qml')
| -rw-r--r-- | modules/controlcenter/PaneRegistry.qml | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/modules/controlcenter/PaneRegistry.qml b/modules/controlcenter/PaneRegistry.qml index df63c6e..d8bf45e 100644 --- a/modules/controlcenter/PaneRegistry.qml +++ b/modules/controlcenter/PaneRegistry.qml @@ -2,28 +2,9 @@ pragma Singleton import QtQuick -/** - * PaneRegistry - * - * Centralized registry for Control Center panes. This singleton provides a single - * source of truth for pane metadata (id, label, icon, component), eliminating - * the need for manual index management and making adding/removing panes trivial. - * - * Usage: - * - Panes.qml: Dynamically creates panes from registry - * - Session.qml: Derives panes list from registry - * - NavRail.qml: Uses registry for navigation items - */ QtObject { id: root - /** - * Pane metadata structure: - * - id: Unique identifier for the pane (string) - * - label: Display label for the pane (string) - * - icon: Material icon name (string) - * - component: Component path relative to controlcenter module (string) - */ readonly property list<QtObject> panes: [ QtObject { readonly property string id: "network" @@ -63,15 +44,8 @@ QtObject { } ] - /** - * Get the count of registered panes - */ readonly property int count: panes.length - /** - * Get pane labels as a list of strings - * Useful for Session.qml's panes property - */ readonly property var labels: { const result = []; for (let i = 0; i < panes.length; i++) { @@ -80,11 +54,6 @@ QtObject { return result; } - /** - * Get pane metadata by index - * @param index The index of the pane - * @return The pane metadata object or null if index is out of bounds - */ function getByIndex(index: int): QtObject { if (index >= 0 && index < panes.length) { return panes[index]; @@ -92,11 +61,6 @@ QtObject { return null; } - /** - * Get pane index by label - * @param label The label to search for - * @return The index of the pane or -1 if not found - */ function getIndexByLabel(label: string): int { for (let i = 0; i < panes.length; i++) { if (panes[i].label === label) { @@ -106,21 +70,11 @@ QtObject { return -1; } - /** - * Get pane metadata by label - * @param label The label to search for - * @return The pane metadata object or null if not found - */ function getByLabel(label: string): QtObject { const index = getIndexByLabel(label); return getByIndex(index); } - /** - * Get pane metadata by id - * @param id The id to search for - * @return The pane metadata object or null if not found - */ function getById(id: string): QtObject { for (let i = 0; i < panes.length; i++) { if (panes[i].id === id) { |