Huge quickshell progress dump
Was requested
This commit is contained in:
parent
57d9f9a72e
commit
945793973e
42 changed files with 2140 additions and 142 deletions
|
|
@ -0,0 +1,78 @@
|
|||
import QtQuick
|
||||
import Quickshell.Services.Pipewire
|
||||
import ".."
|
||||
|
||||
ClickableIcon {
|
||||
id: root
|
||||
required property var bar;
|
||||
required property PwNode node;
|
||||
property bool mixerOpen: false;
|
||||
|
||||
PwObjectTracker { objects: [ node ] }
|
||||
|
||||
implicitHeight: width;
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton;
|
||||
showPressed: mixerOpen
|
||||
|
||||
onClicked: event => {
|
||||
event.accepted = true;
|
||||
if (event.button === Qt.LeftButton) {
|
||||
node.audio.muted = !node.audio.muted;
|
||||
} else if (event.button === Qt.RightButton) {
|
||||
mixerOpen = !mixerOpen;
|
||||
}
|
||||
}
|
||||
|
||||
onWheel: event => {
|
||||
event.accepted = true;
|
||||
node.audio.volume += (event.angleDelta.y / 120) * 0.05
|
||||
}
|
||||
|
||||
property var tooltip: TooltipItem {
|
||||
tooltip: bar.tooltip
|
||||
owner: root
|
||||
|
||||
show: root.containsMouse || mouseArea.containsMouse
|
||||
hoverable: true
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
hoverEnabled: true
|
||||
acceptedButtons: Qt.NoButton
|
||||
|
||||
implicitWidth: childrenRect.width
|
||||
implicitHeight: childrenRect.height
|
||||
|
||||
VolumeSlider {
|
||||
implicitWidth: 200
|
||||
implicitHeight: root.height
|
||||
|
||||
//enabled: !node.audio.muted
|
||||
value: node.audio.volume
|
||||
onValueChanged: node.audio.volume = value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
property var rightclickMenu: TooltipItem {
|
||||
tooltip: bar.tooltip
|
||||
owner: root
|
||||
|
||||
isMenu: true
|
||||
show: mixerOpen
|
||||
|
||||
onClose: mixerOpen = false
|
||||
/*onVisibleChanged: {
|
||||
if (!visible) mixerOpen = false;
|
||||
}*/
|
||||
|
||||
Loader {
|
||||
active: rightclickMenu.visible
|
||||
sourceComponent: Mixer {
|
||||
width: 550
|
||||
trackedNode: node
|
||||
nodeImage: root.image
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Services.Pipewire
|
||||
import ".."
|
||||
|
||||
BarWidgetInner {
|
||||
id: root
|
||||
required property var bar;
|
||||
implicitHeight: column.implicitHeight + 10;
|
||||
|
||||
ColumnLayout {
|
||||
anchors {
|
||||
fill: parent;
|
||||
margins: 5;
|
||||
}
|
||||
|
||||
id: column;
|
||||
implicitHeight: childrenRect.height;
|
||||
spacing: 5;
|
||||
|
||||
Loader {
|
||||
Layout.fillWidth: true;
|
||||
active: Pipewire.defaultAudioSink != null;
|
||||
|
||||
sourceComponent: AudioControl {
|
||||
bar: root.bar;
|
||||
node: Pipewire.defaultAudioSink;
|
||||
image: `image://icon/${node.audio.muted ? "audio-volume-muted-symbolic" : "audio-volume-high-symbolic"}`
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
Layout.fillWidth: true;
|
||||
active: Pipewire.defaultAudioSource != null;
|
||||
|
||||
sourceComponent: AudioControl {
|
||||
bar: root.bar;
|
||||
node: Pipewire.defaultAudioSource;
|
||||
image: `image://icon/${node.audio.muted ? "microphone-sensitivity-muted-symbolic" : "microphone-sensitivity-high-symbolic"}`
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
56
modules/user/modules/quickshell/shell/bar/audio/Mixer.qml
Normal file
56
modules/user/modules/quickshell/shell/bar/audio/Mixer.qml
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell.Services.Pipewire
|
||||
import ".."
|
||||
import "../.."
|
||||
|
||||
ColumnLayout {
|
||||
required property PwNode trackedNode;
|
||||
required property string nodeImage;
|
||||
|
||||
PwNodeLinkTracker {
|
||||
id: linkTracker
|
||||
node: trackedNode
|
||||
}
|
||||
|
||||
PwObjectTracker { objects: [ trackedNode, ...linkTracker.linkGroups ] }
|
||||
|
||||
MixerEntry {
|
||||
id: nodeEntry
|
||||
node: trackedNode
|
||||
image: nodeImage
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
Layout.fillWidth: true
|
||||
implicitHeight: 1
|
||||
visible: linkTracker.linkGroups.length > 0
|
||||
|
||||
color: ShellGlobals.colors.separator
|
||||
}
|
||||
|
||||
Repeater {
|
||||
model: linkTracker.linkGroups
|
||||
|
||||
MixerEntry {
|
||||
required property PwLinkGroup modelData;
|
||||
node: trackedNode.isSink ? modelData.source : modelData.target;
|
||||
state: modelData.state;
|
||||
|
||||
image: {
|
||||
let icon = "";
|
||||
let props = node.properties;
|
||||
if (props["application.icon-name"] != undefined) {
|
||||
icon = props["application.icon-name"];
|
||||
} else if (props["application.process.binary"] != undefined) {
|
||||
icon = props["application.process.binary"];
|
||||
}
|
||||
|
||||
// special cases :(
|
||||
if (icon == "firefox") icon = "firefox-devedition";
|
||||
|
||||
return `image://icon/${icon}`
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell.Services.Pipewire
|
||||
import ".."
|
||||
|
||||
RowLayout {
|
||||
id: root
|
||||
required property PwNode node;
|
||||
required property string image;
|
||||
property int state: PwLinkState.Unlinked;
|
||||
|
||||
PwObjectTracker { objects: [ node ] }
|
||||
|
||||
ClickableIcon {
|
||||
image: root.image
|
||||
asynchronous: true
|
||||
implicitHeight: 40
|
||||
implicitWidth: height
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
RowLayout {
|
||||
Item {
|
||||
implicitHeight: title.implicitHeight
|
||||
Layout.fillWidth: true
|
||||
|
||||
Text {
|
||||
id: title
|
||||
color: "white"
|
||||
anchors.fill: parent
|
||||
elide: Text.ElideRight
|
||||
text: {
|
||||
const name = node.properties["application.name"] ?? (node.description == "" ? node.name : node.description);
|
||||
const mediaName = node.properties["media.name"];
|
||||
|
||||
return mediaName != undefined ? `${name} - ${mediaName}` : name;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
VolumeSlider {
|
||||
//Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
implicitWidth: 200
|
||||
|
||||
value: node.audio.volume
|
||||
onValueChanged: node.audio.volume = value
|
||||
}
|
||||
}
|
||||
}
|
||||
109
modules/user/modules/quickshell/shell/bar/audio/VolumeSlider.qml
Normal file
109
modules/user/modules/quickshell/shell/bar/audio/VolumeSlider.qml
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
import QtQuick
|
||||
import QtQuick.Shapes
|
||||
|
||||
Item {
|
||||
id: root
|
||||
property real from: 0.0
|
||||
property real to: 1.5
|
||||
property real warning: 1.0
|
||||
property real value: 0.0
|
||||
|
||||
implicitWidth: groove.implicitWidth
|
||||
implicitHeight: 20
|
||||
|
||||
property real __valueOffset: ((value - from) / (to - from)) * groove.width
|
||||
property real __wheelValue: -1
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
anchors.fill: parent
|
||||
|
||||
Rectangle {
|
||||
id: grooveWarning
|
||||
|
||||
anchors {
|
||||
left: groove.left
|
||||
leftMargin: ((warning - from) / (to - from)) * groove.width
|
||||
right: groove.right
|
||||
top: groove.top
|
||||
bottom: groove.bottom
|
||||
}
|
||||
|
||||
color: "#60ffa800"
|
||||
topRightRadius: 5
|
||||
bottomRightRadius: 5
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors {
|
||||
top: groove.bottom
|
||||
horizontalCenter: grooveWarning.left
|
||||
}
|
||||
|
||||
color: "#60eeffff"
|
||||
width: 1
|
||||
height: groove.height
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: grooveFill
|
||||
|
||||
anchors {
|
||||
left: groove.left
|
||||
top: groove.top
|
||||
bottom: groove.bottom
|
||||
}
|
||||
|
||||
radius: 5
|
||||
color: "#80ceffff"
|
||||
width: __valueOffset
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: groove
|
||||
|
||||
anchors {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
implicitHeight: 7
|
||||
color: "transparent"
|
||||
border.color: "#20050505"
|
||||
border.width: 1
|
||||
radius: 5
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: handle
|
||||
anchors.verticalCenter: groove.verticalCenter
|
||||
height: 15
|
||||
width: height
|
||||
radius: height * 0.5
|
||||
x: __valueOffset - width * 0.5
|
||||
}
|
||||
|
||||
onWheel: event => {
|
||||
event.accepted = true;
|
||||
__wheelValue = value + (event.angleDelta.y / 120) * 0.05
|
||||
__wheelValue = -1
|
||||
}
|
||||
}
|
||||
|
||||
Binding {
|
||||
when: mouseArea.pressed
|
||||
target: root
|
||||
property: "value"
|
||||
value: (mouseArea.mouseX / width) * (to - from) + from
|
||||
restoreMode: Binding.RestoreBinding
|
||||
}
|
||||
|
||||
Binding {
|
||||
when: __wheelValue != -1
|
||||
target: root
|
||||
property: "value"
|
||||
value: __wheelValue
|
||||
restoreMode: Binding.RestoreBinding
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" height="48px" viewBox="0 -960 960 960" width="48px" fill="#e8eaed"><path d="M806-56 677.67-184.33q-27 18.66-58 32.16-31 13.5-64.34 21.17v-68.67q20-6.33 38.84-13.66 18.83-7.34 35.5-19l-154.34-155V-160l-200-200h-160v-240H262L51.33-810.67 98.67-858l754.66 754L806-56Zm-26.67-232-48-48q19-33 28.17-69.62 9.17-36.61 9.17-75.38 0-100.22-58.34-179.11Q652-739 555.33-762.33V-831q124 28 202 125.5t78 224.5q0 51.67-14.16 100.67-14.17 49-41.84 92.33Zm-134-134-90-90v-130q47 22 73.5 66t26.5 96q0 15-2.5 29.5t-7.5 28.5Zm-170-170-104-104 104-104v208Zm-66.66 270v-131.33l-80-80H182v106.66h122L408.67-322Zm-40-171.33Z"/></svg>
|
||||
|
After Width: | Height: | Size: 650 B |
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" height="48px" viewBox="0 -960 960 960" width="48px" fill="#e8eaed"><path d="M560-131v-68.67q94.67-27.33 154-105 59.33-77.66 59.33-176.33 0-98.67-59-176.67-59-78-154.33-104.66V-831q124 28 202 125.5T840-481q0 127-78 224.5T560-131ZM120-360v-240h160l200-200v640L280-360H120Zm426.67 45.33v-332Q599-628 629.5-582T660-480q0 55-30.83 100.83-30.84 45.84-82.5 64.5ZM413.33-634l-104 100.67H186.67v106.66h122.66l104 101.34V-634Zm-96 154Z"/></svg>
|
||||
|
After Width: | Height: | Size: 474 B |
Loading…
Add table
Add a link
Reference in a new issue