mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
feat: Add music and sysinfo to top bar (togglable) - also a bunch of misc fixes
This commit is contained in:
@@ -7,7 +7,7 @@ import qs.Settings
|
||||
Rectangle {
|
||||
id: profileSettingsCard
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 200
|
||||
Layout.preferredHeight: 300
|
||||
color: Theme.surface
|
||||
radius: 18
|
||||
border.color: "transparent"
|
||||
@@ -15,6 +15,10 @@ Rectangle {
|
||||
Layout.bottomMargin: 16
|
||||
property bool showActiveWindowIcon: false
|
||||
signal showAWIconChanged(bool showActiveWindowIcon)
|
||||
property bool showSystemInfoInBar: true
|
||||
signal showSystemInfoChanged(bool showSystemInfoInBar)
|
||||
property bool showMediaInBar: false
|
||||
signal showMediaChanged(bool showMediaInBar)
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
@@ -125,7 +129,6 @@ Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Show Active Window Icon Setting
|
||||
RowLayout {
|
||||
spacing: 8
|
||||
@@ -148,8 +151,8 @@ Rectangle {
|
||||
width: 52
|
||||
height: 32
|
||||
radius: 16
|
||||
color: Theme.accentPrimary
|
||||
border.color: Theme.accentPrimary
|
||||
color: showActiveWindowIcon ? Theme.accentPrimary : Theme.surfaceVariant
|
||||
border.color: showActiveWindowIcon ? Theme.accentPrimary : Theme.outline
|
||||
border.width: 2
|
||||
|
||||
Rectangle {
|
||||
@@ -177,6 +180,110 @@ Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
// Show System Info In Bar Setting
|
||||
RowLayout {
|
||||
spacing: 8
|
||||
Layout.fillWidth: true
|
||||
|
||||
Text {
|
||||
text: "Show System Info In Bar"
|
||||
font.pixelSize: 13
|
||||
font.bold: true
|
||||
color: Theme.textPrimary
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
// Custom Material 3 Switch
|
||||
Rectangle {
|
||||
id: customSwitch2
|
||||
width: 52
|
||||
height: 32
|
||||
radius: 16
|
||||
color: showSystemInfoInBar ? Theme.accentPrimary : Theme.surfaceVariant
|
||||
border.color: showSystemInfoInBar ? Theme.accentPrimary : Theme.outline
|
||||
border.width: 2
|
||||
|
||||
Rectangle {
|
||||
id: thumb2
|
||||
width: 28
|
||||
height: 28
|
||||
radius: 14
|
||||
color: Theme.surface
|
||||
border.color: Theme.outline
|
||||
border.width: 1
|
||||
y: 2
|
||||
x: showSystemInfoInBar ? customSwitch2.width - width - 2 : 2
|
||||
|
||||
Behavior on x {
|
||||
NumberAnimation { duration: 200; easing.type: Easing.OutCubic }
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
showSystemInfoChanged(!showSystemInfoInBar)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Show Media In Bar Setting
|
||||
RowLayout {
|
||||
spacing: 8
|
||||
Layout.fillWidth: true
|
||||
|
||||
Text {
|
||||
text: "Show Media In Bar"
|
||||
font.pixelSize: 13
|
||||
font.bold: true
|
||||
color: Theme.textPrimary
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
// Custom Material 3 Switch
|
||||
Rectangle {
|
||||
id: customSwitch3
|
||||
width: 52
|
||||
height: 32
|
||||
radius: 16
|
||||
color: showMediaInBar ? Theme.accentPrimary : Theme.surfaceVariant
|
||||
border.color: showMediaInBar ? Theme.accentPrimary : Theme.outline
|
||||
border.width: 2
|
||||
|
||||
Rectangle {
|
||||
id: thumb3
|
||||
width: 28
|
||||
height: 28
|
||||
radius: 14
|
||||
color: Theme.surface
|
||||
border.color: Theme.outline
|
||||
border.width: 1
|
||||
y: 2
|
||||
x: showMediaInBar ? customSwitch3.width - width - 2 : 2
|
||||
|
||||
Behavior on x {
|
||||
NumberAnimation { duration: 200; easing.type: Easing.OutCubic }
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
showMediaChanged(!showMediaInBar)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Video Path Input Row
|
||||
RowLayout {
|
||||
spacing: 8
|
||||
@@ -184,7 +291,8 @@ Rectangle {
|
||||
|
||||
Text {
|
||||
text: "Video Path"
|
||||
font.pixelSize: 14
|
||||
font.pixelSize: 13
|
||||
font.bold: true
|
||||
color: Theme.textPrimary
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import qs.Services
|
||||
PanelWindow {
|
||||
id: settingsModal
|
||||
implicitWidth: 480
|
||||
implicitHeight: 720
|
||||
implicitHeight: 800
|
||||
visible: false
|
||||
color: "transparent"
|
||||
anchors.top: true
|
||||
@@ -35,6 +35,8 @@ PanelWindow {
|
||||
property int tempTransitionFps: Settings.transitionFps
|
||||
property string tempTransitionType: Settings.transitionType
|
||||
property real tempTransitionDuration: Settings.transitionDuration
|
||||
property bool tempShowSystemInfoInBar: Settings.showSystemInfoInBar
|
||||
property bool tempShowMediaInBar: Settings.showMediaInBar
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
@@ -141,6 +143,14 @@ PanelWindow {
|
||||
onShowAWIconChanged: function (showActiveWindowIcon) {
|
||||
tempShowActiveWindowIcon = showActiveWindowIcon;
|
||||
}
|
||||
showSystemInfoInBar: tempShowSystemInfoInBar
|
||||
onShowSystemInfoChanged: function (showSystemInfoInBar) {
|
||||
tempShowSystemInfoInBar = showSystemInfoInBar;
|
||||
}
|
||||
showMediaInBar: tempShowMediaInBar
|
||||
onShowMediaChanged: function (showMediaInBar) {
|
||||
tempShowMediaInBar = showMediaInBar;
|
||||
}
|
||||
}
|
||||
}
|
||||
CollapsibleCategory {
|
||||
@@ -224,6 +234,8 @@ PanelWindow {
|
||||
Settings.transitionFps = tempTransitionFps;
|
||||
Settings.transitionType = tempTransitionType;
|
||||
Settings.transitionDuration = tempTransitionDuration;
|
||||
Settings.showSystemInfoInBar = tempShowSystemInfoInBar;
|
||||
Settings.showMediaInBar = tempShowMediaInBar;
|
||||
Settings.saveSettings();
|
||||
if (typeof weather !== 'undefined' && weather) {
|
||||
weather.fetchCityWeather();
|
||||
|
||||
Reference in New Issue
Block a user