diff --git a/app/ui/common/ProjectComboBoxWithEditorButton.qml b/app/ui/common/ProjectComboBoxWithEditorButton.qml index b8692526..f076ed7e 100644 --- a/app/ui/common/ProjectComboBoxWithEditorButton.qml +++ b/app/ui/common/ProjectComboBoxWithEditorButton.qml @@ -9,8 +9,10 @@ Item { property alias model: project_combo_box.model property alias textRole: project_combo_box.textRole property alias emptyString: project_combo_box.emptyString + property alias projectIndex: project_combo_box.currentIndex signal currentIndexChanged(int index) + signal currentTextChanged(string text) signal editorButtonClicked height: Sizes.toolbarHeight @@ -30,6 +32,7 @@ Item { emptyString: "" onCurrentIndexChanged: root.currentIndexChanged(currentIndex) + onCurrentTextChanged: root.currentTextChanged(currentText) } // Open Editor Button @@ -43,4 +46,13 @@ Item { onClicked: root.editorButtonClicked() } + + Rectangle { + id: bar + height: 1 + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + color: palette.button + } } diff --git a/app/ui/tools/audio/AudioCategoryView.qml b/app/ui/tools/audio/AudioCategoryView.qml index 1da885c4..0891b0f7 100644 --- a/app/ui/tools/audio/AudioCategoryView.qml +++ b/app/ui/tools/audio/AudioCategoryView.qml @@ -1,10 +1,10 @@ import QtQuick import QtQuick.Controls import CustomComponents -import IconFonts import src import "./buttons" import "../.." +import "../../common" Rectangle { id: left_menu @@ -12,46 +12,24 @@ Rectangle { signal editorButtonClicked - Item { + ProjectComboBoxWithEditorButton + { id: top_bar - anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right - height: Sizes.toolbarHeight - - anchors.leftMargin: 5 - anchors.rightMargin: 5 - // Project ComboBox - CustomToolBarComboBox { - id: audio_project_combo_box + model: AudioTool.projects + textRole: "name" - anchors.left: parent.left - anchors.right: editor_button.left + emptyString: AudioTool.isLoading ? qsTr("Loading ...") : qsTr( + "No Projects") - width: parent.width - editor_button.width - model: AudioTool.projects - textRole: "name" - emptyString: AudioTool.isLoading ? qsTr("Loading ...") : qsTr( - "No Projects") - - onCurrentTextChanged: { - AudioTool.setCurrentProject(currentIndex) - } + onCurrentTextChanged: { + AudioTool.setCurrentProject(projectIndex) } - // Open Editor Button - CustomToolBarButton { - id: editor_button - iconText: FontAwesome.penToSquare - - anchors.right: parent.right - anchors.topMargin: 8 - anchors.bottomMargin: 8 - - onClicked: left_menu.editorButtonClicked() - } + onEditorButtonClicked: left_menu.editorButtonClicked() } ScrollView {