Skip to content

Commit

Permalink
Added a base line to the project combo box to separate it from the co…
Browse files Browse the repository at this point in the history
…ntent below; audio tool now also uses this combo box
  • Loading branch information
PhilInTheGaps committed Nov 8, 2023
1 parent 0076e64 commit 34319ad
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 32 deletions.
12 changes: 12 additions & 0 deletions app/ui/common/ProjectComboBoxWithEditorButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -30,6 +32,7 @@ Item {
emptyString: ""

onCurrentIndexChanged: root.currentIndexChanged(currentIndex)
onCurrentTextChanged: root.currentTextChanged(currentText)
}

// Open Editor Button
Expand All @@ -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
}
}
42 changes: 10 additions & 32 deletions app/ui/tools/audio/AudioCategoryView.qml
Original file line number Diff line number Diff line change
@@ -1,57 +1,35 @@
import QtQuick
import QtQuick.Controls
import CustomComponents
import IconFonts
import src
import "./buttons"
import "../.."
import "../../common"

Rectangle {
id: left_menu
color: palette.dark

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 {
Expand Down

0 comments on commit 34319ad

Please sign in to comment.