diff --git a/storybook/main.qml b/storybook/main.qml index d09383b3c5..583108f924 100644 --- a/storybook/main.qml +++ b/storybook/main.qml @@ -136,7 +136,7 @@ ApplicationWindow { footer: PageToolBar { id: pageToolBar - title: `pages/${root.currentPage}Page.qml` + componentName: root.currentPage figmaPagesCount: currentPageModelItem.object ? currentPageModelItem.object.figma.count : 0 diff --git a/storybook/src/Storybook/PageToolBar.qml b/storybook/src/Storybook/PageToolBar.qml index 4cac97cf2f..60fff1aa39 100644 --- a/storybook/src/Storybook/PageToolBar.qml +++ b/storybook/src/Storybook/PageToolBar.qml @@ -5,7 +5,8 @@ import QtQuick.Layouts 1.14 ToolBar { id: root - property string title + property string componentName + property int figmaPagesCount: 0 signal figmaPreviewClicked @@ -13,10 +14,12 @@ ToolBar { RowLayout { anchors.fill: parent - TextField { + Item { Layout.fillWidth: true + } - text: root.title + TextField { + text: `pages/${root.componentName}Page.qml` horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter @@ -25,6 +28,29 @@ ToolBar { background: null } + ToolButton { + text: "📋" + + ToolTip.timeout: 2000 + ToolTip.text: "Component name copied to the clipboard" + + TextInput { + id: hiddenTextInput + text: root.componentName + visible: false + } + + onClicked: { + hiddenTextInput.selectAll() + hiddenTextInput.copy() + ToolTip.visible = true + } + } + + Item { + Layout.fillWidth: true + } + ToolSeparator {} ToolButton {