Skip to content

Commit

Permalink
[WIP] Add qmldemo skin
Browse files Browse the repository at this point in the history
  • Loading branch information
Holzhaus committed May 23, 2021
1 parent b02afee commit 9ce44b6
Show file tree
Hide file tree
Showing 5 changed files with 208 additions and 0 deletions.
33 changes: 33 additions & 0 deletions res/skins/qmldemo/MixxxSlider.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import QtQuick 2.12
import QtQuick.Controls 2.12
import Mixxx 1.0

Item {
id: root
property alias group: control.group
property alias key: control.key

Slider {
id: slider
orientation: Qt.Vertical
value: control.parameter
wheelEnabled: true

Control {
id: control
parameter: slider.value
}

handle: Image {
source: "../LateNight/palemoon/sliders/knob_volume_deck.svg"
width: 42
height: 19
x: slider.leftPadding + slider.availableWidth / 2 - width / 2
y: slider.visualPosition * (slider.height - height)
}

background: Image {
source: "../LateNight/palemoon/sliders/slider_volume_deck.svg"
}
}
}
30 changes: 30 additions & 0 deletions res/skins/qmldemo/MixxxToggleButton.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import QtQuick 2.12
import QtQuick.Controls 2.12
import Mixxx 1.0

Item {
id: root
property alias group: control.group
property alias key: control.key
property alias icon: button.icon
required property string icon_source
property string icon_source_active: icon
required property string bg_source
property string bg_source_active: bg_source

Button {
id: button
highlighted: control.value

Control {
id: control
}

onPressed: control.value ? control.value = 0.0 : control.value = 1.0

icon.source: button.highlighted ? root.icon_source_active : root.icon_source;
background: Image {
source: button.highlighted ? root.bg_source_active : root.bg_source;
}
}
}
141 changes: 141 additions & 0 deletions res/skins/qmldemo/main.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.11

Rectangle {
id: window
width: 1920
height: 1080
color: "#202020"
visible: true

Rectangle {
anchors.centerIn: parent

RowLayout {
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
anchors.fill: parent
spacing: 6

MixxxToggleButton {
width: 68
height: 26
group: "[Channel1]"
key: "play"
icon.width: 50
icon.height: 24
icon_source: "../LateNight/palemoon/buttons/btn__play_deck.svg"
icon_source_active: "../LateNight/palemoon/buttons/btn__play_deck_active.svg"
bg_source_active: "../LateNight/palemoon/buttons/btn_embedded_play_active.svg"
bg_source: "../LateNight/palemoon/buttons/btn_embedded_play.svg"
}

ColumnLayout {
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter

MixxxKnob {
width: 35
height: 35
group: "[EqualizerRack1_[Channel1]_Effect1]"
key: "parameter3"
}
MixxxKnob {
width: 35
height: 35
group: "[EqualizerRack1_[Channel1]_Effect1]"
key: "parameter2"
}
MixxxKnob {
width: 35
height: 35
group: "[EqualizerRack1_[Channel1]_Effect1]"
key: "parameter1"
}
MixxxKnob {
width: 35
height: 35
group: "[QuickEffectRack1_[Channel1]]"
key: "super1"
}
}

ColumnLayout {
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop

MixxxKnob {
width: 35
height: 35
group: "[Channel1]"
key: "pregain"
}

MixxxSlider {
width: 35
height: 100
group: "[Channel1]"
key: "volume"
}
}

ColumnLayout {
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop

MixxxKnob {
width: 35
height: 35
group: "[Channel2]"
key: "pregain"
}

MixxxSlider {
width: 42
height: 100
group: "[Channel2]"
key: "volume"
}
}

ColumnLayout {
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter

MixxxKnob {
width: 35
height: 35
group: "[EqualizerRack1_[Channel2]_Effect1]"
key: "parameter3"
}
MixxxKnob {
width: 35
height: 35
group: "[EqualizerRack1_[Channel2]_Effect1]"
key: "parameter2"
}
MixxxKnob {
width: 35
height: 35
group: "[EqualizerRack1_[Channel2]_Effect1]"
key: "parameter1"
}
MixxxKnob {
width: 35
height: 35
group: "[QuickEffectRack1_[Channel2]]"
key: "super1"
}
}

MixxxToggleButton {
width: 68
height: 26
group: "[Channel2]"
key: "play"
icon.width: 50
icon.height: 24
icon_source: "../LateNight/palemoon/buttons/btn__play_deck.svg"
icon_source_active: "../LateNight/palemoon/buttons/btn__play_deck_active.svg"
bg_source_active: "../LateNight/palemoon/buttons/btn_embedded_play_active.svg"
bg_source: "../LateNight/palemoon/buttons/btn_embedded_play.svg"
}
}
}
}
4 changes: 4 additions & 0 deletions res/skins/qmldemo/skin.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[Skin]
description = "A QML example skin."
min_pixel_width = 1920
min_pixel_height = 1080
Binary file added res/skins/qmldemo/skin_preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9ce44b6

Please sign in to comment.