Better panel naming and removed ref to SettingsWindow
This commit is contained in:
parent
9a70d8028a
commit
ce22559ee2
6 changed files with 22 additions and 31 deletions
|
|
@ -13,7 +13,7 @@ NClock {
|
||||||
}
|
}
|
||||||
|
|
||||||
onEntered: {
|
onEntered: {
|
||||||
if (!calendar.isLoaded) {
|
if (!calendarPanel.isLoaded) {
|
||||||
tooltip.show()
|
tooltip.show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -22,6 +22,6 @@ NClock {
|
||||||
}
|
}
|
||||||
onClicked: {
|
onClicked: {
|
||||||
tooltip.hide()
|
tooltip.hide()
|
||||||
calendar.isLoaded = !calendar.isLoaded
|
calendarPanel.isLoaded = !calendarPanel.isLoaded
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ NLoader {
|
||||||
|
|
||||||
content: Component {
|
content: Component {
|
||||||
NPanel {
|
NPanel {
|
||||||
id: settingsPanel
|
id: panel
|
||||||
|
|
||||||
WlrLayershell.keyboardFocus: WlrKeyboardFocus.OnDemand
|
WlrLayershell.keyboardFocus: WlrKeyboardFocus.OnDemand
|
||||||
|
|
||||||
|
|
@ -105,11 +105,11 @@ NLoader {
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
id: sections
|
id: sections
|
||||||
model: settingsPanel.tabsModel
|
model: panel.tabsModel
|
||||||
|
|
||||||
delegate: Rectangle {
|
delegate: Rectangle {
|
||||||
id: tabItem
|
id: tabItem
|
||||||
readonly property bool selected: index === settingsPanel.currentTabIndex
|
readonly property bool selected: index === panel.currentTabIndex
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: 32 * scaling // Back to original height
|
height: 32 * scaling // Back to original height
|
||||||
radius: Style.radiusSmall * scaling
|
radius: Style.radiusSmall * scaling
|
||||||
|
|
@ -149,7 +149,7 @@ NLoader {
|
||||||
onEntered: tabItem.hovering = true
|
onEntered: tabItem.hovering = true
|
||||||
onExited: tabItem.hovering = false
|
onExited: tabItem.hovering = false
|
||||||
onCanceled: tabItem.hovering = false
|
onCanceled: tabItem.hovering = false
|
||||||
onClicked: settingsPanel.currentTabIndex = index
|
onClicked: panel.currentTabIndex = index
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -178,19 +178,18 @@ NLoader {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
spacing: Style.marginSmall * scaling
|
spacing: Style.marginSmall * scaling
|
||||||
NText {
|
NText {
|
||||||
text: settingsPanel.tabsModel[settingsPanel.currentTabIndex].label
|
text: panel.tabsModel[panel.currentTabIndex].label
|
||||||
font.pointSize: Style.fontSizeLarge * scaling
|
font.pointSize: Style.fontSizeLarge * scaling
|
||||||
font.weight: Style.fontWeightBold
|
font.weight: Style.fontWeightBold
|
||||||
color: Colors.textPrimary
|
color: Colors.textPrimary
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
}
|
}
|
||||||
NIconButton {
|
NIconButton {
|
||||||
id: demoPanelToggle
|
|
||||||
icon: "close"
|
icon: "close"
|
||||||
tooltipText: "Close settings panel"
|
tooltipText: "Close"
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
onClicked: {
|
onClicked: {
|
||||||
settingsWindow.isLoaded = !settingsWindow.isLoaded
|
settingsPanel.isLoaded = !settingsPanel.isLoaded
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -203,7 +202,7 @@ NLoader {
|
||||||
id: stack
|
id: stack
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
currentIndex: settingsPanel.currentTabIndex
|
currentIndex: panel.currentTabIndex
|
||||||
|
|
||||||
Tabs.General {}
|
Tabs.General {}
|
||||||
Tabs.Bar {}
|
Tabs.Bar {}
|
||||||
|
|
@ -12,9 +12,6 @@ NBox {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
readonly property real scaling: Scaling.scale(screen)
|
readonly property real scaling: Scaling.scale(screen)
|
||||||
// Hold a single instance of the Settings window (root is NLoader)
|
|
||||||
property var settingsWindow: null
|
|
||||||
|
|
||||||
property string uptimeText: "--"
|
property string uptimeText: "--"
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
@ -59,8 +56,9 @@ NBox {
|
||||||
}
|
}
|
||||||
NIconButton {
|
NIconButton {
|
||||||
icon: "settings"
|
icon: "settings"
|
||||||
|
tooltipText: "Open settings"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
PanelManager.settingsWindow.isLoaded = !PanelManager.settingsWindow.isLoaded
|
settingsPanel.isLoaded = !settingsPanel.isLoaded
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
NIconButton {
|
NIconButton {
|
||||||
|
|
|
||||||
|
|
@ -7,5 +7,4 @@ Singleton {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property var openedPanel: null
|
property var openedPanel: null
|
||||||
property SettingsWindow settingsWindow: null
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
25
shell.qml
25
shell.qml
|
|
@ -8,7 +8,7 @@ import qs.Widgets
|
||||||
import qs.Modules.Audio
|
import qs.Modules.Audio
|
||||||
import qs.Modules.Bar
|
import qs.Modules.Bar
|
||||||
import qs.Modules.Calendar
|
import qs.Modules.Calendar
|
||||||
import qs.Modules.DemoPanel
|
import qs.Modules.Demo
|
||||||
import qs.Modules.Background
|
import qs.Modules.Background
|
||||||
import qs.Modules.SidePanel
|
import qs.Modules.SidePanel
|
||||||
import qs.Modules.Notification
|
import qs.Modules.Notification
|
||||||
|
|
@ -31,25 +31,20 @@ ShellRoot {
|
||||||
id: sidePanel
|
id: sidePanel
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Calendar {
|
||||||
|
id: calendarPanel
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsPanel {
|
||||||
|
id: settingsPanel
|
||||||
|
}
|
||||||
|
|
||||||
Notification {
|
Notification {
|
||||||
id: notification
|
id: notification
|
||||||
}
|
}
|
||||||
|
|
||||||
Calendar {
|
|
||||||
id: calendar
|
|
||||||
}
|
|
||||||
|
|
||||||
SettingsWindow {
|
|
||||||
id: settingsWindow
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
PanelManager.settingsWindow = settingsWindow
|
// Ensure our singleton is created as soon as possible so we start fetching weather asap
|
||||||
|
|
||||||
// Ensure our singleton is created as soon as possible
|
|
||||||
// so we start fetching weather asap if necessary
|
|
||||||
Location.init()
|
Location.init()
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue