From 0ec54c65ccaa1e2b65ff1a75cf0e4a00da448c10 Mon Sep 17 00:00:00 2001 From: Matias Linares Date: Tue, 5 Jul 2022 17:38:04 -0300 Subject: Another layout for the buttons. --- main.qml | 124 ++++++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 71 insertions(+), 53 deletions(-) (limited to 'main.qml') diff --git a/main.qml b/main.qml index c7b8a33..c067b6e 100644 --- a/main.qml +++ b/main.qml @@ -19,53 +19,79 @@ ApplicationWindow { anchors.margins: 10 width: 700 RowLayout { - TableView { - id: songTable - model: song.model - Layout.fillHeight: true - Layout.fillWidth: true - Layout.alignment: Qt.AlignTop - //Layout.minimumWidth: 300 - alternatingRowColors: true - - TableViewColumn { - role: "title" - title: "Title" + ColumnLayout { + Label { + text: "Songs" } - TableViewColumn { - role: "duration" - title: "Duration" + TableView { + id: songTable + model: song.model + Layout.fillHeight: true + Layout.fillWidth: true + Layout.alignment: Qt.AlignTop + //Layout.minimumWidth: 300 + alternatingRowColors: true + + TableViewColumn { + role: "title" + title: "Title" + } + TableViewColumn { + role: "duration" + title: "Duration" + } + onClicked: { + var tmp = song.song_selected(row) + audioInterface.source = tmp.path + durationText.text = song.ms_to_time(tmp.duration) + } } - onClicked: { - var tmp = song.song_selected(row) - audioInterface.source = tmp.path - durationText.text = song.ms_to_time(tmp.duration) + RowLayout { + Button { + icon.name: "cursor-cross" + onClicked: { + fileDialog.open() + } + } } } - - TableView { - id: songPartTable - model: song.segment_model - Layout.fillHeight: true - Layout.fillWidth: true - Layout.alignment: Qt.AlignTop - //Layout.minimumWidth: 300 - alternatingRowColors: true - - TableViewColumn { - role: "name" - title: "Name" + ColumnLayout { + Label { + text: "Segments" } - TableViewColumn { - role: "from" - title: "From" + TableView { + id: songPartTable + model: song.segment_model + Layout.fillHeight: true + Layout.fillWidth: true + Layout.alignment: Qt.AlignTop + //Layout.minimumWidth: 300 + alternatingRowColors: true + + TableViewColumn { + role: "name" + title: "Name" + } + TableViewColumn { + role: "from" + title: "From" + } + TableViewColumn { + role: "to" + title: "To" + } + onClicked: { + song.segment_selected(row) + } } - TableViewColumn { - role: "to" - title: "To" - } - onClicked: { - song.segment_selected(row) + + RowLayout { + Button { + icon.name: "cursor-cross" + onClicked: { + addSegmentDialog.open() + } + } } } } @@ -104,14 +130,10 @@ ApplicationWindow { } RowLayout { - Button { - text: "Add" - onClicked: { - fileDialog.open() - } - } + Layout.alignment: Qt.AlignHCenter Button { text: "Play" + icon.name: "media-playback-start" onClicked: { audioInterface.play() timer.start() @@ -119,6 +141,7 @@ ApplicationWindow { } Button { text: "Stop" + icon.name: "media-playback-stop" onClicked: { audioInterface.stop() timer.restart() @@ -126,17 +149,12 @@ ApplicationWindow { } Button { text: "Pause" + icon.name: "media-playback-pause" onClicked: { audioInterface.pause() timer.stop() } } - Button { - text: "Add segment" - onClicked: { - addSegmentDialog.open() - } - } } } -- cgit v1.2.3-70-g09d2