AutoFormatting
This commit is contained in:
parent
122e95955d
commit
11463e2be4
5 changed files with 81 additions and 78 deletions
|
|
@ -43,14 +43,14 @@ Row {
|
|||
const focusedWindow = CompositorService.getFocusedWindow()
|
||||
return focusedWindow ? (focusedWindow.title || focusedWindow.appId || "") : ""
|
||||
}
|
||||
|
||||
function getAppIcon() {
|
||||
const focusedWindow = CompositorService.getFocusedWindow();
|
||||
if (!focusedWindow || !focusedWindow.appId)
|
||||
return "";
|
||||
|
||||
let icon = Quickshell.iconPath(DesktopEntries.byId(focusedWindow.appId).icon);
|
||||
return icon || "";
|
||||
function getAppIcon() {
|
||||
const focusedWindow = CompositorService.getFocusedWindow()
|
||||
if (!focusedWindow || !focusedWindow.appId)
|
||||
return ""
|
||||
|
||||
let icon = Quickshell.iconPath(DesktopEntries.byId(focusedWindow.appId).icon)
|
||||
return icon || ""
|
||||
}
|
||||
|
||||
// A hidden text element to safely measure the full title width
|
||||
|
|
@ -83,19 +83,19 @@ Row {
|
|||
|
||||
// Window icon
|
||||
Item {
|
||||
width: Style.fontSizeL * scaling * 1.2
|
||||
height: Style.fontSizeL * scaling * 1.2
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: getTitle() !== "" && Settings.data.bar.showActiveWindowIcon
|
||||
width: Style.fontSizeL * scaling * 1.2
|
||||
height: Style.fontSizeL * scaling * 1.2
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: getTitle() !== "" && Settings.data.bar.showActiveWindowIcon
|
||||
|
||||
IconImage {
|
||||
id: windowIcon
|
||||
anchors.fill: parent
|
||||
source: getAppIcon()
|
||||
asynchronous: true
|
||||
smooth: true
|
||||
visible: source !== ""
|
||||
}
|
||||
IconImage {
|
||||
id: windowIcon
|
||||
anchors.fill: parent
|
||||
source: getAppIcon()
|
||||
asynchronous: true
|
||||
smooth: true
|
||||
visible: source !== ""
|
||||
}
|
||||
}
|
||||
|
||||
NText {
|
||||
|
|
|
|||
|
|
@ -44,7 +44,8 @@ Row {
|
|||
Loader {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
active: Settings.data.audio.showMiniplayerCava && Settings.data.audio.visualizerType == "linear" && MediaService.isPlaying
|
||||
active: Settings.data.audio.showMiniplayerCava && Settings.data.audio.visualizerType == "linear"
|
||||
&& MediaService.isPlaying
|
||||
z: 0
|
||||
|
||||
sourceComponent: LinearSpectrum {
|
||||
|
|
@ -58,7 +59,8 @@ Row {
|
|||
Loader {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
active: Settings.data.audio.showMiniplayerCava && Settings.data.audio.visualizerType == "mirrored" && MediaService.isPlaying
|
||||
active: Settings.data.audio.showMiniplayerCava && Settings.data.audio.visualizerType == "mirrored"
|
||||
&& MediaService.isPlaying
|
||||
z: 0
|
||||
|
||||
sourceComponent: MirroredSpectrum {
|
||||
|
|
@ -73,7 +75,8 @@ Row {
|
|||
Loader {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
active: Settings.data.audio.showMiniplayerCava && Settings.data.audio.visualizerType == "wave" && MediaService.isPlaying
|
||||
active: Settings.data.audio.showMiniplayerCava && Settings.data.audio.visualizerType == "wave"
|
||||
&& MediaService.isPlaying
|
||||
z: 0
|
||||
|
||||
sourceComponent: WaveSpectrum {
|
||||
|
|
@ -90,53 +93,53 @@ Row {
|
|||
id: row
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: Style.marginXS * scaling
|
||||
z: 1 // Above the visualizer
|
||||
z: 1 // Above the visualizer
|
||||
|
||||
NIcon {
|
||||
id: windowIcon
|
||||
text: MediaService.isPlaying ? "pause" : "play_arrow"
|
||||
font.pointSize: Style.fontSizeL * scaling
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: !Settings.data.audio.showMiniplayerAlbumArt && getTitle() !== "" && !trackArt.visible
|
||||
id: windowIcon
|
||||
text: MediaService.isPlaying ? "pause" : "play_arrow"
|
||||
font.pointSize: Style.fontSizeL * scaling
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: !Settings.data.audio.showMiniplayerAlbumArt && getTitle() !== "" && !trackArt.visible
|
||||
}
|
||||
|
||||
Column {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: Settings.data.audio.showMiniplayerAlbumArt
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: Settings.data.audio.showMiniplayerAlbumArt
|
||||
|
||||
Rectangle {
|
||||
width: 16 * scaling
|
||||
height: 16 * scaling
|
||||
radius: width * 0.5
|
||||
color: Color.transparent
|
||||
antialiasing: true
|
||||
clip: true
|
||||
Rectangle {
|
||||
width: 16 * scaling
|
||||
height: 16 * scaling
|
||||
radius: width * 0.5
|
||||
color: Color.transparent
|
||||
antialiasing: true
|
||||
clip: true
|
||||
|
||||
NImageRounded {
|
||||
id: trackArt
|
||||
visible: MediaService.trackArtUrl.toString() !== ""
|
||||
anchors.fill: parent
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.margins: scaling
|
||||
imagePath: MediaService.trackArtUrl
|
||||
fallbackIcon: MediaService.isPlaying ? "pause" : "play_arrow"
|
||||
borderWidth: 0
|
||||
border.color: Color.transparent
|
||||
imageRadius: width
|
||||
antialiasing: true
|
||||
}
|
||||
|
||||
// Fallback icon when no album art available
|
||||
NIcon {
|
||||
id: windowIconFallback
|
||||
text: MediaService.isPlaying ? "pause" : "play_arrow"
|
||||
font.pointSize: Style.fontSizeL * scaling
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: getTitle() !== "" && !trackArt.visible
|
||||
}
|
||||
NImageRounded {
|
||||
id: trackArt
|
||||
visible: MediaService.trackArtUrl.toString() !== ""
|
||||
anchors.fill: parent
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.margins: scaling
|
||||
imagePath: MediaService.trackArtUrl
|
||||
fallbackIcon: MediaService.isPlaying ? "pause" : "play_arrow"
|
||||
borderWidth: 0
|
||||
border.color: Color.transparent
|
||||
imageRadius: width
|
||||
antialiasing: true
|
||||
}
|
||||
|
||||
// Fallback icon when no album art available
|
||||
NIcon {
|
||||
id: windowIconFallback
|
||||
text: MediaService.isPlaying ? "pause" : "play_arrow"
|
||||
font.pointSize: Style.fontSizeL * scaling
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: getTitle() !== "" && !trackArt.visible
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NText {
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ Loader {
|
|||
function getAppIcon(toplevel: Toplevel): string {
|
||||
if (!toplevel)
|
||||
return ""
|
||||
let icon = Quickshell.iconPath(DesktopEntries.byId(toplevel.appId?.toLowerCase()).icon);
|
||||
let icon = Quickshell.iconPath(DesktopEntries.byId(toplevel.appId?.toLowerCase()).icon)
|
||||
return icon || Quickshell.iconPath("application-x-executable", true)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ ColumnLayout {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Divider
|
||||
NDivider {
|
||||
Layout.fillWidth: true
|
||||
|
|
@ -242,24 +242,23 @@ ColumnLayout {
|
|||
|
||||
// Miniplayer section
|
||||
NToggle {
|
||||
label: "Show Album Art In Bar Media Player"
|
||||
description: "Show the album art of the currently playing song next to the title."
|
||||
checked: Settings.data.audio.showMiniplayerAlbumArt
|
||||
onToggled: checked => {
|
||||
Settings.data.audio.showMiniplayerAlbumArt = checked
|
||||
}
|
||||
label: "Show Album Art In Bar Media Player"
|
||||
description: "Show the album art of the currently playing song next to the title."
|
||||
checked: Settings.data.audio.showMiniplayerAlbumArt
|
||||
onToggled: checked => {
|
||||
Settings.data.audio.showMiniplayerAlbumArt = checked
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
NToggle {
|
||||
label: "Show Audio Visualizer In Bar Media Player"
|
||||
description: "Shows an audio visualizer in the background of the miniplayer."
|
||||
checked: Settings.data.audio.showMiniplayerCava
|
||||
onToggled: checked => {
|
||||
Settings.data.audio.showMiniplayerCava = checked
|
||||
}
|
||||
label: "Show Audio Visualizer In Bar Media Player"
|
||||
description: "Shows an audio visualizer in the background of the miniplayer."
|
||||
checked: Settings.data.audio.showMiniplayerCava
|
||||
onToggled: checked => {
|
||||
Settings.data.audio.showMiniplayerCava = checked
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Divider
|
||||
NDivider {
|
||||
|
|
|
|||
|
|
@ -37,7 +37,8 @@ Singleton {
|
|||
Process {
|
||||
id: process
|
||||
stdinEnabled: true
|
||||
running: (Settings.data.audio.visualizerType !== "none") && (PanelService.sidePanel.active || Settings.data.audio.showMiniplayerCava)
|
||||
running: (Settings.data.audio.visualizerType !== "none") && (PanelService.sidePanel.active
|
||||
|| Settings.data.audio.showMiniplayerCava)
|
||||
command: ["cava", "-p", "/dev/stdin"]
|
||||
onExited: {
|
||||
stdinEnabled = true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue