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 a8bde63 commit 48748d1
Show file tree
Hide file tree
Showing 5 changed files with 97 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"
}
}
}
29 changes: 29 additions & 0 deletions res/skins/qmldemo/MixxxToggleButton.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import QtQuick 2.12
import QtQuick.Controls 2.12
import Mixxx 1.0

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

Button {
id: button
highlighted: control.value

Control {
id: control
}

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

contentItem: Text {
id: label
}

background: Rectangle {
color: button.highlighted ? "#404040" : "#303030"
}
}
}
31 changes: 31 additions & 0 deletions res/skins/qmldemo/main.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
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

RowLayout {
anchors.fill: parent
spacing: 6

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

MixxxToggleButton {
width: 34
height: 22
text: "Play"
group: "[Channel1]"
key: "play"
}
}
}
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 48748d1

Please sign in to comment.