forked from Shinonome/dots-hyprland
66 lines
2.1 KiB
QML
66 lines
2.1 KiB
QML
import "root:/modules/common"
|
|
import "root:/modules/common/widgets"
|
|
import "root:/services"
|
|
import Qt5Compat.GraphicalEffects
|
|
import QtQuick
|
|
import QtQuick.Controls
|
|
import QtQuick.Layouts
|
|
import Quickshell.Widgets
|
|
import Quickshell.Services.Pipewire
|
|
|
|
Button {
|
|
id: button
|
|
required property bool input
|
|
|
|
background: Rectangle {
|
|
anchors.fill: parent
|
|
radius: Appearance.rounding.small
|
|
color: (button.down) ? Appearance.colors.colLayer2Active : (button.hovered ? Appearance.colors.colLayer2Hover : Appearance.colors.colLayer2)
|
|
|
|
Behavior on color {
|
|
ColorAnimation {
|
|
duration: Appearance.animation.elementMove.duration
|
|
easing.type: Appearance.animation.elementMove.type
|
|
easing.bezierCurve: Appearance.animation.elementMove.bezierCurve
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
PointingHandInteraction {}
|
|
|
|
contentItem: RowLayout {
|
|
anchors.fill: parent
|
|
anchors.margins: 5
|
|
spacing: 5
|
|
|
|
MaterialSymbol {
|
|
Layout.alignment: Qt.AlignVCenter
|
|
Layout.fillWidth: false
|
|
Layout.leftMargin: 5
|
|
color: Appearance.colors.colOnLayer2
|
|
iconSize: Appearance.font.pixelSize.hugeass
|
|
text: input ? "mic_external_on" : "media_output"
|
|
}
|
|
|
|
ColumnLayout {
|
|
Layout.fillWidth: true
|
|
Layout.rightMargin: 5
|
|
spacing: 0
|
|
StyledText {
|
|
Layout.fillWidth: true
|
|
elide: Text.ElideRight
|
|
font.pixelSize: Appearance.font.pixelSize.normal
|
|
text: input ? qsTr("Input") : qsTr("Output")
|
|
color: Appearance.colors.colOnLayer2
|
|
}
|
|
StyledText {
|
|
Layout.fillWidth: true
|
|
elide: Text.ElideRight
|
|
font.pixelSize: Appearance.font.pixelSize.smaller
|
|
text: (input ? Pipewire.defaultAudioSource?.description : Pipewire.defaultAudioSink?.description) ?? qsTr("Unknown")
|
|
color: Appearance.m3colors.m3outline
|
|
}
|
|
}
|
|
}
|
|
} |