quickshell: should be everything I want now
This commit is contained in:
@@ -33,7 +33,7 @@ Scope {
|
||||
screen: modelData
|
||||
WlrLayershell.namespace: "quickshell-bar"
|
||||
color: Colors.transparent
|
||||
implicitHeight: 45
|
||||
implicitHeight: Style.barHeight
|
||||
|
||||
anchors {
|
||||
left: true
|
||||
@@ -94,6 +94,9 @@ Scope {
|
||||
SymbolButton {
|
||||
symbol: Icons.distro
|
||||
buttonColor: Colors.distroColor
|
||||
onClicked: {
|
||||
PanelService.getPanel("controlCenterPanel")?.toggle(this)
|
||||
}
|
||||
onRightClicked: {
|
||||
if (action.running) {
|
||||
action.signal(15);
|
||||
@@ -164,37 +167,49 @@ Scope {
|
||||
rightMargin: 5
|
||||
}
|
||||
|
||||
NetworkSpeed {
|
||||
RowLayout {
|
||||
id: monitorsLayout
|
||||
visible: !SettingsService.showLyricsBar
|
||||
|
||||
height: parent.height
|
||||
NetworkSpeed {
|
||||
}
|
||||
|
||||
Separator {
|
||||
}
|
||||
|
||||
Item {
|
||||
width: 10
|
||||
}
|
||||
|
||||
Ip {
|
||||
showCountryCode: true
|
||||
}
|
||||
|
||||
CpuTemp {
|
||||
}
|
||||
|
||||
MemUsage {
|
||||
}
|
||||
|
||||
CpuUsage {
|
||||
}
|
||||
|
||||
Battery {
|
||||
}
|
||||
|
||||
Brightness {
|
||||
screen: modelData
|
||||
}
|
||||
|
||||
Volume {
|
||||
}
|
||||
}
|
||||
|
||||
Separator {
|
||||
}
|
||||
|
||||
Item {
|
||||
width: 10
|
||||
}
|
||||
|
||||
Ip {
|
||||
showCountryCode: true
|
||||
}
|
||||
|
||||
CpuTemp {
|
||||
}
|
||||
|
||||
MemUsage {
|
||||
}
|
||||
|
||||
CpuUsage {
|
||||
}
|
||||
|
||||
Battery {
|
||||
}
|
||||
|
||||
Brightness {
|
||||
screen: modelData
|
||||
}
|
||||
|
||||
Volume {
|
||||
LyricsBar {
|
||||
id: lyricsBar
|
||||
visible: SettingsService.showLyricsBar
|
||||
width: 600
|
||||
}
|
||||
|
||||
Item {
|
||||
|
||||
@@ -2,8 +2,8 @@ import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import qs.Constants
|
||||
import qs.Modules.Misc
|
||||
import qs.Services
|
||||
import qs.Utils
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
@@ -78,7 +78,7 @@ Item {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
font.pointSize: Fonts.medium
|
||||
font.family: Fonts.primary
|
||||
color: Colors.accent
|
||||
color: Colors.primary
|
||||
|
||||
Process {
|
||||
id: action
|
||||
|
||||
@@ -29,7 +29,7 @@ Item {
|
||||
|
||||
Text {
|
||||
text: Icons.global
|
||||
font.pointSize: Fonts.icon + 5
|
||||
font.pointSize: Fonts.icon + 6
|
||||
color: Colors.peach
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ Item {
|
||||
|
||||
Behavior on implicitWidth {
|
||||
NumberAnimation {
|
||||
duration: 200
|
||||
duration: Style.animationFast
|
||||
easing.type: Easing.InOutCubic
|
||||
}
|
||||
|
||||
|
||||
88
quickshell/Modules/Bar/Components/LyricsBar.qml
Normal file
88
quickshell/Modules/Bar/Components/LyricsBar.qml
Normal file
@@ -0,0 +1,88 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import qs.Constants
|
||||
import qs.Noctalia
|
||||
import qs.Services
|
||||
|
||||
Rectangle {
|
||||
implicitHeight: parent.height
|
||||
radius: Style.radiusS
|
||||
color: Colors.base
|
||||
border.color: Colors.primary
|
||||
border.width: Style.borderS
|
||||
|
||||
Connections {
|
||||
target: SettingsService
|
||||
onShowLyricsBarChanged: {
|
||||
visible = SettingsService.showLyricsBar;
|
||||
if (visible)
|
||||
LyricsService.startSyncing();
|
||||
else
|
||||
LyricsService.stopSyncing();
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: Style.marginM
|
||||
anchors.rightMargin: Style.marginM
|
||||
spacing: Style.marginS
|
||||
|
||||
Item {
|
||||
implicitWidth: parent.width - slowerButton.implicitWidth * 3 - parent.spacing * 3 - parent.anchors.leftMargin - parent.anchors.rightMargin
|
||||
Layout.fillHeight: true
|
||||
clip: true
|
||||
|
||||
NText {
|
||||
text: LyricsService.lyrics[LyricsService.currentIndex] || ""
|
||||
family: Fonts.sans
|
||||
pointSize: Style.fontSizeS
|
||||
maximumLineCount: 1
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
NIconButton {
|
||||
id: slowerButton
|
||||
|
||||
baseSize: 24
|
||||
colorBg: Color.transparent
|
||||
colorBgHover: Colors.blue
|
||||
colorFg: Colors.blue
|
||||
icon: "rotate-2"
|
||||
onClicked: {
|
||||
LyricsService.increaseOffset();
|
||||
}
|
||||
}
|
||||
|
||||
NIconButton {
|
||||
id: playPauseButton
|
||||
|
||||
baseSize: 24
|
||||
colorBg: Color.transparent
|
||||
colorBgHover: Colors.yellow
|
||||
colorFg: Colors.yellow
|
||||
icon: "rotate-clockwise-2"
|
||||
onClicked: {
|
||||
LyricsService.decreaseOffset();
|
||||
}
|
||||
}
|
||||
|
||||
NIconButton {
|
||||
id: nextButton
|
||||
|
||||
baseSize: 24
|
||||
colorBg: Color.transparent
|
||||
colorBgHover: Colors.green
|
||||
colorFg: Colors.green
|
||||
icon: "rotate-clockwise"
|
||||
onClicked: {
|
||||
LyricsService.resetOffset();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -19,15 +19,15 @@ Item {
|
||||
Text {
|
||||
text: Icons.download
|
||||
font.pointSize: Fonts.icon - 3
|
||||
color: Colors.accent
|
||||
color: Colors.primary
|
||||
Layout.leftMargin: 10
|
||||
}
|
||||
|
||||
Text {
|
||||
text: SystemStatService.formatSpeed(SystemStatService.txSpeed)
|
||||
text: SystemStatService.formatSpeed(SystemStatService.rxSpeed)
|
||||
font.pointSize: Fonts.medium
|
||||
font.family: Fonts.primary
|
||||
color: Colors.accent
|
||||
color: Colors.primary
|
||||
}
|
||||
|
||||
Item {
|
||||
@@ -37,14 +37,14 @@ Item {
|
||||
Text {
|
||||
text: Icons.upload
|
||||
font.pointSize: Fonts.icon - 3
|
||||
color: Colors.accent
|
||||
color: Colors.primary
|
||||
}
|
||||
|
||||
Text {
|
||||
text: SystemStatService.formatSpeed(SystemStatService.rxSpeed)
|
||||
text: SystemStatService.formatSpeed(SystemStatService.txSpeed)
|
||||
font.pointSize: Fonts.medium
|
||||
font.family: Fonts.primary
|
||||
color: Colors.accent
|
||||
color: Colors.primary
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,5 +6,13 @@ Text {
|
||||
text: TimeService.time + " | " + TimeService.dateString
|
||||
font.pointSize: Fonts.medium
|
||||
font.family: Fonts.primary
|
||||
color: Colors.accent
|
||||
color: Colors.primary
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
PanelService.getPanel("calendarPanel")?.toggle(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,15 +16,15 @@ Item {
|
||||
property ListModel localWorkspaces
|
||||
property real masterProgress: 0
|
||||
property bool effectsActive: false
|
||||
property color effectColor: Colors.accent
|
||||
property color effectColor: Colors.primary
|
||||
property int horizontalPadding: 16
|
||||
property int spacingBetweenPills: 8
|
||||
property bool isDestroying: false
|
||||
|
||||
signal workspaceChanged(int workspaceId, color accentColor)
|
||||
signal workspaceChanged(int workspaceId, color primaryColor)
|
||||
|
||||
function triggerUnifiedWave() {
|
||||
effectColor = Colors.accent;
|
||||
effectColor = Colors.primary;
|
||||
masterAnimation.restart();
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ Item {
|
||||
const ws = localWorkspaces.get(i);
|
||||
if (ws.isFocused === true) {
|
||||
root.triggerUnifiedWave();
|
||||
root.workspaceChanged(ws.id, Colors.accent);
|
||||
root.workspaceChanged(ws.id, Colors.primary);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -180,10 +180,10 @@ Item {
|
||||
}
|
||||
color: {
|
||||
if (model.isFocused)
|
||||
return Colors.accent;
|
||||
return Colors.primary;
|
||||
|
||||
if (model.isActive)
|
||||
return Colors.accent.lighter(130);
|
||||
return Colors.primary.lighter(130);
|
||||
|
||||
if (model.isUrgent)
|
||||
return Theme.error;
|
||||
|
||||
@@ -11,7 +11,7 @@ Item {
|
||||
property real maxValue: 100
|
||||
property real value: 100
|
||||
property string textValue: "" // override value in textDisplay if set
|
||||
property color fillColor: Colors.accent
|
||||
property color fillColor: Colors.primary
|
||||
property string textSuffix: ""
|
||||
property bool pointerCursor: true
|
||||
property alias hovered: mouseArea.containsMouse
|
||||
@@ -127,7 +127,7 @@ Item {
|
||||
|
||||
Behavior on implicitWidth {
|
||||
NumberAnimation {
|
||||
duration: 200
|
||||
duration: Style.animationNormal
|
||||
easing.type: Easing.InOutCubic
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@ Item {
|
||||
required property string symbol
|
||||
property color buttonColor: Colors.distroColor
|
||||
readonly property alias hovered: mouseArea.containsMouse
|
||||
property real iconSize: Fonts.icon
|
||||
property real radius: Style.radiusS
|
||||
|
||||
signal clicked()
|
||||
signal rightClicked()
|
||||
@@ -35,7 +37,7 @@ Item {
|
||||
anchors.fill: parent
|
||||
text: symbol
|
||||
font.family: Fonts.nerd
|
||||
font.pointSize: Fonts.icon
|
||||
font.pointSize: iconSize
|
||||
font.bold: false
|
||||
color: buttonColor
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
@@ -46,11 +48,12 @@ Item {
|
||||
anchors.fill: parent
|
||||
color: parent.hovered ? buttonColor : Colors.transparent
|
||||
opacity: 0.3
|
||||
radius: 14
|
||||
radius: root.radius
|
||||
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: 120
|
||||
duration: Style.animationNormal
|
||||
easing.type: Easing.InOutCubic
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import Quickshell.Widgets
|
||||
import qs.Modules.Bar.Misc
|
||||
import qs.Constants
|
||||
import qs.Services
|
||||
import qs.Utils
|
||||
|
||||
Rectangle {
|
||||
id: root
|
||||
@@ -107,8 +108,7 @@ Rectangle {
|
||||
trayMenu.item.menu = modelData.menu
|
||||
trayMenu.item.showAt(parent, menuX, menuY)
|
||||
} else {
|
||||
// Logger.log("Tray", "No menu available for", modelData.id, "or trayMenu not set")
|
||||
console.log("No menu available for", modelData.id, "or trayMenu not set")
|
||||
Logger.log("Tray", "No menu available for", modelData.id, "or trayMenu not set")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import qs.Constants
|
||||
import qs.Utils
|
||||
import qs.Noctalia
|
||||
|
||||
PopupWindow {
|
||||
id: root
|
||||
@@ -19,7 +21,7 @@ PopupWindow {
|
||||
implicitWidth: menuWidth
|
||||
|
||||
// Use the content height of the Flickable for implicit height
|
||||
implicitHeight: Math.min(screen ? screen.height * 0.9 : Screen.height * 0.9, flickable.contentHeight + 20)
|
||||
implicitHeight: Math.min(screen ? screen.height * 0.9 : Screen.height * 0.9, flickable.contentHeight + (Style.marginS * 2))
|
||||
visible: false
|
||||
color: Colors.transparent
|
||||
anchor.item: anchorItem
|
||||
@@ -28,7 +30,7 @@ PopupWindow {
|
||||
|
||||
function showAt(item, x, y) {
|
||||
if (!item) {
|
||||
console.warn("AnchorItem is undefined, won't show menu.")
|
||||
Logger.warn("TrayMenu", "AnchorItem is undefined, won't show menu.");
|
||||
return
|
||||
}
|
||||
|
||||
@@ -84,15 +86,15 @@ PopupWindow {
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: Colors.base
|
||||
border.color: Colors.accent
|
||||
border.color: Colors.primary
|
||||
border.width: 2
|
||||
radius: 14
|
||||
radius: Style.radiusM
|
||||
}
|
||||
|
||||
Flickable {
|
||||
id: flickable
|
||||
anchors.fill: parent
|
||||
anchors.margins: 10
|
||||
anchors.margins: Style.marginS
|
||||
contentHeight: columnLayout.implicitHeight
|
||||
interactive: true
|
||||
|
||||
@@ -115,88 +117,56 @@ PopupWindow {
|
||||
return 8
|
||||
} else {
|
||||
// Calculate based on text content
|
||||
const textHeight = text.contentHeight || (Fonts.small)
|
||||
return textHeight + 16
|
||||
const textHeight = text.contentHeight || (Style.fontSizeS * 1.2)
|
||||
return Math.max(28, textHeight + (Style.marginS * 2))
|
||||
}
|
||||
}
|
||||
|
||||
color: Colors.transparent
|
||||
property var subMenu: null
|
||||
|
||||
Rectangle {
|
||||
width: parent.width - 16
|
||||
height: 1
|
||||
NDivider {
|
||||
anchors.centerIn: parent
|
||||
width: parent.width - (Style.marginM * 2)
|
||||
visible: modelData?.isSeparator ?? false
|
||||
gradient: Gradient {
|
||||
orientation: Gradient.Horizontal
|
||||
GradientStop {
|
||||
position: 0.0
|
||||
color: Colors.transparent
|
||||
}
|
||||
GradientStop {
|
||||
position: 0.1
|
||||
color: Colors.accent
|
||||
}
|
||||
GradientStop {
|
||||
position: 0.9
|
||||
color: Colors.accent
|
||||
}
|
||||
GradientStop {
|
||||
position: 1.0
|
||||
color: Colors.transparent
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: mouseArea.containsMouse ? Colors.accent : Colors.transparent
|
||||
radius: 10
|
||||
color: mouseArea.containsMouse ? Colors.primary : Colors.transparent
|
||||
radius: Style.radiusS
|
||||
visible: !(modelData?.isSeparator ?? false)
|
||||
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: 8
|
||||
anchors.rightMargin: 8
|
||||
spacing: 8
|
||||
anchors.leftMargin: Style.marginM
|
||||
anchors.rightMargin: Style.marginM
|
||||
spacing: Style.marginS
|
||||
|
||||
Text {
|
||||
NText {
|
||||
id: text
|
||||
Layout.fillWidth: true
|
||||
color: (modelData?.enabled ?? true) ? (mouseArea.containsMouse ? Colors.base : Colors.text) : Colors.text
|
||||
color: (modelData?.enabled ?? true) ? (mouseArea.containsMouse ? Color.mOnTertiary : Color.mOnSurface) : Color.mOnSurfaceVariant
|
||||
text: modelData?.text !== "" ? modelData?.text.replace(/[\n\r]+/g, ' ') : "..."
|
||||
font.pointSize: Fonts.small
|
||||
pointSize: Style.fontSizeS
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
|
||||
Image {
|
||||
Layout.preferredWidth: 14
|
||||
Layout.preferredHeight: 14
|
||||
Layout.preferredWidth: Style.marginL
|
||||
Layout.preferredHeight: Style.marginL
|
||||
source: modelData?.icon ?? ""
|
||||
visible: (modelData?.icon ?? "") !== ""
|
||||
fillMode: Image.PreserveAspectFit
|
||||
}
|
||||
|
||||
Text {
|
||||
NIcon {
|
||||
icon: modelData?.hasChildren ? "menu" : ""
|
||||
pointSize: Style.fontSizeS
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
visible: modelData?.hasChildren ?? false
|
||||
color: (mouseArea.containsMouse ? Colors.base : Colors.text)
|
||||
|
||||
text: {
|
||||
const icon = modelData?.hasChildren ? "menu" : ""
|
||||
if ((icon === undefined) || (icon === "")) {
|
||||
return ""
|
||||
}
|
||||
if (Icons.get(icon) === undefined) {
|
||||
console.warn("Icon", `"${icon}"`, "doesn't exist in the icons font")
|
||||
return Icons.get(Icons.defaultIcon)
|
||||
}
|
||||
return Icons.get(icon)
|
||||
}
|
||||
font.family: Icons.fontFamily
|
||||
font.pointSize: Fonts.small
|
||||
color: (mouseArea.containsMouse ? Color.mOnTertiary : Color.mOnSurface)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user