Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions friture/ControlBar.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15

RowLayout {
id: controlBar
objectName: "controlBar"
spacing: 0

SystemPalette { id: systemPalette; colorGroup: SystemPalette.Active }

required property var viewModel

ComboBox {
id: widgetSelector
model: [
"Scope",
"FFT Spectrum",
"2D Spectrogram",
"Octave Spectrum",
"Generator",
"Delay Estimator",
"Long-time levels",
"Pitch Tracker"
]
currentIndex: viewModel.currentIndex
onCurrentIndexChanged: viewModel.currentIndex = currentIndex
ToolTip.text: "Select the type of audio widget"

// replace with implicitContentWidthPolicy to either ComboBox.WidestText on Qt 6
width: 130
Layout.preferredWidth: width
Layout.rightMargin: 5
}

ToolButton {
id: settingsButton
icon.source: "qrc:/images-src/dock-settings.svg"
ToolTip.text: "Customize the audio widget"
icon.color: systemPalette.windowText
onClicked: viewModel.onSettingsClicked()
}

ToolButton {
id: movePreviousButton
icon.source: "qrc:/images-src/dock-move-previous.svg"
ToolTip.text: "Move widget to previous slot"
icon.color: systemPalette.windowText
onClicked: viewModel.onMovePreviousClicked()
}

ToolButton {
id: moveNextButton
icon.source: "qrc:/images-src/dock-move-next.svg"
ToolTip.text: "Move widget to next slot"
icon.color: systemPalette.windowText
onClicked: viewModel.onMoveNextClicked()
}

ToolButton {
id: closeButton
icon.source: "qrc:/images-src/dock-close.svg"
ToolTip.text: "Close the audio widget"
icon.color: systemPalette.windowText
onClicked: viewModel.onCloseClicked()
}

Item {
Layout.fillWidth: true
}
}
32 changes: 32 additions & 0 deletions friture/Dock.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.2

Rectangle {
SystemPalette { id: systemPalette; colorGroup: SystemPalette.Active }
color: systemPalette.window
anchors.fill: parent

ColumnLayout {
id: root
anchors.fill: parent

property string fixedFont

Item {
id: control_bar_container
objectName: "control_bar_container"
Layout.fillWidth: true
Layout.preferredHeight: 40
}

Item {
id: audio_widget_container
objectName: "audio_widget_container"
Layout.fillWidth: true
Layout.fillHeight: true
Layout.margins: 5
}
}
}

1 change: 0 additions & 1 deletion friture/Generator.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Rectangle {

SystemPalette { id: systemPalette; colorGroup: SystemPalette.Active }
color: systemPalette.window
anchors.fill: parent

ColumnLayout {
anchors.top: parent.top
Expand Down
77 changes: 0 additions & 77 deletions friture/controlbar.py

This file was deleted.

34 changes: 34 additions & 0 deletions friture/controlbar_viewmodel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from PyQt5.QtCore import QObject, pyqtSignal, pyqtProperty

class ControlBarViewModel(QObject):
indexChanged = pyqtSignal(int)
settingsClicked = pyqtSignal()
movePreviousClicked = pyqtSignal()
moveNextClicked = pyqtSignal()
closeClicked = pyqtSignal()

def __init__(self, parent=None):
super().__init__(parent)
self._currentIndex = 0

def getCurrentIndex(self):
return self._currentIndex

def setCurrentIndex(self, index):
if self._currentIndex != index:
self._currentIndex = index
self.indexChanged.emit(index)

currentIndex = pyqtProperty(int, fget=getCurrentIndex, fset=setCurrentIndex, notify=indexChanged)

def onSettingsClicked(self):
self.settingsClicked.emit()

def onMovePreviousClicked(self):
self.movePreviousClicked.emit()

def onMoveNextClicked(self):
self.moveNextClicked.emit()

def onCloseClicked(self):
self.closeClicked.emit()
Loading
Loading