update #17
@@ -51,10 +51,6 @@ Slider {
|
||||
implicitWidth: root.implicitWidth - root.handle.x - root.handle.implicitWidth - root.implicitHeight
|
||||
radius: 1000
|
||||
topLeftRadius: root.implicitHeight / 15
|
||||
|
||||
Component.onCompleted: {
|
||||
console.log(root.handle.x, implicitWidth);
|
||||
}
|
||||
}
|
||||
}
|
||||
handle: CustomRect {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
import qs.Config
|
||||
|
||||
Item {
|
||||
id: root
|
||||
@@ -12,15 +12,13 @@ Item {
|
||||
property int gap: 40
|
||||
property alias horizontalAlignment: elideText.horizontalAlignment
|
||||
property bool leftFadeEnabled: false
|
||||
property real leftFadeStrength: overflowing && leftFadeEnabled
|
||||
? fadeStrengthMoving : fadeStrengthIdle
|
||||
property real leftFadeStrength: overflowing && leftFadeEnabled ? fadeStrengthMoving : fadeStrengthIdle
|
||||
property int leftFadeWidth: 28
|
||||
property bool marqueeEnabled: true
|
||||
readonly property bool overflowing: metrics.width > root.width
|
||||
property int pauseMs: 1200
|
||||
property real pixelsPerSecond: 40
|
||||
property real rightFadeStrength: overflowing ? fadeStrengthMoving :
|
||||
fadeStrengthIdle
|
||||
property real rightFadeStrength: overflowing ? fadeStrengthMoving : fadeStrengthIdle
|
||||
property int rightFadeWidth: 28
|
||||
property bool sliding: false
|
||||
property alias text: elideText.text
|
||||
@@ -43,7 +41,7 @@ Item {
|
||||
|
||||
onTextChanged: strip.x = 0
|
||||
onVisibleChanged: if (!visible)
|
||||
strip.x = 0
|
||||
strip.x = 0
|
||||
onWidthChanged: strip.x = 0
|
||||
|
||||
TextMetrics {
|
||||
|
||||
+8
-13
@@ -242,7 +242,8 @@ Singleton {
|
||||
brightnessIncrement: services.brightnessIncrement,
|
||||
maxVolume: services.maxVolume,
|
||||
defaultPlayer: services.defaultPlayer,
|
||||
playerAliases: services.playerAliases
|
||||
playerAliases: services.playerAliases,
|
||||
visualizerBars: services.visualizerBars
|
||||
};
|
||||
}
|
||||
|
||||
@@ -307,8 +308,7 @@ Singleton {
|
||||
|
||||
fileView.setText(JSON.stringify(config, null, 4));
|
||||
} catch (e) {
|
||||
Toaster.toast(qsTr("Failed to serialize config"), e.message,
|
||||
"settings_alert", Toast.Error);
|
||||
Toaster.toast(qsTr("Failed to serialize config"), e.message, "settings_alert", Toast.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -339,8 +339,7 @@ Singleton {
|
||||
}
|
||||
onLoadFailed: err => {
|
||||
if (err !== FileViewError.FileNotFound)
|
||||
Toaster.toast(qsTr("Failed to read config"), FileViewError.toString(err),
|
||||
"settings_alert", Toast.Warning);
|
||||
Toaster.toast(qsTr("Failed to read config"), FileViewError.toString(err), "settings_alert", Toast.Warning);
|
||||
}
|
||||
onLoaded: {
|
||||
ModeScheduler.checkStartup();
|
||||
@@ -349,19 +348,15 @@ Singleton {
|
||||
const elapsed = timer.elapsedMs();
|
||||
|
||||
if (adapter.utilities.toasts.configLoaded && !root.recentlySaved) {
|
||||
Toaster.toast(qsTr("Config loaded"), qsTr("Config loaded in %1ms").arg(
|
||||
elapsed), "rule_settings");
|
||||
Toaster.toast(qsTr("Config loaded"), qsTr("Config loaded in %1ms").arg(elapsed), "rule_settings");
|
||||
} else if (adapter.utilities.toasts.configLoaded && root.recentlySaved) {
|
||||
Toaster.toast(qsTr("Config saved"), qsTr("Config reloaded in %1ms").arg(
|
||||
elapsed), "settings_alert");
|
||||
Toaster.toast(qsTr("Config saved"), qsTr("Config reloaded in %1ms").arg(elapsed), "settings_alert");
|
||||
}
|
||||
} catch (e) {
|
||||
Toaster.toast(qsTr("Failed to load config"), e.message, "settings_alert",
|
||||
Toast.Error);
|
||||
Toaster.toast(qsTr("Failed to load config"), e.message, "settings_alert", Toast.Error);
|
||||
}
|
||||
}
|
||||
onSaveFailed: err => Toaster.toast(qsTr("Failed to save config"),
|
||||
FileViewError.toString(err), "settings_alert", Toast.Error)
|
||||
onSaveFailed: err => Toaster.toast(qsTr("Failed to save config"), FileViewError.toString(err), "settings_alert", Toast.Error)
|
||||
|
||||
JsonAdapter {
|
||||
id: adapter
|
||||
|
||||
@@ -15,5 +15,6 @@ JsonObject {
|
||||
]
|
||||
property bool useFahrenheit: false
|
||||
property bool useTwelveHourClock: Qt.locale().timeFormat(Locale.ShortFormat).toLowerCase().includes("a")
|
||||
property int visualizerBars: 30
|
||||
property string weatherLocation: ""
|
||||
}
|
||||
|
||||
+8
-1
@@ -1,15 +1,16 @@
|
||||
pragma Singleton
|
||||
|
||||
import qs.Config
|
||||
import ZShell.Services
|
||||
import ZShell
|
||||
import Quickshell
|
||||
import Quickshell.Services.Pipewire
|
||||
import QtQuick
|
||||
import qs.Config
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
readonly property alias cava: cava
|
||||
readonly property bool muted: !!sink?.audio?.muted
|
||||
readonly property var nodes: Pipewire.nodes.values.reduce((acc, node) => {
|
||||
if (!node.isStream) {
|
||||
@@ -131,6 +132,12 @@ Singleton {
|
||||
previousSourceName = newSourceName;
|
||||
}
|
||||
|
||||
CavaProvider {
|
||||
id: cava
|
||||
|
||||
bars: Config.services.visualizerBars
|
||||
}
|
||||
|
||||
PwObjectTracker {
|
||||
objects: [...root.sinks, ...root.sources, ...root.streams]
|
||||
}
|
||||
|
||||
@@ -23,9 +23,6 @@ Shape {
|
||||
anchors.topMargin: bar.implicitHeight
|
||||
preferredRendererType: Shape.CurveRenderer
|
||||
|
||||
Component.onCompleted: console.log(root.bar.implicitHeight,
|
||||
root.bar.anchors.topMargin)
|
||||
|
||||
Osd.Background {
|
||||
startX: root.width - root.panels.sidebar.width
|
||||
startY: (root.height - wrapper.height) / 2 - rounding
|
||||
|
||||
@@ -240,7 +240,6 @@ CustomMouseArea {
|
||||
if (root.visibilities.osd) {
|
||||
// OSD became visible, immediately check if this should be shortcut mode
|
||||
const inOsdArea = root.inRightPanel(root.panels.osd, root.mouseX, root.mouseY);
|
||||
console.log(inOsdArea);
|
||||
if (!inOsdArea) {
|
||||
root.osdShortcutActive = true;
|
||||
}
|
||||
|
||||
@@ -10,8 +10,6 @@ Singleton {
|
||||
let activeClass = Hypr.activeToplevel.lastIpcObject.class.toString();
|
||||
let regex = new RegExp(activeClass, "i");
|
||||
|
||||
console.log("ActiveWindow", activeWindow, "ActiveClass", activeClass, "Regex", regex);
|
||||
|
||||
const evalTitle = activeWindow.match(regex);
|
||||
callback(evalTitle);
|
||||
}
|
||||
|
||||
@@ -213,6 +213,7 @@ Item {
|
||||
radius: 1000
|
||||
|
||||
MaterialIcon {
|
||||
anchors.alignWhenCentered: false
|
||||
anchors.centerIn: parent
|
||||
color: DynamicColors.palette.m3onPrimary
|
||||
font.pointSize: 22
|
||||
|
||||
@@ -71,7 +71,6 @@ GridLayout {
|
||||
Layout.preferredWidth: 40
|
||||
color: {
|
||||
if (modelData.isToday) {
|
||||
console.log(width);
|
||||
return DynamicColors.palette.m3primaryContainer;
|
||||
}
|
||||
return "transparent";
|
||||
@@ -108,14 +107,6 @@ GridLayout {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StateLayer {
|
||||
color: DynamicColors.palette.m3onSurface
|
||||
|
||||
onClicked: {
|
||||
console.log(`Selected date: ${parent.modelData.day}/${parent.modelData.month + 1}/${parent.modelData.year}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Shapes
|
||||
@@ -34,6 +37,55 @@ Item {
|
||||
onTriggered: Players.active?.positionChanged()
|
||||
}
|
||||
|
||||
Shape {
|
||||
id: visualizer
|
||||
|
||||
readonly property real centerX: width / 2
|
||||
readonly property real centerY: height / 2
|
||||
property color colour: DynamicColors.palette.m3primary
|
||||
readonly property real innerX: cover.implicitWidth / 2 + Appearance.spacing.small
|
||||
readonly property real innerY: cover.implicitHeight / 2 + Appearance.spacing.small
|
||||
|
||||
anchors.fill: cover
|
||||
anchors.margins: -Config.dashboard.sizes.mediaVisualiserSize
|
||||
asynchronous: true
|
||||
data: visualizerBars.instances
|
||||
preferredRendererType: Shape.CurveRenderer
|
||||
}
|
||||
|
||||
Variants {
|
||||
id: visualizerBars
|
||||
|
||||
model: Array.from({
|
||||
length: Config.services.visualizerBars
|
||||
}, (_, i) => i)
|
||||
|
||||
ShapePath {
|
||||
id: visualizerBar
|
||||
|
||||
readonly property real angle: modelData * 2 * Math.PI / Config.services.visualizerBars
|
||||
readonly property real cos: Math.cos(angle)
|
||||
readonly property real magnitude: value * Config.dashboard.sizes.mediaVisualiserSize
|
||||
required property int modelData
|
||||
readonly property real sin: Math.sin(angle)
|
||||
readonly property real value: Math.max(1e-3, Math.min(1, Audio.cava.values[modelData]))
|
||||
|
||||
capStyle: Appearance.rounding.scale === 0 ? ShapePath.SquareCap : ShapePath.RoundCap
|
||||
startX: visualizer.centerX + (visualizer.innerX + strokeWidth / 2) * cos
|
||||
strokeColor: DynamicColors.palette.m3primary
|
||||
strokeWidth: 360 / Config.services.visualizerBars - Appearance.spacing.small / 4
|
||||
|
||||
startY: PathLine {
|
||||
x: visualizer.centerX + (visualizer.innerX + visualizerBar.strokeWidth / 2 + visualizerBar.magnitude) * visualizerBar.cos
|
||||
y: visualizer.centerY + (visualizer.innerY + visualizerBar.strokeWidth / 2 + visualizerBar.magnitude) * visualizerBar.sin
|
||||
}
|
||||
Behavior on strokeColor {
|
||||
CAnim {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Shape {
|
||||
preferredRendererType: Shape.CurveRenderer
|
||||
|
||||
@@ -136,31 +188,31 @@ Item {
|
||||
width: parent.width - Appearance.padding.large * 4
|
||||
}
|
||||
|
||||
CustomText {
|
||||
MarqueeText {
|
||||
id: album
|
||||
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.top: title.bottom
|
||||
anchors.topMargin: Appearance.spacing.small
|
||||
animate: true
|
||||
color: DynamicColors.palette.m3outline
|
||||
elide: Text.ElideRight
|
||||
font.pointSize: Appearance.font.size.small
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
pauseMs: 4000
|
||||
text: (Players.active?.trackAlbum ?? qsTr("No media")) || qsTr("Unknown album")
|
||||
width: parent.width - Appearance.padding.large * 4
|
||||
}
|
||||
|
||||
CustomText {
|
||||
MarqueeText {
|
||||
id: artist
|
||||
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.top: album.bottom
|
||||
anchors.topMargin: Appearance.spacing.small
|
||||
animate: true
|
||||
color: DynamicColors.palette.m3secondary
|
||||
elide: Text.ElideRight
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
pauseMs: 4000
|
||||
text: (Players.active?.trackArtist ?? qsTr("No media")) || qsTr("Unknown artist")
|
||||
width: parent.width - Appearance.padding.large * 4
|
||||
}
|
||||
|
||||
Row {
|
||||
|
||||
@@ -34,7 +34,6 @@ Item {
|
||||
|
||||
StateLayer {
|
||||
function onClicked(): void {
|
||||
console.log(root.modelData.path);
|
||||
Wallpapers.setWallpaper(root.modelData.path);
|
||||
root.visibilities.launcher = false;
|
||||
}
|
||||
|
||||
@@ -14,8 +14,6 @@ Item {
|
||||
|
||||
required property var wrapper
|
||||
|
||||
Component.onCompleted: console.log(Networking.backend.toString())
|
||||
|
||||
ColumnLayout {
|
||||
id: layout
|
||||
|
||||
|
||||
@@ -74,7 +74,6 @@ CustomRect {
|
||||
visible: Bluetooth.defaultAdapter ?? false
|
||||
|
||||
onClicked: {
|
||||
// console.log(Bluetooth.defaultAdapter)
|
||||
const adapter = Bluetooth.defaultAdapter;
|
||||
if (adapter)
|
||||
adapter.enabled = !adapter.enabled;
|
||||
|
||||
@@ -257,7 +257,6 @@ Scope {
|
||||
|
||||
onClicked: {
|
||||
panelWindow.detailsOpen = !panelWindow.detailsOpen;
|
||||
console.log(panelWindow.detailsOpen);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -300,7 +299,6 @@ Scope {
|
||||
|
||||
onClicked: {
|
||||
root.shouldShow = false;
|
||||
console.log(icon.source, icon.visible);
|
||||
polkitAgent.flow.cancelAuthenticationRequest();
|
||||
passInput.text = "";
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ Item {
|
||||
anchors.fill: parent
|
||||
|
||||
Component.onCompleted: {
|
||||
console.log(root.source);
|
||||
if (source)
|
||||
Qt.callLater(() => one.update());
|
||||
}
|
||||
|
||||
@@ -3,10 +3,10 @@ find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(Qalculate IMPORTED_TARGET libqalculate REQUIRED)
|
||||
pkg_check_modules(Pipewire IMPORTED_TARGET libpipewire-0.3 REQUIRED)
|
||||
pkg_check_modules(Aubio IMPORTED_TARGET aubio REQUIRED)
|
||||
# pkg_check_modules(Cava IMPORTED_TARGET libcava QUIET)
|
||||
# if(NOT Cava_FOUND)
|
||||
# pkg_check_modules(Cava IMPORTED_TARGET cava REQUIRED)
|
||||
# endif()
|
||||
pkg_check_modules(Cava IMPORTED_TARGET libcava QUIET)
|
||||
if(NOT Cava_FOUND)
|
||||
pkg_check_modules(Cava IMPORTED_TARGET cava REQUIRED)
|
||||
endif()
|
||||
|
||||
set(QT_QML_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/qml")
|
||||
qt_standard_project_setup(REQUIRES 6.9)
|
||||
|
||||
Reference in New Issue
Block a user