forked from Shinonome/dots-hyprland
Merge branch 'ii-qs' into ii-qs-patch-1
This commit is contained in:
@@ -5,6 +5,7 @@ import QtQuick.Layouts
|
|||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Io
|
import Quickshell.Io
|
||||||
import Quickshell.Hyprland
|
import Quickshell.Hyprland
|
||||||
|
import Quickshell.Services.Pipewire
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: root
|
id: root
|
||||||
@@ -21,48 +22,68 @@ Rectangle {
|
|||||||
spacing: 4
|
spacing: 4
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|
||||||
CircleUtilButton {
|
Loader {
|
||||||
Layout.alignment: Qt.AlignVCenter
|
active: ConfigOptions.bar.utilButtons.showScreenSnip
|
||||||
onClicked: Hyprland.dispatch("exec hyprshot --freeze --clipboard-only --mode region --silent")
|
visible: ConfigOptions.bar.utilButtons.showScreenSnip
|
||||||
|
sourceComponent: CircleUtilButton {
|
||||||
MaterialSymbol {
|
Layout.alignment: Qt.AlignVCenter
|
||||||
horizontalAlignment: Qt.AlignHCenter
|
onClicked: Hyprland.dispatch("exec hyprshot --freeze --clipboard-only --mode region --silent")
|
||||||
fill: 1
|
MaterialSymbol {
|
||||||
text: "screenshot_region"
|
horizontalAlignment: Qt.AlignHCenter
|
||||||
iconSize: Appearance.font.pixelSize.large
|
fill: 1
|
||||||
color: Appearance.colors.colOnLayer2
|
text: "screenshot_region"
|
||||||
|
iconSize: Appearance.font.pixelSize.large
|
||||||
|
color: Appearance.colors.colOnLayer2
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// CircleUtilButton {
|
Loader {
|
||||||
// Layout.alignment: Qt.AlignVCenter
|
active: ConfigOptions.bar.utilButtons.showColorPicker
|
||||||
// onClicked: Hyprland.dispatch("exec hyprpicker -a")
|
visible: ConfigOptions.bar.utilButtons.showColorPicker
|
||||||
|
sourceComponent: CircleUtilButton {
|
||||||
|
Layout.alignment: Qt.AlignVCenter
|
||||||
|
onClicked: Hyprland.dispatch("exec hyprpicker -a")
|
||||||
|
MaterialSymbol {
|
||||||
|
horizontalAlignment: Qt.AlignHCenter
|
||||||
|
fill: 1
|
||||||
|
text: "colorize"
|
||||||
|
iconSize: Appearance.font.pixelSize.large
|
||||||
|
color: Appearance.colors.colOnLayer2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// MaterialSymbol {
|
Loader {
|
||||||
// horizontalAlignment: Qt.AlignHCenter
|
active: ConfigOptions.bar.utilButtons.showKeyboardToggle
|
||||||
// fill: 1
|
visible: ConfigOptions.bar.utilButtons.showKeyboardToggle
|
||||||
// text: "colorize"
|
sourceComponent: CircleUtilButton {
|
||||||
// iconSize: Appearance.font.pixelSize.large
|
Layout.alignment: Qt.AlignVCenter
|
||||||
// color: Appearance.colors.colOnLayer2
|
onClicked: Hyprland.dispatch("global quickshell:oskToggle")
|
||||||
// }
|
MaterialSymbol {
|
||||||
|
horizontalAlignment: Qt.AlignHCenter
|
||||||
// }
|
fill: 0
|
||||||
|
text: "keyboard"
|
||||||
CircleUtilButton {
|
iconSize: Appearance.font.pixelSize.large
|
||||||
Layout.alignment: Qt.AlignVCenter
|
color: Appearance.colors.colOnLayer2
|
||||||
onClicked: Hyprland.dispatch("global quickshell:oskToggle")
|
}
|
||||||
|
|
||||||
MaterialSymbol {
|
|
||||||
horizontalAlignment: Qt.AlignHCenter
|
|
||||||
fill: 0
|
|
||||||
text: "keyboard"
|
|
||||||
iconSize: Appearance.font.pixelSize.large
|
|
||||||
color: Appearance.colors.colOnLayer2
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loader {
|
||||||
|
active: ConfigOptions.bar.utilButtons.showMicToggle
|
||||||
|
visible: ConfigOptions.bar.utilButtons.showMicToggle
|
||||||
|
sourceComponent: CircleUtilButton {
|
||||||
|
Layout.alignment: Qt.AlignVCenter
|
||||||
|
onClicked: Hyprland.dispatch("exec wpctl set-mute @DEFAULT_SOURCE@ toggle")
|
||||||
|
MaterialSymbol {
|
||||||
|
horizontalAlignment: Qt.AlignHCenter
|
||||||
|
fill: 0
|
||||||
|
text: Pipewire.defaultAudioSource?.audio?.muted ? "mic_off" : "mic"
|
||||||
|
iconSize: Appearance.font.pixelSize.large
|
||||||
|
color: Appearance.colors.colOnLayer2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,6 +49,12 @@ Singleton {
|
|||||||
"HDMI-A-1",
|
"HDMI-A-1",
|
||||||
"DP-1"
|
"DP-1"
|
||||||
]
|
]
|
||||||
|
property QtObject utilButtons: QtObject {
|
||||||
|
property bool showScreenSnip: true
|
||||||
|
property bool showColorPicker: false
|
||||||
|
property bool showMicToggle: false
|
||||||
|
property bool showKeyboardToggle: true
|
||||||
|
}
|
||||||
property QtObject workspaces: QtObject {
|
property QtObject workspaces: QtObject {
|
||||||
property int shown: 10
|
property int shown: 10
|
||||||
property bool alwaysShowNumbers: false
|
property bool alwaysShowNumbers: false
|
||||||
|
|||||||
@@ -18,6 +18,14 @@ ProgressBar {
|
|||||||
property real valueBarGap: 4
|
property real valueBarGap: 4
|
||||||
property color highlightColor: Appearance?.colors.colPrimary ?? "#685496"
|
property color highlightColor: Appearance?.colors.colPrimary ?? "#685496"
|
||||||
property color trackColor: Appearance?.m3colors.m3secondaryContainer ?? "#F1D3F9"
|
property color trackColor: Appearance?.m3colors.m3secondaryContainer ?? "#F1D3F9"
|
||||||
|
property bool sperm: false // If true, the progress bar will have a wavy fill effect
|
||||||
|
property real waveAmplitude: sperm ? 3 : 0
|
||||||
|
property real frequency: 8
|
||||||
|
property real spermFps: 60
|
||||||
|
|
||||||
|
Behavior on waveAmplitude {
|
||||||
|
animation: Appearance?.animation.elementMoveFast.numberAnimation.createObject(this)
|
||||||
|
}
|
||||||
|
|
||||||
Behavior on value {
|
Behavior on value {
|
||||||
animation: Appearance?.animation.elementMoveEnter.numberAnimation.createObject(this)
|
animation: Appearance?.animation.elementMoveEnter.numberAnimation.createObject(this)
|
||||||
@@ -35,11 +43,49 @@ ProgressBar {
|
|||||||
implicitWidth: parent.width
|
implicitWidth: parent.width
|
||||||
implicitHeight: parent.height
|
implicitHeight: parent.height
|
||||||
|
|
||||||
Rectangle { // Left progress fill
|
Canvas {
|
||||||
width: root.visualPosition * parent.width
|
id: wavyFill
|
||||||
height: parent.height
|
anchors {
|
||||||
radius: Appearance?.rounding.full ?? 9999
|
left: parent.left
|
||||||
color: root.highlightColor
|
right: parent.right
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
height: parent.height * 6
|
||||||
|
onPaint: {
|
||||||
|
var ctx = getContext("2d");
|
||||||
|
ctx.clearRect(0, 0, width, height);
|
||||||
|
|
||||||
|
var progress = root.visualPosition;
|
||||||
|
var fillWidth = progress * width;
|
||||||
|
var amplitude = root.waveAmplitude
|
||||||
|
var frequency = root.frequency;
|
||||||
|
var phase = Date.now() / 400.0;
|
||||||
|
var centerY = height / 2;
|
||||||
|
|
||||||
|
ctx.strokeStyle = root.highlightColor;
|
||||||
|
ctx.lineWidth = parent.height;
|
||||||
|
ctx.lineCap = "round";
|
||||||
|
ctx.beginPath();
|
||||||
|
for (var x = ctx.lineWidth / 2; x <= fillWidth; x += 1) {
|
||||||
|
var waveY = centerY + amplitude * Math.sin(frequency * 2 * Math.PI * x / width + phase);
|
||||||
|
if (x === 0)
|
||||||
|
ctx.moveTo(x, waveY);
|
||||||
|
else
|
||||||
|
ctx.lineTo(x, waveY);
|
||||||
|
}
|
||||||
|
ctx.stroke();
|
||||||
|
}
|
||||||
|
Connections {
|
||||||
|
target: root
|
||||||
|
function onValueChanged() { wavyFill.requestPaint(); }
|
||||||
|
function onHighlightColorChanged() { wavyFill.requestPaint(); }
|
||||||
|
}
|
||||||
|
Timer {
|
||||||
|
interval: 1000 / root.spermFps
|
||||||
|
running: root.sperm
|
||||||
|
repeat: root.sperm
|
||||||
|
onTriggered: wavyFill.requestPaint()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Rectangle { // Right remaining part fill
|
Rectangle { // Right remaining part fill
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ Canvas { // Visualizer
|
|||||||
}
|
}
|
||||||
root.smoothPoints.push(sum / count);
|
root.smoothPoints.push(sum / count);
|
||||||
}
|
}
|
||||||
if (!root.live) smoothedPoints.fill(0); // If not playing, show no points
|
if (!root.live) root.smoothPoints.fill(0); // If not playing, show no points
|
||||||
|
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
ctx.moveTo(0, h);
|
ctx.moveTo(0, h);
|
||||||
|
|||||||
@@ -259,6 +259,7 @@ Item { // Player instance
|
|||||||
highlightColor: blendedColors.colPrimary
|
highlightColor: blendedColors.colPrimary
|
||||||
trackColor: blendedColors.colSecondaryContainer
|
trackColor: blendedColors.colSecondaryContainer
|
||||||
value: playerController.player?.position / playerController.player?.length
|
value: playerController.player?.position / playerController.player?.length
|
||||||
|
sperm: playerController.player?.isPlaying
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TrackChangeButton {
|
TrackChangeButton {
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ Item {
|
|||||||
|
|
||||||
Process {
|
Process {
|
||||||
id: translateProc
|
id: translateProc
|
||||||
command: ["bash", "-c", `trans -no-theme`
|
command: ["bash", "-c", `trans -no-theme -no-bidi`
|
||||||
+ ` -source '${StringUtils.shellSingleQuoteEscape(root.sourceLanguage)}'`
|
+ ` -source '${StringUtils.shellSingleQuoteEscape(root.sourceLanguage)}'`
|
||||||
+ ` -target '${StringUtils.shellSingleQuoteEscape(root.targetLanguage)}'`
|
+ ` -target '${StringUtils.shellSingleQuoteEscape(root.targetLanguage)}'`
|
||||||
+ ` -no-ansi '${StringUtils.shellSingleQuoteEscape(root.inputField.text.trim())}'`]
|
+ ` -no-ansi '${StringUtils.shellSingleQuoteEscape(root.inputField.text.trim())}'`]
|
||||||
@@ -82,7 +82,7 @@ Item {
|
|||||||
|
|
||||||
Process {
|
Process {
|
||||||
id: getLanguagesProc
|
id: getLanguagesProc
|
||||||
command: ["trans", "-list-languages"]
|
command: ["trans", "-list-languages", "-no-bidi"]
|
||||||
property list<string> bufferList: ["auto"]
|
property list<string> bufferList: ["auto"]
|
||||||
running: true
|
running: true
|
||||||
stdout: SplitParser {
|
stdout: SplitParser {
|
||||||
|
|||||||
Reference in New Issue
Block a user