internal: format
This commit is contained in:
parent
6c1765c2e1
commit
9d7f0c48ce
74 changed files with 1635 additions and 1517 deletions
|
|
@ -29,4 +29,3 @@ ColumnLayout {
|
||||||
font.bold: true
|
font.bold: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,4 +57,3 @@ ColumnLayout {
|
||||||
Layout.maximumWidth: parent.width
|
Layout.maximumWidth: parent.width
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,4 +24,3 @@ ColumnLayout {
|
||||||
font.pointSize: Appearance.font.size.small
|
font.pointSize: Appearance.font.size.small
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,7 @@ StyledRect {
|
||||||
implicitHeight: contentColumn.implicitHeight + Appearance.padding.large * 2
|
implicitHeight: contentColumn.implicitHeight + Appearance.padding.large * 2
|
||||||
|
|
||||||
radius: Appearance.rounding.normal
|
radius: Appearance.rounding.normal
|
||||||
color: Colours.transparency.enabled
|
color: Colours.transparency.enabled ? Colours.layer(Colours.palette.m3surfaceContainer, 2) : Colours.palette.m3surfaceContainerHigh
|
||||||
? Colours.layer(Colours.palette.m3surfaceContainer, 2)
|
|
||||||
: Colours.palette.m3surfaceContainerHigh
|
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: contentColumn
|
id: contentColumn
|
||||||
|
|
@ -32,4 +30,3 @@ StyledRect {
|
||||||
spacing: root.contentSpacing
|
spacing: root.contentSpacing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,4 +25,3 @@ ColumnLayout {
|
||||||
color: Colours.palette.m3outline
|
color: Colours.palette.m3outline
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -88,9 +88,7 @@ ColumnLayout {
|
||||||
id: backgroundRect
|
id: backgroundRect
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
radius: Appearance.rounding.normal
|
radius: Appearance.rounding.normal
|
||||||
color: Colours.transparency.enabled
|
color: Colours.transparency.enabled ? Colours.layer(Colours.palette.m3surfaceContainer, root.nested ? 3 : 2) : (root.nested ? Colours.palette.m3surfaceContainerHigh : Colours.palette.m3surfaceContainer)
|
||||||
? Colours.layer(Colours.palette.m3surfaceContainer, root.nested ? 3 : 2)
|
|
||||||
: (root.nested ? Colours.palette.m3surfaceContainerHigh : Colours.palette.m3surfaceContainer)
|
|
||||||
opacity: root.showBackground && root.expanded ? 1.0 : 0.0
|
opacity: root.showBackground && root.expanded ? 1.0 : 0.0
|
||||||
visible: root.showBackground
|
visible: root.showBackground
|
||||||
|
|
||||||
|
|
@ -132,4 +130,3 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ StyledRect {
|
||||||
required property real min
|
required property real min
|
||||||
required property real max
|
required property real max
|
||||||
property real step: 1
|
property real step: 1
|
||||||
property var onValueModified: function(value) {}
|
property var onValueModified: function (value) {}
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
implicitHeight: row.implicitHeight + Appearance.padding.large * 2
|
implicitHeight: row.implicitHeight + Appearance.padding.large * 2
|
||||||
|
|
@ -50,4 +50,3 @@ StyledRect {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,20 +14,20 @@ StyledRect {
|
||||||
required property string label
|
required property string label
|
||||||
property int expandedZ: 100
|
property int expandedZ: 100
|
||||||
property bool enabled: true
|
property bool enabled: true
|
||||||
|
|
||||||
property alias menuItems: splitButton.menuItems
|
property alias menuItems: splitButton.menuItems
|
||||||
property alias active: splitButton.active
|
property alias active: splitButton.active
|
||||||
property alias expanded: splitButton.expanded
|
property alias expanded: splitButton.expanded
|
||||||
property alias type: splitButton.type
|
property alias type: splitButton.type
|
||||||
|
|
||||||
signal selected(item: MenuItem)
|
signal selected(item: MenuItem)
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
implicitHeight: row.implicitHeight + Appearance.padding.large * 2
|
implicitHeight: row.implicitHeight + Appearance.padding.large * 2
|
||||||
radius: Appearance.rounding.normal
|
radius: Appearance.rounding.normal
|
||||||
color: Colours.layer(Colours.palette.m3surfaceContainer, 2)
|
color: Colours.layer(Colours.palette.m3surfaceContainer, 2)
|
||||||
|
|
||||||
clip: false
|
clip: false
|
||||||
z: splitButton.menu.implicitHeight > 0 ? expandedZ : 1
|
z: splitButton.menu.implicitHeight > 0 ? expandedZ : 1
|
||||||
opacity: enabled ? 1.0 : 0.5
|
opacity: enabled ? 1.0 : 0.5
|
||||||
|
|
||||||
|
|
@ -47,14 +47,14 @@ StyledRect {
|
||||||
id: splitButton
|
id: splitButton
|
||||||
enabled: root.enabled
|
enabled: root.enabled
|
||||||
type: SplitButton.Filled
|
type: SplitButton.Filled
|
||||||
|
|
||||||
menu.z: 1
|
menu.z: 1
|
||||||
|
|
||||||
stateLayer.onClicked: {
|
stateLayer.onClicked: {
|
||||||
splitButton.expanded = !splitButton.expanded
|
splitButton.expanded = !splitButton.expanded;
|
||||||
}
|
}
|
||||||
|
|
||||||
menu.onItemSelected: (item) => {
|
menu.onItemSelected: item => {
|
||||||
root.selected(item);
|
root.selected(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,12 +15,12 @@ Item {
|
||||||
property int horizontalAlignment: TextInput.AlignHCenter
|
property int horizontalAlignment: TextInput.AlignHCenter
|
||||||
property int implicitWidth: 70
|
property int implicitWidth: 70
|
||||||
property bool enabled: true
|
property bool enabled: true
|
||||||
|
|
||||||
// Expose activeFocus through alias to avoid FINAL property override
|
// Expose activeFocus through alias to avoid FINAL property override
|
||||||
readonly property alias hasFocus: inputField.activeFocus
|
readonly property alias hasFocus: inputField.activeFocus
|
||||||
|
|
||||||
signal textEdited(string text)
|
signal textEdited(string text)
|
||||||
signal editingFinished()
|
signal editingFinished
|
||||||
|
|
||||||
implicitHeight: inputField.implicitHeight + Appearance.padding.small * 2
|
implicitHeight: inputField.implicitHeight + Appearance.padding.small * 2
|
||||||
|
|
||||||
|
|
@ -28,18 +28,18 @@ Item {
|
||||||
id: container
|
id: container
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: inputHover.containsMouse || inputField.activeFocus
|
color: inputHover.containsMouse || inputField.activeFocus ? Colours.layer(Colours.palette.m3surfaceContainer, 3) : Colours.layer(Colours.palette.m3surfaceContainer, 2)
|
||||||
? Colours.layer(Colours.palette.m3surfaceContainer, 3)
|
|
||||||
: Colours.layer(Colours.palette.m3surfaceContainer, 2)
|
|
||||||
radius: Appearance.rounding.small
|
radius: Appearance.rounding.small
|
||||||
border.width: 1
|
border.width: 1
|
||||||
border.color: inputField.activeFocus
|
border.color: inputField.activeFocus ? Colours.palette.m3primary : Qt.alpha(Colours.palette.m3outline, 0.3)
|
||||||
? Colours.palette.m3primary
|
|
||||||
: Qt.alpha(Colours.palette.m3outline, 0.3)
|
|
||||||
opacity: root.enabled ? 1 : 0.5
|
opacity: root.enabled ? 1 : 0.5
|
||||||
|
|
||||||
Behavior on color { CAnim {} }
|
Behavior on color {
|
||||||
Behavior on border.color { CAnim {} }
|
CAnim {}
|
||||||
|
}
|
||||||
|
Behavior on border.color {
|
||||||
|
CAnim {}
|
||||||
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: inputHover
|
id: inputHover
|
||||||
|
|
@ -58,23 +58,22 @@ Item {
|
||||||
validator: root.validator
|
validator: root.validator
|
||||||
readOnly: root.readOnly
|
readOnly: root.readOnly
|
||||||
enabled: root.enabled
|
enabled: root.enabled
|
||||||
|
|
||||||
Binding {
|
Binding {
|
||||||
target: inputField
|
target: inputField
|
||||||
property: "text"
|
property: "text"
|
||||||
value: root.text
|
value: root.text
|
||||||
when: !inputField.activeFocus
|
when: !inputField.activeFocus
|
||||||
}
|
}
|
||||||
|
|
||||||
onTextChanged: {
|
onTextChanged: {
|
||||||
root.text = text;
|
root.text = text;
|
||||||
root.textEdited(text);
|
root.textEdited(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
onEditingFinished: {
|
onEditingFinished: {
|
||||||
root.editingFinished();
|
root.editingFinished();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ StyledRect {
|
||||||
required property string label
|
required property string label
|
||||||
required property bool checked
|
required property bool checked
|
||||||
property bool enabled: true
|
property bool enabled: true
|
||||||
property var onToggled: function(checked) {}
|
property var onToggled: function (checked) {}
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
implicitHeight: row.implicitHeight + Appearance.padding.large * 2
|
implicitHeight: row.implicitHeight + Appearance.padding.large * 2
|
||||||
|
|
@ -46,4 +46,3 @@ StyledRect {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -122,4 +122,3 @@ StyledRect {
|
||||||
Layout.minimumHeight: 0
|
Layout.minimumHeight: 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,4 +26,3 @@ RowLayout {
|
||||||
cLayer: 2
|
cLayer: 2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,33 +55,47 @@ Popup {
|
||||||
}
|
}
|
||||||
Connections {
|
Connections {
|
||||||
target: root.target
|
target: root.target
|
||||||
function onXChanged() { if (root.tooltipVisible) root.updatePosition(); }
|
function onXChanged() {
|
||||||
function onYChanged() { if (root.tooltipVisible) root.updatePosition(); }
|
if (root.tooltipVisible)
|
||||||
function onWidthChanged() { if (root.tooltipVisible) root.updatePosition(); }
|
root.updatePosition();
|
||||||
function onHeightChanged() { if (root.tooltipVisible) root.updatePosition(); }
|
}
|
||||||
|
function onYChanged() {
|
||||||
|
if (root.tooltipVisible)
|
||||||
|
root.updatePosition();
|
||||||
|
}
|
||||||
|
function onWidthChanged() {
|
||||||
|
if (root.tooltipVisible)
|
||||||
|
root.updatePosition();
|
||||||
|
}
|
||||||
|
function onHeightChanged() {
|
||||||
|
if (root.tooltipVisible)
|
||||||
|
root.updatePosition();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function updatePosition() {
|
function updatePosition() {
|
||||||
if (!target || !parent) return;
|
if (!target || !parent)
|
||||||
|
return;
|
||||||
|
|
||||||
// Wait for tooltipRect to have its size calculated
|
// Wait for tooltipRect to have its size calculated
|
||||||
Qt.callLater(() => {
|
Qt.callLater(() => {
|
||||||
if (!target || !parent || !tooltipRect) return;
|
if (!target || !parent || !tooltipRect)
|
||||||
|
return;
|
||||||
|
|
||||||
// Get target position in parent's coordinate system
|
// Get target position in parent's coordinate system
|
||||||
const targetPos = target.mapToItem(parent, 0, 0);
|
const targetPos = target.mapToItem(parent, 0, 0);
|
||||||
const targetCenterX = targetPos.x + target.width / 2;
|
const targetCenterX = targetPos.x + target.width / 2;
|
||||||
|
|
||||||
// Get tooltip size (use width/height if available, otherwise implicit)
|
// Get tooltip size (use width/height if available, otherwise implicit)
|
||||||
const tooltipWidth = tooltipRect.width > 0 ? tooltipRect.width : tooltipRect.implicitWidth;
|
const tooltipWidth = tooltipRect.width > 0 ? tooltipRect.width : tooltipRect.implicitWidth;
|
||||||
const tooltipHeight = tooltipRect.height > 0 ? tooltipRect.height : tooltipRect.implicitHeight;
|
const tooltipHeight = tooltipRect.height > 0 ? tooltipRect.height : tooltipRect.implicitHeight;
|
||||||
|
|
||||||
// Center tooltip horizontally on target
|
// Center tooltip horizontally on target
|
||||||
let newX = targetCenterX - tooltipWidth / 2;
|
let newX = targetCenterX - tooltipWidth / 2;
|
||||||
|
|
||||||
// Position tooltip above target
|
// Position tooltip above target
|
||||||
let newY = targetPos.y - tooltipHeight - Appearance.spacing.small;
|
let newY = targetPos.y - tooltipHeight - Appearance.spacing.small;
|
||||||
|
|
||||||
// Keep within bounds
|
// Keep within bounds
|
||||||
const padding = Appearance.padding.normal;
|
const padding = Appearance.padding.normal;
|
||||||
if (newX < padding) {
|
if (newX < padding) {
|
||||||
|
|
@ -89,7 +103,7 @@ Popup {
|
||||||
} else if (newX + tooltipWidth > (parent.width - padding)) {
|
} else if (newX + tooltipWidth > (parent.width - padding)) {
|
||||||
newX = parent.width - tooltipWidth - padding;
|
newX = parent.width - tooltipWidth - padding;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update popup position
|
// Update popup position
|
||||||
x = newX;
|
x = newX;
|
||||||
y = newY;
|
y = newY;
|
||||||
|
|
@ -156,7 +170,7 @@ Popup {
|
||||||
id: tooltipText
|
id: tooltipText
|
||||||
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|
||||||
text: root.text
|
text: root.text
|
||||||
color: Colours.palette.m3onSurface
|
color: Colours.palette.m3onSurface
|
||||||
font.pointSize: Appearance.font.size.small
|
font.pointSize: Appearance.font.size.small
|
||||||
|
|
@ -169,4 +183,3 @@ Popup {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -101,9 +101,15 @@ Singleton {
|
||||||
|
|
||||||
function serializeAppearance(): var {
|
function serializeAppearance(): var {
|
||||||
return {
|
return {
|
||||||
rounding: { scale: appearance.rounding.scale },
|
rounding: {
|
||||||
spacing: { scale: appearance.spacing.scale },
|
scale: appearance.rounding.scale
|
||||||
padding: { scale: appearance.padding.scale },
|
},
|
||||||
|
spacing: {
|
||||||
|
scale: appearance.spacing.scale
|
||||||
|
},
|
||||||
|
padding: {
|
||||||
|
scale: appearance.padding.scale
|
||||||
|
},
|
||||||
font: {
|
font: {
|
||||||
family: {
|
family: {
|
||||||
sans: appearance.font.family.sans,
|
sans: appearance.font.family.sans,
|
||||||
|
|
@ -111,10 +117,14 @@ Singleton {
|
||||||
material: appearance.font.family.material,
|
material: appearance.font.family.material,
|
||||||
clock: appearance.font.family.clock
|
clock: appearance.font.family.clock
|
||||||
},
|
},
|
||||||
size: { scale: appearance.font.size.scale }
|
size: {
|
||||||
|
scale: appearance.font.size.scale
|
||||||
|
}
|
||||||
},
|
},
|
||||||
anim: {
|
anim: {
|
||||||
durations: { scale: appearance.anim.durations.scale }
|
durations: {
|
||||||
|
scale: appearance.anim.durations.scale
|
||||||
|
}
|
||||||
},
|
},
|
||||||
transparency: {
|
transparency: {
|
||||||
enabled: appearance.transparency.enabled,
|
enabled: appearance.transparency.enabled,
|
||||||
|
|
|
||||||
|
|
@ -46,82 +46,82 @@ Loader {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
id: clockLoader
|
id: clockLoader
|
||||||
active: Config.background.desktopClock.enabled
|
active: Config.background.desktopClock.enabled
|
||||||
|
|
||||||
anchors.margins: Appearance.padding.large * 2
|
anchors.margins: Appearance.padding.large * 2
|
||||||
anchors.leftMargin: Appearance.padding.large * 2 + Config.bar.sizes.innerWidth + Math.max(Appearance.padding.smaller, Config.border.thickness)
|
anchors.leftMargin: Appearance.padding.large * 2 + Config.bar.sizes.innerWidth + Math.max(Appearance.padding.smaller, Config.border.thickness)
|
||||||
|
|
||||||
state: Config.background.desktopClock.position
|
state: Config.background.desktopClock.position
|
||||||
states: [
|
states: [
|
||||||
State {
|
State {
|
||||||
name: "top-left"
|
name: "top-left"
|
||||||
AnchorChanges {
|
AnchorChanges {
|
||||||
target: clockLoader
|
target: clockLoader
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
State {
|
State {
|
||||||
name: "top-center"
|
name: "top-center"
|
||||||
AnchorChanges {
|
AnchorChanges {
|
||||||
target: clockLoader
|
target: clockLoader
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
State {
|
State {
|
||||||
name: "top-right"
|
name: "top-right"
|
||||||
AnchorChanges {
|
AnchorChanges {
|
||||||
target: clockLoader
|
target: clockLoader
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.right: parent.right }
|
anchors.right: parent.right
|
||||||
|
}
|
||||||
},
|
},
|
||||||
State {
|
State {
|
||||||
name: "middle-left"
|
name: "middle-left"
|
||||||
AnchorChanges {
|
AnchorChanges {
|
||||||
target: clockLoader
|
target: clockLoader
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
State {
|
State {
|
||||||
name: "middle-center"
|
name: "middle-center"
|
||||||
AnchorChanges {
|
AnchorChanges {
|
||||||
target: clockLoader
|
target: clockLoader
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
State {
|
State {
|
||||||
name: "middle-right"
|
name: "middle-right"
|
||||||
AnchorChanges {
|
AnchorChanges {
|
||||||
target: clockLoader
|
target: clockLoader
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
State {
|
State {
|
||||||
name: "bottom-left"
|
name: "bottom-left"
|
||||||
AnchorChanges {
|
AnchorChanges {
|
||||||
target: clockLoader
|
target: clockLoader
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
State {
|
State {
|
||||||
name: "bottom-center"
|
name: "bottom-center"
|
||||||
AnchorChanges {
|
AnchorChanges {
|
||||||
target: clockLoader
|
target: clockLoader
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
State {
|
State {
|
||||||
name: "bottom-right"
|
name: "bottom-right"
|
||||||
AnchorChanges {
|
AnchorChanges {
|
||||||
target: clockLoader
|
target: clockLoader
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
|
@ -130,7 +130,7 @@ Loader {
|
||||||
]
|
]
|
||||||
|
|
||||||
transitions: Transition {
|
transitions: Transition {
|
||||||
AnchorAnimation {
|
AnchorAnimation {
|
||||||
duration: Appearance.anim.durations.expressiveDefaultSpatial
|
duration: Appearance.anim.durations.expressiveDefaultSpatial
|
||||||
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
|
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,3 @@ Item {
|
||||||
font.pointSize: Appearance.font.size.normal
|
font.pointSize: Appearance.font.size.normal
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,3 @@ Item {
|
||||||
font.pointSize: Appearance.font.size.normal
|
font.pointSize: Appearance.font.size.normal
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,7 @@ StyledRect {
|
||||||
// Network icon
|
// Network icon
|
||||||
WrappedLoader {
|
WrappedLoader {
|
||||||
name: "network"
|
name: "network"
|
||||||
active: Config.bar.status.showNetwork && (! Nmcli.activeEthernet || Config.bar.status.showWifi)
|
active: Config.bar.status.showNetwork && (!Nmcli.activeEthernet || Config.bar.status.showWifi)
|
||||||
|
|
||||||
sourceComponent: MaterialIcon {
|
sourceComponent: MaterialIcon {
|
||||||
animate: true
|
animate: true
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,8 @@ Item {
|
||||||
property list<var> pills: []
|
property list<var> pills: []
|
||||||
|
|
||||||
onOccupiedChanged: {
|
onOccupiedChanged: {
|
||||||
if (!occupied) return;
|
if (!occupied)
|
||||||
|
return;
|
||||||
let count = 0;
|
let count = 0;
|
||||||
const start = groupOffset;
|
const start = groupOffset;
|
||||||
const end = start + Config.bar.workspaces.shown;
|
const end = start + Config.bar.workspaces.shown;
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ Item {
|
||||||
wrapper: root.wrapper
|
wrapper: root.wrapper
|
||||||
network: networkPopout.item?.passwordNetwork ?? null
|
network: networkPopout.item?.passwordNetwork ?? null
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: root.wrapper
|
target: root.wrapper
|
||||||
function onCurrentNameChanged() {
|
function onCurrentNameChanged() {
|
||||||
|
|
@ -79,7 +79,7 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: networkPopout
|
target: networkPopout
|
||||||
function onItemChanged() {
|
function onItemChanged() {
|
||||||
|
|
@ -121,7 +121,6 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Popout {
|
Popout {
|
||||||
name: "lockstatus"
|
name: "lockstatus"
|
||||||
sourceComponent: LockStatus {}
|
sourceComponent: LockStatus {}
|
||||||
|
|
|
||||||
|
|
@ -603,4 +603,3 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ Item {
|
||||||
}
|
}
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
Keys.onPressed: event => {
|
Keys.onPressed: event => {
|
||||||
// Don't intercept keys when password popout is active - let it handle them
|
// Don't intercept keys when password popout is active - let it handle them
|
||||||
if (currentName === "wirelesspassword") {
|
if (currentName === "wirelesspassword") {
|
||||||
|
|
@ -88,7 +88,7 @@ Item {
|
||||||
property: "WlrLayershell.keyboardFocus"
|
property: "WlrLayershell.keyboardFocus"
|
||||||
value: WlrKeyboardFocus.OnDemand
|
value: WlrKeyboardFocus.OnDemand
|
||||||
}
|
}
|
||||||
|
|
||||||
Binding {
|
Binding {
|
||||||
when: root.hasCurrent && root.currentName === "wirelesspassword"
|
when: root.hasCurrent && root.currentName === "wirelesspassword"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,13 @@ ColumnLayout {
|
||||||
spacing: Appearance.spacing.small
|
spacing: Appearance.spacing.small
|
||||||
width: Config.bar.sizes.kbLayoutWidth
|
width: Config.bar.sizes.kbLayoutWidth
|
||||||
|
|
||||||
KbLayoutModel { id: kb }
|
KbLayoutModel {
|
||||||
|
id: kb
|
||||||
|
}
|
||||||
|
|
||||||
function refresh() { kb.refresh() }
|
function refresh() {
|
||||||
|
kb.refresh();
|
||||||
|
}
|
||||||
Component.onCompleted: kb.start()
|
Component.onCompleted: kb.start()
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
|
|
@ -46,12 +50,39 @@ ColumnLayout {
|
||||||
spacing: Appearance.spacing.small
|
spacing: Appearance.spacing.small
|
||||||
|
|
||||||
add: Transition {
|
add: Transition {
|
||||||
NumberAnimation { properties: "opacity"; from: 0; to: 1; duration: 140 }
|
NumberAnimation {
|
||||||
NumberAnimation { properties: "y"; duration: 180; easing.type: Easing.OutCubic }
|
properties: "opacity"
|
||||||
|
from: 0
|
||||||
|
to: 1
|
||||||
|
duration: 140
|
||||||
|
}
|
||||||
|
NumberAnimation {
|
||||||
|
properties: "y"
|
||||||
|
duration: 180
|
||||||
|
easing.type: Easing.OutCubic
|
||||||
|
}
|
||||||
|
}
|
||||||
|
remove: Transition {
|
||||||
|
NumberAnimation {
|
||||||
|
properties: "opacity"
|
||||||
|
to: 0
|
||||||
|
duration: 100
|
||||||
|
}
|
||||||
|
}
|
||||||
|
move: Transition {
|
||||||
|
NumberAnimation {
|
||||||
|
properties: "y"
|
||||||
|
duration: 180
|
||||||
|
easing.type: Easing.OutCubic
|
||||||
|
}
|
||||||
|
}
|
||||||
|
displaced: Transition {
|
||||||
|
NumberAnimation {
|
||||||
|
properties: "y"
|
||||||
|
duration: 180
|
||||||
|
easing.type: Easing.OutCubic
|
||||||
|
}
|
||||||
}
|
}
|
||||||
remove: Transition { NumberAnimation { properties: "opacity"; to: 0; duration: 100 } }
|
|
||||||
move: Transition { NumberAnimation { properties: "y"; duration: 180; easing.type: Easing.OutCubic } }
|
|
||||||
displaced: Transition { NumberAnimation { properties: "y"; duration: 180; easing.type: Easing.OutCubic } }
|
|
||||||
|
|
||||||
delegate: Item {
|
delegate: Item {
|
||||||
required property int layoutIndex
|
required property int layoutIndex
|
||||||
|
|
@ -145,13 +176,35 @@ ColumnLayout {
|
||||||
running: false
|
running: false
|
||||||
|
|
||||||
ParallelAnimation {
|
ParallelAnimation {
|
||||||
NumberAnimation { target: activeRow; property: "opacity"; to: 0.0; duration: 70 }
|
NumberAnimation {
|
||||||
NumberAnimation { target: activeRow; property: "scale"; to: 0.92; duration: 70 }
|
target: activeRow
|
||||||
|
property: "opacity"
|
||||||
|
to: 0.0
|
||||||
|
duration: 70
|
||||||
|
}
|
||||||
|
NumberAnimation {
|
||||||
|
target: activeRow
|
||||||
|
property: "scale"
|
||||||
|
to: 0.92
|
||||||
|
duration: 70
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ParallelAnimation {
|
ParallelAnimation {
|
||||||
NumberAnimation { target: activeRow; property: "opacity"; to: 1.0; duration: 160; easing.type: Easing.OutCubic }
|
NumberAnimation {
|
||||||
NumberAnimation { target: activeRow; property: "scale"; to: 1.0; duration: 220; easing.type: Easing.OutBack }
|
target: activeRow
|
||||||
|
property: "opacity"
|
||||||
|
to: 1.0
|
||||||
|
duration: 160
|
||||||
|
easing.type: Easing.OutCubic
|
||||||
|
}
|
||||||
|
NumberAnimation {
|
||||||
|
target: activeRow
|
||||||
|
property: "scale"
|
||||||
|
to: 1.0
|
||||||
|
duration: 220
|
||||||
|
easing.type: Easing.OutBack
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,9 @@ Item {
|
||||||
id: model
|
id: model
|
||||||
visible: false
|
visible: false
|
||||||
|
|
||||||
ListModel { id: _visibleModel }
|
ListModel {
|
||||||
|
id: _visibleModel
|
||||||
|
}
|
||||||
property alias visibleModel: _visibleModel
|
property alias visibleModel: _visibleModel
|
||||||
|
|
||||||
property string activeLabel: ""
|
property string activeLabel: ""
|
||||||
|
|
@ -33,7 +35,9 @@ Item {
|
||||||
_switchProc.running = true;
|
_switchProc.running = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ListModel { id: _layoutsModel }
|
ListModel {
|
||||||
|
id: _layoutsModel
|
||||||
|
}
|
||||||
|
|
||||||
property var _xkbMap: ({})
|
property var _xkbMap: ({})
|
||||||
property bool _notifiedLimit: false
|
property bool _notifiedLimit: false
|
||||||
|
|
@ -41,14 +45,19 @@ Item {
|
||||||
Process {
|
Process {
|
||||||
id: _xkbXmlBase
|
id: _xkbXmlBase
|
||||||
command: ["xmllint", "--xpath", "//layout/configItem[name and description]", "/usr/share/X11/xkb/rules/base.xml"]
|
command: ["xmllint", "--xpath", "//layout/configItem[name and description]", "/usr/share/X11/xkb/rules/base.xml"]
|
||||||
stdout: StdioCollector { onStreamFinished: _buildXmlMap(text) }
|
stdout: StdioCollector {
|
||||||
onRunningChanged: if (!running && (typeof exitCode !== "undefined") && exitCode !== 0) _xkbXmlEvdev.running = true
|
onStreamFinished: _buildXmlMap(text)
|
||||||
|
}
|
||||||
|
onRunningChanged: if (!running && (typeof exitCode !== "undefined") && exitCode !== 0)
|
||||||
|
_xkbXmlEvdev.running = true
|
||||||
}
|
}
|
||||||
|
|
||||||
Process {
|
Process {
|
||||||
id: _xkbXmlEvdev
|
id: _xkbXmlEvdev
|
||||||
command: ["xmllint", "--xpath", "//layout/configItem[name and description]", "/usr/share/X11/xkb/rules/evdev.xml"]
|
command: ["xmllint", "--xpath", "//layout/configItem[name and description]", "/usr/share/X11/xkb/rules/evdev.xml"]
|
||||||
stdout: StdioCollector { onStreamFinished: _buildXmlMap(text) }
|
stdout: StdioCollector {
|
||||||
|
onStreamFinished: _buildXmlMap(text)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function _buildXmlMap(xml) {
|
function _buildXmlMap(xml) {
|
||||||
|
|
@ -60,7 +69,8 @@ Item {
|
||||||
while ((m = re.exec(xml)) !== null) {
|
while ((m = re.exec(xml)) !== null) {
|
||||||
const code = (m[1] || "").trim();
|
const code = (m[1] || "").trim();
|
||||||
const desc = (m[2] || "").trim();
|
const desc = (m[2] || "").trim();
|
||||||
if (!code || !desc) continue;
|
if (!code || !desc)
|
||||||
|
continue;
|
||||||
map[code] = _short(desc);
|
map[code] = _short(desc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -73,7 +83,11 @@ Item {
|
||||||
const tmp = [];
|
const tmp = [];
|
||||||
for (let i = 0; i < _layoutsModel.count; i++) {
|
for (let i = 0; i < _layoutsModel.count; i++) {
|
||||||
const it = _layoutsModel.get(i);
|
const it = _layoutsModel.get(i);
|
||||||
tmp.push({ layoutIndex: it.layoutIndex, token: it.token, label: _pretty(it.token) });
|
tmp.push({
|
||||||
|
layoutIndex: it.layoutIndex,
|
||||||
|
token: it.token,
|
||||||
|
label: _pretty(it.token)
|
||||||
|
});
|
||||||
}
|
}
|
||||||
_layoutsModel.clear();
|
_layoutsModel.clear();
|
||||||
tmp.forEach(t => _layoutsModel.append(t));
|
tmp.forEach(t => _layoutsModel.append(t));
|
||||||
|
|
@ -83,7 +97,8 @@ Item {
|
||||||
|
|
||||||
function _short(desc) {
|
function _short(desc) {
|
||||||
const m = desc.match(/^(.*)\((.*)\)$/);
|
const m = desc.match(/^(.*)\((.*)\)$/);
|
||||||
if (!m) return desc;
|
if (!m)
|
||||||
|
return desc;
|
||||||
const lang = m[1].trim();
|
const lang = m[1].trim();
|
||||||
const region = m[2].trim();
|
const region = m[2].trim();
|
||||||
const code = (region.split(/[,\s-]/)[0] || region).slice(0, 2).toUpperCase();
|
const code = (region.split(/[,\s-]/)[0] || region).slice(0, 2).toUpperCase();
|
||||||
|
|
@ -118,7 +133,8 @@ Item {
|
||||||
const dev = JSON.parse(text);
|
const dev = JSON.parse(text);
|
||||||
const kb = dev?.keyboards?.find(k => k.main) || dev?.keyboards?.[0];
|
const kb = dev?.keyboards?.find(k => k.main) || dev?.keyboards?.[0];
|
||||||
const raw = (kb?.layout || "").trim();
|
const raw = (kb?.layout || "").trim();
|
||||||
if (raw.length) _setLayouts(raw);
|
if (raw.length)
|
||||||
|
_setLayouts(raw);
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
_fetchActiveLayouts.running = true;
|
_fetchActiveLayouts.running = true;
|
||||||
}
|
}
|
||||||
|
|
@ -136,10 +152,7 @@ Item {
|
||||||
const idx = kb?.active_layout_index ?? -1;
|
const idx = kb?.active_layout_index ?? -1;
|
||||||
|
|
||||||
activeIndex = idx >= 0 ? idx : -1;
|
activeIndex = idx >= 0 ? idx : -1;
|
||||||
activeLabel =
|
activeLabel = (idx >= 0 && idx < _layoutsModel.count) ? _layoutsModel.get(idx).label : "";
|
||||||
(idx >= 0 && idx < _layoutsModel.count)
|
|
||||||
? _layoutsModel.get(idx).label
|
|
||||||
: "";
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
activeIndex = -1;
|
activeIndex = -1;
|
||||||
activeLabel = "";
|
activeLabel = "";
|
||||||
|
|
@ -152,7 +165,8 @@ Item {
|
||||||
|
|
||||||
Process {
|
Process {
|
||||||
id: _switchProc
|
id: _switchProc
|
||||||
onRunningChanged: if (!running) _fetchActiveLayouts.running = true
|
onRunningChanged: if (!running)
|
||||||
|
_fetchActiveLayouts.running = true
|
||||||
}
|
}
|
||||||
|
|
||||||
function _setLayouts(raw) {
|
function _setLayouts(raw) {
|
||||||
|
|
@ -163,9 +177,14 @@ Item {
|
||||||
let idx = 0;
|
let idx = 0;
|
||||||
|
|
||||||
for (const p of parts) {
|
for (const p of parts) {
|
||||||
if (seen.has(p)) continue;
|
if (seen.has(p))
|
||||||
|
continue;
|
||||||
seen.add(p);
|
seen.add(p);
|
||||||
_layoutsModel.append({ layoutIndex: idx, token: p, label: _pretty(p) });
|
_layoutsModel.append({
|
||||||
|
layoutIndex: idx,
|
||||||
|
token: p,
|
||||||
|
label: _pretty(p)
|
||||||
|
});
|
||||||
idx++;
|
idx++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -184,17 +203,14 @@ Item {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_layoutsModel.count > 4) {
|
if (_layoutsModel.count > 4) {
|
||||||
Toaster.toast(
|
Toaster.toast(qsTr("Keyboard layout limit"), qsTr("XKB supports only 4 layouts at a time"), "warning");
|
||||||
qsTr("Keyboard layout limit"),
|
|
||||||
qsTr("XKB supports only 4 layouts at a time"),
|
|
||||||
"warning"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function _pretty(token) {
|
function _pretty(token) {
|
||||||
const code = token.replace(/\(.*\)$/, "").trim();
|
const code = token.replace(/\(.*\)$/, "").trim();
|
||||||
if (_xkbMap[code]) return code.toUpperCase() + " - " + _xkbMap[code];
|
if (_xkbMap[code])
|
||||||
|
return code.toUpperCase() + " - " + _xkbMap[code];
|
||||||
return code.toUpperCase() + " - " + code;
|
return code.toUpperCase() + " - " + code;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ Item {
|
||||||
if (!panes.initialOpeningComplete) {
|
if (!panes.initialOpeningComplete) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.angleDelta.y < 0)
|
if (event.angleDelta.y < 0)
|
||||||
root.session.activeIndex = Math.min(root.session.activeIndex + 1, root.session.panes.length - 1);
|
root.session.activeIndex = Math.min(root.session.activeIndex + 1, root.session.panes.length - 1);
|
||||||
else if (event.angleDelta.y > 0)
|
else if (event.angleDelta.y > 0)
|
||||||
|
|
@ -95,6 +95,6 @@ Item {
|
||||||
session: root.session
|
session: root.session
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly property bool initialOpeningComplete: panes.initialOpeningComplete
|
readonly property bool initialOpeningComplete: panes.initialOpeningComplete
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -84,4 +84,3 @@ QtObject {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ ClippingRectangle {
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
z: -1
|
z: -1
|
||||||
onPressed: function(mouse) {
|
onPressed: function (mouse) {
|
||||||
root.focus = true;
|
root.focus = true;
|
||||||
mouse.accepted = false;
|
mouse.accepted = false;
|
||||||
}
|
}
|
||||||
|
|
@ -103,7 +103,7 @@ ClippingRectangle {
|
||||||
implicitHeight: root.height
|
implicitHeight: root.height
|
||||||
|
|
||||||
property bool hasBeenLoaded: false
|
property bool hasBeenLoaded: false
|
||||||
|
|
||||||
function updateActive(): void {
|
function updateActive(): void {
|
||||||
const diff = Math.abs(root.session.activeIndex - pane.paneIndex);
|
const diff = Math.abs(root.session.activeIndex - pane.paneIndex);
|
||||||
const isActivePane = diff === 0;
|
const isActivePane = diff === 0;
|
||||||
|
|
@ -130,37 +130,37 @@ ClippingRectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
clip: false
|
clip: false
|
||||||
active: false
|
active: false
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
Qt.callLater(pane.updateActive);
|
Qt.callLater(pane.updateActive);
|
||||||
}
|
}
|
||||||
|
|
||||||
onActiveChanged: {
|
onActiveChanged: {
|
||||||
if (active && !pane.hasBeenLoaded) {
|
if (active && !pane.hasBeenLoaded) {
|
||||||
pane.hasBeenLoaded = true;
|
pane.hasBeenLoaded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (active && !item) {
|
if (active && !item) {
|
||||||
loader.setSource(pane.componentPath, {
|
loader.setSource(pane.componentPath, {
|
||||||
"session": root.session
|
"session": root.session
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onItemChanged: {
|
onItemChanged: {
|
||||||
if (item) {
|
if (item) {
|
||||||
pane.hasBeenLoaded = true;
|
pane.hasBeenLoaded = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: root.session
|
target: root.session
|
||||||
function onActiveIndexChanged(): void {
|
function onActiveIndexChanged(): void {
|
||||||
pane.updateActive();
|
pane.updateActive();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: layout
|
target: layout
|
||||||
function onInitialOpeningCompleteChanged(): void {
|
function onInitialOpeningCompleteChanged(): void {
|
||||||
|
|
|
||||||
|
|
@ -18,5 +18,6 @@ QtObject {
|
||||||
readonly property VpnState vpn: VpnState {}
|
readonly property VpnState vpn: VpnState {}
|
||||||
|
|
||||||
onActiveChanged: activeIndex = Math.max(0, panes.indexOf(active))
|
onActiveChanged: activeIndex = Math.max(0, panes.indexOf(active))
|
||||||
onActiveIndexChanged: if (panes[activeIndex]) active = panes[activeIndex]
|
onActiveIndexChanged: if (panes[activeIndex])
|
||||||
|
active = panes[activeIndex]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -73,15 +73,15 @@ Item {
|
||||||
|
|
||||||
Config.background.desktopClock.enabled = root.desktopClockEnabled;
|
Config.background.desktopClock.enabled = root.desktopClockEnabled;
|
||||||
Config.background.enabled = root.backgroundEnabled;
|
Config.background.enabled = root.backgroundEnabled;
|
||||||
Config.background.desktopClock.scale = root.desktopClockScale
|
Config.background.desktopClock.scale = root.desktopClockScale;
|
||||||
Config.background.desktopClock.position = root.desktopClockPosition
|
Config.background.desktopClock.position = root.desktopClockPosition;
|
||||||
Config.background.desktopClock.shadow.enabled = root.desktopClockShadowEnabled
|
Config.background.desktopClock.shadow.enabled = root.desktopClockShadowEnabled;
|
||||||
Config.background.desktopClock.shadow.opacity = root.desktopClockShadowOpacity
|
Config.background.desktopClock.shadow.opacity = root.desktopClockShadowOpacity;
|
||||||
Config.background.desktopClock.shadow.blur = root.desktopClockShadowBlur
|
Config.background.desktopClock.shadow.blur = root.desktopClockShadowBlur;
|
||||||
Config.background.desktopClock.background.enabled = root.desktopClockBackgroundEnabled
|
Config.background.desktopClock.background.enabled = root.desktopClockBackgroundEnabled;
|
||||||
Config.background.desktopClock.background.opacity = root.desktopClockBackgroundOpacity
|
Config.background.desktopClock.background.opacity = root.desktopClockBackgroundOpacity;
|
||||||
Config.background.desktopClock.background.blur = root.desktopClockBackgroundBlur
|
Config.background.desktopClock.background.blur = root.desktopClockBackgroundBlur;
|
||||||
Config.background.desktopClock.invertColors = root.desktopClockInvertColors
|
Config.background.desktopClock.invertColors = root.desktopClockInvertColors;
|
||||||
|
|
||||||
Config.background.visualiser.enabled = root.visualiserEnabled;
|
Config.background.visualiser.enabled = root.visualiserEnabled;
|
||||||
Config.background.visualiser.autoHide = root.visualiserAutoHide;
|
Config.background.visualiser.autoHide = root.visualiserAutoHide;
|
||||||
|
|
@ -116,11 +116,11 @@ Item {
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
id: wallpaperLoader
|
id: wallpaperLoader
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.bottomMargin: -Appearance.padding.large * 2
|
Layout.bottomMargin: -Appearance.padding.large * 2
|
||||||
|
|
||||||
active: {
|
active: {
|
||||||
const isActive = root.session.activeIndex === 3;
|
const isActive = root.session.activeIndex === 3;
|
||||||
const isAdjacent = Math.abs(root.session.activeIndex - 3) === 1;
|
const isAdjacent = Math.abs(root.session.activeIndex - 3) === 1;
|
||||||
|
|
@ -129,13 +129,13 @@ Item {
|
||||||
const shouldActivate = loader && loader.item !== null && (isActive || isAdjacent);
|
const shouldActivate = loader && loader.item !== null && (isActive || isAdjacent);
|
||||||
return shouldActivate;
|
return shouldActivate;
|
||||||
}
|
}
|
||||||
|
|
||||||
onStatusChanged: {
|
onStatusChanged: {
|
||||||
if (status === Loader.Error) {
|
if (status === Loader.Error) {
|
||||||
console.error("[AppearancePane] Wallpaper loader error!");
|
console.error("[AppearancePane] Wallpaper loader error!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceComponent: WallpaperGrid {
|
sourceComponent: WallpaperGrid {
|
||||||
session: root.session
|
session: root.session
|
||||||
}
|
}
|
||||||
|
|
@ -155,7 +155,6 @@ Item {
|
||||||
flickableDirection: Flickable.VerticalFlick
|
flickableDirection: Flickable.VerticalFlick
|
||||||
contentHeight: sidebarLayout.height
|
contentHeight: sidebarLayout.height
|
||||||
|
|
||||||
|
|
||||||
StyledScrollBar.vertical: StyledScrollBar {
|
StyledScrollBar.vertical: StyledScrollBar {
|
||||||
flickable: sidebarFlickable
|
flickable: sidebarFlickable
|
||||||
}
|
}
|
||||||
|
|
@ -165,96 +164,87 @@ Item {
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
spacing: Appearance.spacing.small
|
spacing: Appearance.spacing.small
|
||||||
|
|
||||||
readonly property var rootPane: sidebarFlickable.rootPane
|
readonly property var rootPane: sidebarFlickable.rootPane
|
||||||
|
|
||||||
readonly property bool allSectionsExpanded:
|
readonly property bool allSectionsExpanded: themeModeSection.expanded && colorVariantSection.expanded && colorSchemeSection.expanded && animationsSection.expanded && fontsSection.expanded && scalesSection.expanded && transparencySection.expanded && borderSection.expanded && backgroundSection.expanded
|
||||||
themeModeSection.expanded &&
|
|
||||||
colorVariantSection.expanded &&
|
|
||||||
colorSchemeSection.expanded &&
|
|
||||||
animationsSection.expanded &&
|
|
||||||
fontsSection.expanded &&
|
|
||||||
scalesSection.expanded &&
|
|
||||||
transparencySection.expanded &&
|
|
||||||
borderSection.expanded &&
|
|
||||||
backgroundSection.expanded
|
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
spacing: Appearance.spacing.smaller
|
spacing: Appearance.spacing.smaller
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: qsTr("Appearance")
|
text: qsTr("Appearance")
|
||||||
font.pointSize: Appearance.font.size.large
|
font.pointSize: Appearance.font.size.large
|
||||||
font.weight: 500
|
font.weight: 500
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
}
|
}
|
||||||
|
|
||||||
IconButton {
|
IconButton {
|
||||||
icon: sidebarLayout.allSectionsExpanded ? "unfold_less" : "unfold_more"
|
icon: sidebarLayout.allSectionsExpanded ? "unfold_less" : "unfold_more"
|
||||||
type: IconButton.Text
|
type: IconButton.Text
|
||||||
label.animate: true
|
label.animate: true
|
||||||
onClicked: {
|
onClicked: {
|
||||||
const shouldExpand = !sidebarLayout.allSectionsExpanded;
|
const shouldExpand = !sidebarLayout.allSectionsExpanded;
|
||||||
themeModeSection.expanded = shouldExpand;
|
themeModeSection.expanded = shouldExpand;
|
||||||
colorVariantSection.expanded = shouldExpand;
|
colorVariantSection.expanded = shouldExpand;
|
||||||
colorSchemeSection.expanded = shouldExpand;
|
colorSchemeSection.expanded = shouldExpand;
|
||||||
animationsSection.expanded = shouldExpand;
|
animationsSection.expanded = shouldExpand;
|
||||||
fontsSection.expanded = shouldExpand;
|
fontsSection.expanded = shouldExpand;
|
||||||
scalesSection.expanded = shouldExpand;
|
scalesSection.expanded = shouldExpand;
|
||||||
transparencySection.expanded = shouldExpand;
|
transparencySection.expanded = shouldExpand;
|
||||||
borderSection.expanded = shouldExpand;
|
borderSection.expanded = shouldExpand;
|
||||||
backgroundSection.expanded = shouldExpand;
|
backgroundSection.expanded = shouldExpand;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
ThemeModeSection {
|
ThemeModeSection {
|
||||||
id: themeModeSection
|
id: themeModeSection
|
||||||
}
|
}
|
||||||
|
|
||||||
ColorVariantSection {
|
ColorVariantSection {
|
||||||
id: colorVariantSection
|
id: colorVariantSection
|
||||||
}
|
}
|
||||||
|
|
||||||
ColorSchemeSection {
|
ColorSchemeSection {
|
||||||
id: colorSchemeSection
|
id: colorSchemeSection
|
||||||
}
|
}
|
||||||
|
|
||||||
AnimationsSection {
|
AnimationsSection {
|
||||||
id: animationsSection
|
id: animationsSection
|
||||||
rootPane: sidebarFlickable.rootPane
|
rootPane: sidebarFlickable.rootPane
|
||||||
}
|
}
|
||||||
|
|
||||||
FontsSection {
|
FontsSection {
|
||||||
id: fontsSection
|
id: fontsSection
|
||||||
rootPane: sidebarFlickable.rootPane
|
rootPane: sidebarFlickable.rootPane
|
||||||
}
|
}
|
||||||
|
|
||||||
ScalesSection {
|
ScalesSection {
|
||||||
id: scalesSection
|
id: scalesSection
|
||||||
rootPane: sidebarFlickable.rootPane
|
rootPane: sidebarFlickable.rootPane
|
||||||
}
|
}
|
||||||
|
|
||||||
TransparencySection {
|
TransparencySection {
|
||||||
id: transparencySection
|
id: transparencySection
|
||||||
rootPane: sidebarFlickable.rootPane
|
rootPane: sidebarFlickable.rootPane
|
||||||
}
|
}
|
||||||
|
|
||||||
BorderSection {
|
BorderSection {
|
||||||
id: borderSection
|
id: borderSection
|
||||||
rootPane: sidebarFlickable.rootPane
|
rootPane: sidebarFlickable.rootPane
|
||||||
}
|
}
|
||||||
|
|
||||||
BackgroundSection {
|
BackgroundSection {
|
||||||
id: backgroundSection
|
id: backgroundSection
|
||||||
rootPane: sidebarFlickable.rootPane
|
rootPane: sidebarFlickable.rootPane
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
rightContent: appearanceRightContentComponent
|
rightContent: appearanceRightContentComponent
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,20 +23,22 @@ CollapsibleSection {
|
||||||
|
|
||||||
SliderInput {
|
SliderInput {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
label: qsTr("Animation duration scale")
|
label: qsTr("Animation duration scale")
|
||||||
value: rootPane.animDurationsScale
|
value: rootPane.animDurationsScale
|
||||||
from: 0.1
|
from: 0.1
|
||||||
to: 5.0
|
to: 5.0
|
||||||
decimals: 1
|
decimals: 1
|
||||||
suffix: "×"
|
suffix: "×"
|
||||||
validator: DoubleValidator { bottom: 0.1; top: 5.0 }
|
validator: DoubleValidator {
|
||||||
|
bottom: 0.1
|
||||||
onValueModified: (newValue) => {
|
top: 5.0
|
||||||
|
}
|
||||||
|
|
||||||
|
onValueModified: newValue => {
|
||||||
rootPane.animDurationsScale = newValue;
|
rootPane.animDurationsScale = newValue;
|
||||||
rootPane.saveConfig();
|
rootPane.saveConfig();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ CollapsibleSection {
|
||||||
|
|
||||||
SectionContainer {
|
SectionContainer {
|
||||||
id: posContainer
|
id: posContainer
|
||||||
|
|
||||||
contentSpacing: Appearance.spacing.small
|
contentSpacing: Appearance.spacing.small
|
||||||
z: 1
|
z: 1
|
||||||
|
|
||||||
|
|
@ -67,16 +67,29 @@ CollapsibleSection {
|
||||||
SplitButtonRow {
|
SplitButtonRow {
|
||||||
label: qsTr("Vertical Position")
|
label: qsTr("Vertical Position")
|
||||||
enabled: rootPane.desktopClockEnabled
|
enabled: rootPane.desktopClockEnabled
|
||||||
|
|
||||||
menuItems: [
|
menuItems: [
|
||||||
MenuItem { text: qsTr("Top"); icon: "vertical_align_top"; property string val: "top" },
|
MenuItem {
|
||||||
MenuItem { text: qsTr("Middle"); icon: "vertical_align_center"; property string val: "middle" },
|
text: qsTr("Top")
|
||||||
MenuItem { text: qsTr("Bottom"); icon: "vertical_align_bottom"; property string val: "bottom" }
|
icon: "vertical_align_top"
|
||||||
|
property string val: "top"
|
||||||
|
},
|
||||||
|
MenuItem {
|
||||||
|
text: qsTr("Middle")
|
||||||
|
icon: "vertical_align_center"
|
||||||
|
property string val: "middle"
|
||||||
|
},
|
||||||
|
MenuItem {
|
||||||
|
text: qsTr("Bottom")
|
||||||
|
icon: "vertical_align_bottom"
|
||||||
|
property string val: "bottom"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
for(let i=0; i < menuItems.length; i++) {
|
for (let i = 0; i < menuItems.length; i++) {
|
||||||
if(menuItems[i].val === posContainer.currentV) active = menuItems[i];
|
if (menuItems[i].val === posContainer.currentV)
|
||||||
|
active = menuItems[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -88,16 +101,29 @@ CollapsibleSection {
|
||||||
label: qsTr("Horizontal Position")
|
label: qsTr("Horizontal Position")
|
||||||
enabled: rootPane.desktopClockEnabled
|
enabled: rootPane.desktopClockEnabled
|
||||||
expandedZ: 99
|
expandedZ: 99
|
||||||
|
|
||||||
menuItems: [
|
menuItems: [
|
||||||
MenuItem { text: qsTr("Left"); icon: "align_horizontal_left"; property string val: "left" },
|
MenuItem {
|
||||||
MenuItem { text: qsTr("Center"); icon: "align_horizontal_center"; property string val: "center" },
|
text: qsTr("Left")
|
||||||
MenuItem { text: qsTr("Right"); icon: "align_horizontal_right"; property string val: "right" }
|
icon: "align_horizontal_left"
|
||||||
|
property string val: "left"
|
||||||
|
},
|
||||||
|
MenuItem {
|
||||||
|
text: qsTr("Center")
|
||||||
|
icon: "align_horizontal_center"
|
||||||
|
property string val: "center"
|
||||||
|
},
|
||||||
|
MenuItem {
|
||||||
|
text: qsTr("Right")
|
||||||
|
icon: "align_horizontal_right"
|
||||||
|
property string val: "right"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
for(let i=0; i < menuItems.length; i++) {
|
for (let i = 0; i < menuItems.length; i++) {
|
||||||
if(menuItems[i].val === posContainer.currentH) active = menuItems[i];
|
if (menuItems[i].val === posContainer.currentH)
|
||||||
|
active = menuItems[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -137,17 +163,20 @@ CollapsibleSection {
|
||||||
|
|
||||||
SliderInput {
|
SliderInput {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
label: qsTr("Opacity")
|
label: qsTr("Opacity")
|
||||||
value: rootPane.desktopClockShadowOpacity * 100
|
value: rootPane.desktopClockShadowOpacity * 100
|
||||||
from: 0
|
from: 0
|
||||||
to: 100
|
to: 100
|
||||||
suffix: "%"
|
suffix: "%"
|
||||||
validator: IntValidator { bottom: 0; top: 100 }
|
validator: IntValidator {
|
||||||
formatValueFunction: (val) => Math.round(val).toString()
|
bottom: 0
|
||||||
parseValueFunction: (text) => parseInt(text)
|
top: 100
|
||||||
|
}
|
||||||
onValueModified: (newValue) => {
|
formatValueFunction: val => Math.round(val).toString()
|
||||||
|
parseValueFunction: text => parseInt(text)
|
||||||
|
|
||||||
|
onValueModified: newValue => {
|
||||||
rootPane.desktopClockShadowOpacity = newValue / 100;
|
rootPane.desktopClockShadowOpacity = newValue / 100;
|
||||||
rootPane.saveConfig();
|
rootPane.saveConfig();
|
||||||
}
|
}
|
||||||
|
|
@ -159,17 +188,20 @@ CollapsibleSection {
|
||||||
|
|
||||||
SliderInput {
|
SliderInput {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
label: qsTr("Blur")
|
label: qsTr("Blur")
|
||||||
value: rootPane.desktopClockShadowBlur * 100
|
value: rootPane.desktopClockShadowBlur * 100
|
||||||
from: 0
|
from: 0
|
||||||
to: 100
|
to: 100
|
||||||
suffix: "%"
|
suffix: "%"
|
||||||
validator: IntValidator { bottom: 0; top: 100 }
|
validator: IntValidator {
|
||||||
formatValueFunction: (val) => Math.round(val).toString()
|
bottom: 0
|
||||||
parseValueFunction: (text) => parseInt(text)
|
top: 100
|
||||||
|
}
|
||||||
onValueModified: (newValue) => {
|
formatValueFunction: val => Math.round(val).toString()
|
||||||
|
parseValueFunction: text => parseInt(text)
|
||||||
|
|
||||||
|
onValueModified: newValue => {
|
||||||
rootPane.desktopClockShadowBlur = newValue / 100;
|
rootPane.desktopClockShadowBlur = newValue / 100;
|
||||||
rootPane.saveConfig();
|
rootPane.saveConfig();
|
||||||
}
|
}
|
||||||
|
|
@ -209,17 +241,20 @@ CollapsibleSection {
|
||||||
|
|
||||||
SliderInput {
|
SliderInput {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
label: qsTr("Opacity")
|
label: qsTr("Opacity")
|
||||||
value: rootPane.desktopClockBackgroundOpacity * 100
|
value: rootPane.desktopClockBackgroundOpacity * 100
|
||||||
from: 0
|
from: 0
|
||||||
to: 100
|
to: 100
|
||||||
suffix: "%"
|
suffix: "%"
|
||||||
validator: IntValidator { bottom: 0; top: 100 }
|
validator: IntValidator {
|
||||||
formatValueFunction: (val) => Math.round(val).toString()
|
bottom: 0
|
||||||
parseValueFunction: (text) => parseInt(text)
|
top: 100
|
||||||
|
}
|
||||||
onValueModified: (newValue) => {
|
formatValueFunction: val => Math.round(val).toString()
|
||||||
|
parseValueFunction: text => parseInt(text)
|
||||||
|
|
||||||
|
onValueModified: newValue => {
|
||||||
rootPane.desktopClockBackgroundOpacity = newValue / 100;
|
rootPane.desktopClockBackgroundOpacity = newValue / 100;
|
||||||
rootPane.saveConfig();
|
rootPane.saveConfig();
|
||||||
}
|
}
|
||||||
|
|
@ -227,7 +262,6 @@ CollapsibleSection {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
Layout.topMargin: Appearance.spacing.normal
|
Layout.topMargin: Appearance.spacing.normal
|
||||||
text: qsTr("Visualiser")
|
text: qsTr("Visualiser")
|
||||||
|
|
@ -258,17 +292,20 @@ CollapsibleSection {
|
||||||
|
|
||||||
SliderInput {
|
SliderInput {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
label: qsTr("Visualiser rounding")
|
label: qsTr("Visualiser rounding")
|
||||||
value: rootPane.visualiserRounding
|
value: rootPane.visualiserRounding
|
||||||
from: 0
|
from: 0
|
||||||
to: 10
|
to: 10
|
||||||
stepSize: 1
|
stepSize: 1
|
||||||
validator: IntValidator { bottom: 0; top: 10 }
|
validator: IntValidator {
|
||||||
formatValueFunction: (val) => Math.round(val).toString()
|
bottom: 0
|
||||||
parseValueFunction: (text) => parseInt(text)
|
top: 10
|
||||||
|
}
|
||||||
onValueModified: (newValue) => {
|
formatValueFunction: val => Math.round(val).toString()
|
||||||
|
parseValueFunction: text => parseInt(text)
|
||||||
|
|
||||||
|
onValueModified: newValue => {
|
||||||
rootPane.visualiserRounding = Math.round(newValue);
|
rootPane.visualiserRounding = Math.round(newValue);
|
||||||
rootPane.saveConfig();
|
rootPane.saveConfig();
|
||||||
}
|
}
|
||||||
|
|
@ -280,18 +317,20 @@ CollapsibleSection {
|
||||||
|
|
||||||
SliderInput {
|
SliderInput {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
label: qsTr("Visualiser spacing")
|
label: qsTr("Visualiser spacing")
|
||||||
value: rootPane.visualiserSpacing
|
value: rootPane.visualiserSpacing
|
||||||
from: 0
|
from: 0
|
||||||
to: 2
|
to: 2
|
||||||
validator: DoubleValidator { bottom: 0; top: 2 }
|
validator: DoubleValidator {
|
||||||
|
bottom: 0
|
||||||
onValueModified: (newValue) => {
|
top: 2
|
||||||
|
}
|
||||||
|
|
||||||
|
onValueModified: newValue => {
|
||||||
rootPane.visualiserSpacing = newValue;
|
rootPane.visualiserSpacing = newValue;
|
||||||
rootPane.saveConfig();
|
rootPane.saveConfig();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,16 +23,19 @@ CollapsibleSection {
|
||||||
|
|
||||||
SliderInput {
|
SliderInput {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
label: qsTr("Border rounding")
|
label: qsTr("Border rounding")
|
||||||
value: rootPane.borderRounding
|
value: rootPane.borderRounding
|
||||||
from: 0.1
|
from: 0.1
|
||||||
to: 100
|
to: 100
|
||||||
decimals: 1
|
decimals: 1
|
||||||
suffix: "px"
|
suffix: "px"
|
||||||
validator: DoubleValidator { bottom: 0.1; top: 100 }
|
validator: DoubleValidator {
|
||||||
|
bottom: 0.1
|
||||||
onValueModified: (newValue) => {
|
top: 100
|
||||||
|
}
|
||||||
|
|
||||||
|
onValueModified: newValue => {
|
||||||
rootPane.borderRounding = newValue;
|
rootPane.borderRounding = newValue;
|
||||||
rootPane.saveConfig();
|
rootPane.saveConfig();
|
||||||
}
|
}
|
||||||
|
|
@ -44,20 +47,22 @@ CollapsibleSection {
|
||||||
|
|
||||||
SliderInput {
|
SliderInput {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
label: qsTr("Border thickness")
|
label: qsTr("Border thickness")
|
||||||
value: rootPane.borderThickness
|
value: rootPane.borderThickness
|
||||||
from: 0.1
|
from: 0.1
|
||||||
to: 100
|
to: 100
|
||||||
decimals: 1
|
decimals: 1
|
||||||
suffix: "px"
|
suffix: "px"
|
||||||
validator: DoubleValidator { bottom: 0.1; top: 100 }
|
validator: DoubleValidator {
|
||||||
|
bottom: 0.1
|
||||||
onValueModified: (newValue) => {
|
top: 100
|
||||||
|
}
|
||||||
|
|
||||||
|
onValueModified: newValue => {
|
||||||
rootPane.borderThickness = newValue;
|
rootPane.borderThickness = newValue;
|
||||||
rootPane.saveConfig();
|
rootPane.saveConfig();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -143,4 +143,3 @@ CollapsibleSection {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -89,4 +89,3 @@ CollapsibleSection {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -261,20 +261,22 @@ CollapsibleSection {
|
||||||
|
|
||||||
SliderInput {
|
SliderInput {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
label: qsTr("Font size scale")
|
label: qsTr("Font size scale")
|
||||||
value: rootPane.fontSizeScale
|
value: rootPane.fontSizeScale
|
||||||
from: 0.7
|
from: 0.7
|
||||||
to: 1.5
|
to: 1.5
|
||||||
decimals: 2
|
decimals: 2
|
||||||
suffix: "×"
|
suffix: "×"
|
||||||
validator: DoubleValidator { bottom: 0.7; top: 1.5 }
|
validator: DoubleValidator {
|
||||||
|
bottom: 0.7
|
||||||
onValueModified: (newValue) => {
|
top: 1.5
|
||||||
|
}
|
||||||
|
|
||||||
|
onValueModified: newValue => {
|
||||||
rootPane.fontSizeScale = newValue;
|
rootPane.fontSizeScale = newValue;
|
||||||
rootPane.saveConfig();
|
rootPane.saveConfig();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,16 +23,19 @@ CollapsibleSection {
|
||||||
|
|
||||||
SliderInput {
|
SliderInput {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
label: qsTr("Padding scale")
|
label: qsTr("Padding scale")
|
||||||
value: rootPane.paddingScale
|
value: rootPane.paddingScale
|
||||||
from: 0.5
|
from: 0.5
|
||||||
to: 2.0
|
to: 2.0
|
||||||
decimals: 1
|
decimals: 1
|
||||||
suffix: "×"
|
suffix: "×"
|
||||||
validator: DoubleValidator { bottom: 0.5; top: 2.0 }
|
validator: DoubleValidator {
|
||||||
|
bottom: 0.5
|
||||||
onValueModified: (newValue) => {
|
top: 2.0
|
||||||
|
}
|
||||||
|
|
||||||
|
onValueModified: newValue => {
|
||||||
rootPane.paddingScale = newValue;
|
rootPane.paddingScale = newValue;
|
||||||
rootPane.saveConfig();
|
rootPane.saveConfig();
|
||||||
}
|
}
|
||||||
|
|
@ -44,16 +47,19 @@ CollapsibleSection {
|
||||||
|
|
||||||
SliderInput {
|
SliderInput {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
label: qsTr("Rounding scale")
|
label: qsTr("Rounding scale")
|
||||||
value: rootPane.roundingScale
|
value: rootPane.roundingScale
|
||||||
from: 0.1
|
from: 0.1
|
||||||
to: 5.0
|
to: 5.0
|
||||||
decimals: 1
|
decimals: 1
|
||||||
suffix: "×"
|
suffix: "×"
|
||||||
validator: DoubleValidator { bottom: 0.1; top: 5.0 }
|
validator: DoubleValidator {
|
||||||
|
bottom: 0.1
|
||||||
onValueModified: (newValue) => {
|
top: 5.0
|
||||||
|
}
|
||||||
|
|
||||||
|
onValueModified: newValue => {
|
||||||
rootPane.roundingScale = newValue;
|
rootPane.roundingScale = newValue;
|
||||||
rootPane.saveConfig();
|
rootPane.saveConfig();
|
||||||
}
|
}
|
||||||
|
|
@ -65,20 +71,22 @@ CollapsibleSection {
|
||||||
|
|
||||||
SliderInput {
|
SliderInput {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
label: qsTr("Spacing scale")
|
label: qsTr("Spacing scale")
|
||||||
value: rootPane.spacingScale
|
value: rootPane.spacingScale
|
||||||
from: 0.1
|
from: 0.1
|
||||||
to: 2.0
|
to: 2.0
|
||||||
decimals: 1
|
decimals: 1
|
||||||
suffix: "×"
|
suffix: "×"
|
||||||
validator: DoubleValidator { bottom: 0.1; top: 2.0 }
|
validator: DoubleValidator {
|
||||||
|
bottom: 0.1
|
||||||
onValueModified: (newValue) => {
|
top: 2.0
|
||||||
|
}
|
||||||
|
|
||||||
|
onValueModified: newValue => {
|
||||||
rootPane.spacingScale = newValue;
|
rootPane.spacingScale = newValue;
|
||||||
rootPane.saveConfig();
|
rootPane.saveConfig();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,4 +21,3 @@ CollapsibleSection {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,17 +32,20 @@ CollapsibleSection {
|
||||||
|
|
||||||
SliderInput {
|
SliderInput {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
label: qsTr("Transparency base")
|
label: qsTr("Transparency base")
|
||||||
value: rootPane.transparencyBase * 100
|
value: rootPane.transparencyBase * 100
|
||||||
from: 0
|
from: 0
|
||||||
to: 100
|
to: 100
|
||||||
suffix: "%"
|
suffix: "%"
|
||||||
validator: IntValidator { bottom: 0; top: 100 }
|
validator: IntValidator {
|
||||||
formatValueFunction: (val) => Math.round(val).toString()
|
bottom: 0
|
||||||
parseValueFunction: (text) => parseInt(text)
|
top: 100
|
||||||
|
}
|
||||||
onValueModified: (newValue) => {
|
formatValueFunction: val => Math.round(val).toString()
|
||||||
|
parseValueFunction: text => parseInt(text)
|
||||||
|
|
||||||
|
onValueModified: newValue => {
|
||||||
rootPane.transparencyBase = newValue / 100;
|
rootPane.transparencyBase = newValue / 100;
|
||||||
rootPane.saveConfig();
|
rootPane.saveConfig();
|
||||||
}
|
}
|
||||||
|
|
@ -54,21 +57,23 @@ CollapsibleSection {
|
||||||
|
|
||||||
SliderInput {
|
SliderInput {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
label: qsTr("Transparency layers")
|
label: qsTr("Transparency layers")
|
||||||
value: rootPane.transparencyLayers * 100
|
value: rootPane.transparencyLayers * 100
|
||||||
from: 0
|
from: 0
|
||||||
to: 100
|
to: 100
|
||||||
suffix: "%"
|
suffix: "%"
|
||||||
validator: IntValidator { bottom: 0; top: 100 }
|
validator: IntValidator {
|
||||||
formatValueFunction: (val) => Math.round(val).toString()
|
bottom: 0
|
||||||
parseValueFunction: (text) => parseInt(text)
|
top: 100
|
||||||
|
}
|
||||||
onValueModified: (newValue) => {
|
formatValueFunction: val => Math.round(val).toString()
|
||||||
|
parseValueFunction: text => parseInt(text)
|
||||||
|
|
||||||
|
onValueModified: newValue => {
|
||||||
rootPane.transparencyLayers = newValue / 100;
|
rootPane.transparencyLayers = newValue / 100;
|
||||||
rootPane.saveConfig();
|
rootPane.saveConfig();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -19,7 +19,7 @@ SplitPaneWithDetails {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
activeItem: session.bt.active
|
activeItem: session.bt.active
|
||||||
paneIdGenerator: function(item) {
|
paneIdGenerator: function (item) {
|
||||||
return item ? (item.address || "") : "";
|
return item ? (item.address || "") : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,10 @@ Item {
|
||||||
|
|
||||||
property Session session
|
property Session session
|
||||||
property var device: null
|
property var device: null
|
||||||
|
|
||||||
property Component headerComponent: null
|
property Component headerComponent: null
|
||||||
property list<Component> sections: []
|
property list<Component> sections: []
|
||||||
|
|
||||||
property Component topContent: null
|
property Component topContent: null
|
||||||
property Component bottomContent: null
|
property Component bottomContent: null
|
||||||
|
|
||||||
|
|
@ -34,7 +34,7 @@ Item {
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
id: headerLoader
|
id: headerLoader
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
sourceComponent: root.headerComponent
|
sourceComponent: root.headerComponent
|
||||||
visible: root.headerComponent !== null
|
visible: root.headerComponent !== null
|
||||||
|
|
@ -42,7 +42,7 @@ Item {
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
id: topContentLoader
|
id: topContentLoader
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
sourceComponent: root.topContent
|
sourceComponent: root.topContent
|
||||||
visible: root.topContent !== null
|
visible: root.topContent !== null
|
||||||
|
|
@ -50,10 +50,10 @@ Item {
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
model: root.sections
|
model: root.sections
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
required property Component modelData
|
required property Component modelData
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
sourceComponent: modelData
|
sourceComponent: modelData
|
||||||
}
|
}
|
||||||
|
|
@ -61,11 +61,10 @@ Item {
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
id: bottomContentLoader
|
id: bottomContentLoader
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
sourceComponent: root.bottomContent
|
sourceComponent: root.bottomContent
|
||||||
visible: root.bottomContent !== null
|
visible: root.bottomContent !== null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,21 +16,21 @@ ColumnLayout {
|
||||||
property Session session: null
|
property Session session: null
|
||||||
property var model: null
|
property var model: null
|
||||||
property Component delegate: null
|
property Component delegate: null
|
||||||
|
|
||||||
property string title: ""
|
property string title: ""
|
||||||
property string description: ""
|
property string description: ""
|
||||||
property var activeItem: null
|
property var activeItem: null
|
||||||
property Component headerComponent: null
|
property Component headerComponent: null
|
||||||
property Component titleSuffix: null
|
property Component titleSuffix: null
|
||||||
property bool showHeader: true
|
property bool showHeader: true
|
||||||
|
|
||||||
signal itemSelected(var item)
|
signal itemSelected(var item)
|
||||||
|
|
||||||
spacing: Appearance.spacing.small
|
spacing: Appearance.spacing.small
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
id: headerLoader
|
id: headerLoader
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
sourceComponent: root.headerComponent
|
sourceComponent: root.headerComponent
|
||||||
visible: root.headerComponent !== null && root.showHeader
|
visible: root.headerComponent !== null && root.showHeader
|
||||||
|
|
@ -58,7 +58,7 @@ ColumnLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
property alias view: view
|
property alias view: view
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
|
|
@ -82,4 +82,3 @@ ColumnLayout {
|
||||||
clip: false
|
clip: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,12 +8,12 @@ SequentialAnimation {
|
||||||
|
|
||||||
required property Item target
|
required property Item target
|
||||||
property list<PropertyAction> propertyActions
|
property list<PropertyAction> propertyActions
|
||||||
|
|
||||||
property real scaleFrom: 1.0
|
property real scaleFrom: 1.0
|
||||||
property real scaleTo: 0.8
|
property real scaleTo: 0.8
|
||||||
property real opacityFrom: 1.0
|
property real opacityFrom: 1.0
|
||||||
property real opacityTo: 0.0
|
property real opacityTo: 0.0
|
||||||
|
|
||||||
ParallelAnimation {
|
ParallelAnimation {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
target: root.target
|
target: root.target
|
||||||
|
|
@ -24,7 +24,7 @@ SequentialAnimation {
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: Appearance.anim.curves.standardAccel
|
easing.bezierCurve: Appearance.anim.curves.standardAccel
|
||||||
}
|
}
|
||||||
|
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
target: root.target
|
target: root.target
|
||||||
property: "scale"
|
property: "scale"
|
||||||
|
|
@ -35,7 +35,7 @@ SequentialAnimation {
|
||||||
easing.bezierCurve: Appearance.anim.curves.standardAccel
|
easing.bezierCurve: Appearance.anim.curves.standardAccel
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ScriptAction {
|
ScriptAction {
|
||||||
script: {
|
script: {
|
||||||
for (let i = 0; i < root.propertyActions.length; i++) {
|
for (let i = 0; i < root.propertyActions.length; i++) {
|
||||||
|
|
@ -46,7 +46,7 @@ SequentialAnimation {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ParallelAnimation {
|
ParallelAnimation {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
target: root.target
|
target: root.target
|
||||||
|
|
@ -57,7 +57,7 @@ SequentialAnimation {
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: Appearance.anim.curves.standardDecel
|
easing.bezierCurve: Appearance.anim.curves.standardDecel
|
||||||
}
|
}
|
||||||
|
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
target: root.target
|
target: root.target
|
||||||
property: "scale"
|
property: "scale"
|
||||||
|
|
@ -69,4 +69,3 @@ SequentialAnimation {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,4 +35,3 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ ColumnLayout {
|
||||||
property int decimals: 1 // Number of decimal places to show (default: 1)
|
property int decimals: 1 // Number of decimal places to show (default: 1)
|
||||||
property var formatValueFunction: null // Optional custom format function
|
property var formatValueFunction: null // Optional custom format function
|
||||||
property var parseValueFunction: null // Optional custom parse function
|
property var parseValueFunction: null // Optional custom parse function
|
||||||
|
|
||||||
function formatValue(val: real): string {
|
function formatValue(val: real): string {
|
||||||
if (formatValueFunction) {
|
if (formatValueFunction) {
|
||||||
return formatValueFunction(val);
|
return formatValueFunction(val);
|
||||||
|
|
@ -34,7 +34,7 @@ ColumnLayout {
|
||||||
// For DoubleValidator or no validator, use the decimals property
|
// For DoubleValidator or no validator, use the decimals property
|
||||||
return val.toFixed(root.decimals);
|
return val.toFixed(root.decimals);
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseValue(text: string): real {
|
function parseValue(text: string): real {
|
||||||
if (parseValueFunction) {
|
if (parseValueFunction) {
|
||||||
return parseValueFunction(text);
|
return parseValueFunction(text);
|
||||||
|
|
@ -48,13 +48,13 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
return parseFloat(text);
|
return parseFloat(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
signal valueModified(real newValue)
|
signal valueModified(real newValue)
|
||||||
|
|
||||||
property bool _initialized: false
|
property bool _initialized: false
|
||||||
|
|
||||||
spacing: Appearance.spacing.small
|
spacing: Appearance.spacing.small
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
// Set initialized flag after a brief delay to allow component to fully load
|
// Set initialized flag after a brief delay to allow component to fully load
|
||||||
Qt.callLater(() => {
|
Qt.callLater(() => {
|
||||||
|
|
@ -80,13 +80,13 @@ ColumnLayout {
|
||||||
id: inputField
|
id: inputField
|
||||||
Layout.preferredWidth: 70
|
Layout.preferredWidth: 70
|
||||||
validator: root.validator
|
validator: root.validator
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
// Initialize text without triggering valueModified signal
|
// Initialize text without triggering valueModified signal
|
||||||
text = root.formatValue(root.value);
|
text = root.formatValue(root.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
onTextEdited: (text) => {
|
onTextEdited: text => {
|
||||||
if (hasFocus) {
|
if (hasFocus) {
|
||||||
const val = root.parseValue(text);
|
const val = root.parseValue(text);
|
||||||
if (!isNaN(val)) {
|
if (!isNaN(val)) {
|
||||||
|
|
@ -100,14 +100,14 @@ ColumnLayout {
|
||||||
isValid = false;
|
isValid = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
root.valueModified(val);
|
root.valueModified(val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onEditingFinished: {
|
onEditingFinished: {
|
||||||
const val = root.parseValue(text);
|
const val = root.parseValue(text);
|
||||||
let isValid = true;
|
let isValid = true;
|
||||||
|
|
@ -119,7 +119,7 @@ ColumnLayout {
|
||||||
isValid = false;
|
isValid = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isNaN(val) || !isValid) {
|
if (isNaN(val) || !isValid) {
|
||||||
text = root.formatValue(root.value);
|
text = root.formatValue(root.value);
|
||||||
}
|
}
|
||||||
|
|
@ -143,7 +143,7 @@ ColumnLayout {
|
||||||
from: root.from
|
from: root.from
|
||||||
to: root.to
|
to: root.to
|
||||||
stepSize: root.stepSize
|
stepSize: root.stepSize
|
||||||
|
|
||||||
// Use Binding to allow slider to move freely during dragging
|
// Use Binding to allow slider to move freely during dragging
|
||||||
Binding {
|
Binding {
|
||||||
target: slider
|
target: slider
|
||||||
|
|
@ -151,7 +151,7 @@ ColumnLayout {
|
||||||
value: root.value
|
value: root.value
|
||||||
when: !slider.pressed
|
when: !slider.pressed
|
||||||
}
|
}
|
||||||
|
|
||||||
onValueChanged: {
|
onValueChanged: {
|
||||||
// Update input field text in real-time as slider moves during dragging
|
// Update input field text in real-time as slider moves during dragging
|
||||||
// Always update when slider value changes (during dragging or external updates)
|
// Always update when slider value changes (during dragging or external updates)
|
||||||
|
|
@ -160,7 +160,7 @@ ColumnLayout {
|
||||||
inputField.text = root.formatValue(newValue);
|
inputField.text = root.formatValue(newValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onMoved: {
|
onMoved: {
|
||||||
const newValue = root.stepSize > 0 ? Math.round(value / root.stepSize) * root.stepSize : value;
|
const newValue = root.stepSize > 0 ? Math.round(value / root.stepSize) * root.stepSize : value;
|
||||||
root.valueModified(newValue);
|
root.valueModified(newValue);
|
||||||
|
|
@ -169,7 +169,7 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update input field when value changes externally (slider is already bound)
|
// Update input field when value changes externally (slider is already bound)
|
||||||
onValueChanged: {
|
onValueChanged: {
|
||||||
// Only update if component is initialized to avoid issues during creation
|
// Only update if component is initialized to avoid issues during creation
|
||||||
|
|
@ -178,4 +178,3 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,12 +14,12 @@ RowLayout {
|
||||||
|
|
||||||
property Component leftContent: null
|
property Component leftContent: null
|
||||||
property Component rightContent: null
|
property Component rightContent: null
|
||||||
|
|
||||||
property real leftWidthRatio: 0.4
|
property real leftWidthRatio: 0.4
|
||||||
property int leftMinimumWidth: 420
|
property int leftMinimumWidth: 420
|
||||||
property var leftLoaderProperties: ({})
|
property var leftLoaderProperties: ({})
|
||||||
property var rightLoaderProperties: ({})
|
property var rightLoaderProperties: ({})
|
||||||
|
|
||||||
property alias leftLoader: leftLoader
|
property alias leftLoader: leftLoader
|
||||||
property alias rightLoader: rightLoader
|
property alias rightLoader: rightLoader
|
||||||
|
|
||||||
|
|
@ -107,4 +107,3 @@ RowLayout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,12 @@ Item {
|
||||||
required property Component leftContent
|
required property Component leftContent
|
||||||
required property Component rightDetailsComponent
|
required property Component rightDetailsComponent
|
||||||
required property Component rightSettingsComponent
|
required property Component rightSettingsComponent
|
||||||
|
|
||||||
property var activeItem: null
|
property var activeItem: null
|
||||||
property var paneIdGenerator: function(item) { return item ? String(item) : ""; }
|
property var paneIdGenerator: function (item) {
|
||||||
|
return item ? String(item) : "";
|
||||||
|
}
|
||||||
|
|
||||||
property Component overlayComponent: null
|
property Component overlayComponent: null
|
||||||
|
|
||||||
SplitPaneLayout {
|
SplitPaneLayout {
|
||||||
|
|
@ -29,64 +31,63 @@ Item {
|
||||||
leftContent: root.leftContent
|
leftContent: root.leftContent
|
||||||
|
|
||||||
rightContent: Component {
|
rightContent: Component {
|
||||||
Item {
|
Item {
|
||||||
id: rightPaneItem
|
id: rightPaneItem
|
||||||
|
|
||||||
property var pane: root.activeItem
|
|
||||||
property string paneId: root.paneIdGenerator(pane)
|
|
||||||
property Component targetComponent: root.rightSettingsComponent
|
|
||||||
property Component nextComponent: root.rightSettingsComponent
|
|
||||||
|
|
||||||
function getComponentForPane() {
|
property var pane: root.activeItem
|
||||||
return pane ? root.rightDetailsComponent : root.rightSettingsComponent;
|
property string paneId: root.paneIdGenerator(pane)
|
||||||
}
|
property Component targetComponent: root.rightSettingsComponent
|
||||||
|
property Component nextComponent: root.rightSettingsComponent
|
||||||
|
|
||||||
Component.onCompleted: {
|
function getComponentForPane() {
|
||||||
targetComponent = getComponentForPane();
|
return pane ? root.rightDetailsComponent : root.rightSettingsComponent;
|
||||||
nextComponent = targetComponent;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Loader {
|
Component.onCompleted: {
|
||||||
id: rightLoader
|
targetComponent = getComponentForPane();
|
||||||
|
nextComponent = targetComponent;
|
||||||
|
}
|
||||||
|
|
||||||
anchors.fill: parent
|
Loader {
|
||||||
|
id: rightLoader
|
||||||
|
|
||||||
opacity: 1
|
anchors.fill: parent
|
||||||
scale: 1
|
|
||||||
transformOrigin: Item.Center
|
|
||||||
|
|
||||||
clip: false
|
opacity: 1
|
||||||
sourceComponent: rightPaneItem.targetComponent
|
scale: 1
|
||||||
}
|
transformOrigin: Item.Center
|
||||||
|
|
||||||
Behavior on paneId {
|
clip: false
|
||||||
PaneTransition {
|
sourceComponent: rightPaneItem.targetComponent
|
||||||
target: rightLoader
|
}
|
||||||
propertyActions: [
|
|
||||||
PropertyAction {
|
Behavior on paneId {
|
||||||
target: rightPaneItem
|
PaneTransition {
|
||||||
property: "targetComponent"
|
target: rightLoader
|
||||||
value: rightPaneItem.nextComponent
|
propertyActions: [
|
||||||
}
|
PropertyAction {
|
||||||
]
|
target: rightPaneItem
|
||||||
|
property: "targetComponent"
|
||||||
|
value: rightPaneItem.nextComponent
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onPaneChanged: {
|
||||||
|
nextComponent = getComponentForPane();
|
||||||
|
paneId = root.paneIdGenerator(pane);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onPaneChanged: {
|
|
||||||
nextComponent = getComponentForPane();
|
|
||||||
paneId = root.paneIdGenerator(pane);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
id: overlayLoader
|
id: overlayLoader
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
z: 1000
|
z: 1000
|
||||||
sourceComponent: root.overlayComponent
|
sourceComponent: root.overlayComponent
|
||||||
active: root.overlayComponent !== null
|
active: root.overlayComponent !== null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ GridView {
|
||||||
model: Wallpapers.list
|
model: Wallpapers.list
|
||||||
|
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
StyledScrollBar.vertical: StyledScrollBar {
|
StyledScrollBar.vertical: StyledScrollBar {
|
||||||
flickable: root
|
flickable: root
|
||||||
}
|
}
|
||||||
|
|
@ -40,189 +40,117 @@ GridView {
|
||||||
readonly property real itemMargin: Appearance.spacing.normal / 2
|
readonly property real itemMargin: Appearance.spacing.normal / 2
|
||||||
readonly property real itemRadius: Appearance.rounding.normal
|
readonly property real itemRadius: Appearance.rounding.normal
|
||||||
|
|
||||||
StateLayer {
|
StateLayer {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.leftMargin: itemMargin
|
anchors.leftMargin: itemMargin
|
||||||
anchors.rightMargin: itemMargin
|
anchors.rightMargin: itemMargin
|
||||||
anchors.topMargin: itemMargin
|
anchors.topMargin: itemMargin
|
||||||
anchors.bottomMargin: itemMargin
|
anchors.bottomMargin: itemMargin
|
||||||
radius: itemRadius
|
radius: itemRadius
|
||||||
|
|
||||||
function onClicked(): void {
|
function onClicked(): void {
|
||||||
Wallpapers.setWallpaper(modelData.path);
|
Wallpapers.setWallpaper(modelData.path);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
StyledClippingRect {
|
StyledClippingRect {
|
||||||
id: image
|
id: image
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.leftMargin: itemMargin
|
||||||
|
anchors.rightMargin: itemMargin
|
||||||
|
anchors.topMargin: itemMargin
|
||||||
|
anchors.bottomMargin: itemMargin
|
||||||
|
color: Colours.tPalette.m3surfaceContainer
|
||||||
|
radius: itemRadius
|
||||||
|
antialiasing: true
|
||||||
|
layer.enabled: true
|
||||||
|
layer.smooth: true
|
||||||
|
|
||||||
|
CachingImage {
|
||||||
|
id: cachingImage
|
||||||
|
|
||||||
|
path: modelData.path
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.leftMargin: itemMargin
|
fillMode: Image.PreserveAspectCrop
|
||||||
anchors.rightMargin: itemMargin
|
cache: true
|
||||||
anchors.topMargin: itemMargin
|
visible: opacity > 0
|
||||||
anchors.bottomMargin: itemMargin
|
|
||||||
color: Colours.tPalette.m3surfaceContainer
|
|
||||||
radius: itemRadius
|
|
||||||
antialiasing: true
|
|
||||||
layer.enabled: true
|
|
||||||
layer.smooth: true
|
|
||||||
|
|
||||||
CachingImage {
|
|
||||||
id: cachingImage
|
|
||||||
|
|
||||||
path: modelData.path
|
|
||||||
anchors.fill: parent
|
|
||||||
fillMode: Image.PreserveAspectCrop
|
|
||||||
cache: true
|
|
||||||
visible: opacity > 0
|
|
||||||
antialiasing: true
|
|
||||||
smooth: true
|
|
||||||
sourceSize: Qt.size(width, height)
|
|
||||||
|
|
||||||
opacity: status === Image.Ready ? 1 : 0
|
|
||||||
|
|
||||||
Behavior on opacity {
|
|
||||||
NumberAnimation {
|
|
||||||
duration: 1000
|
|
||||||
easing.type: Easing.OutQuad
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fallback if CachingImage fails to load
|
|
||||||
Image {
|
|
||||||
id: fallbackImage
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
source: fallbackTimer.triggered && cachingImage.status !== Image.Ready ? modelData.path : ""
|
|
||||||
asynchronous: true
|
|
||||||
fillMode: Image.PreserveAspectCrop
|
|
||||||
cache: true
|
|
||||||
visible: opacity > 0
|
|
||||||
antialiasing: true
|
|
||||||
smooth: true
|
|
||||||
sourceSize: Qt.size(width, height)
|
|
||||||
|
|
||||||
opacity: status === Image.Ready && cachingImage.status !== Image.Ready ? 1 : 0
|
|
||||||
|
|
||||||
Behavior on opacity {
|
|
||||||
NumberAnimation {
|
|
||||||
duration: 1000
|
|
||||||
easing.type: Easing.OutQuad
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Timer {
|
|
||||||
id: fallbackTimer
|
|
||||||
|
|
||||||
property bool triggered: false
|
|
||||||
interval: 800
|
|
||||||
running: cachingImage.status === Image.Loading || cachingImage.status === Image.Null
|
|
||||||
onTriggered: triggered = true
|
|
||||||
}
|
|
||||||
|
|
||||||
// Gradient overlay for filename
|
|
||||||
Rectangle {
|
|
||||||
id: filenameOverlay
|
|
||||||
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
|
|
||||||
implicitHeight: filenameText.implicitHeight + Appearance.padding.normal * 1.5
|
|
||||||
radius: 0
|
|
||||||
|
|
||||||
gradient: Gradient {
|
|
||||||
GradientStop {
|
|
||||||
position: 0.0
|
|
||||||
color: Qt.rgba(Colours.palette.m3surface.r,
|
|
||||||
Colours.palette.m3surface.g,
|
|
||||||
Colours.palette.m3surface.b, 0)
|
|
||||||
}
|
|
||||||
GradientStop {
|
|
||||||
position: 0.3
|
|
||||||
color: Qt.rgba(Colours.palette.m3surface.r,
|
|
||||||
Colours.palette.m3surface.g,
|
|
||||||
Colours.palette.m3surface.b, 0.7)
|
|
||||||
}
|
|
||||||
GradientStop {
|
|
||||||
position: 0.6
|
|
||||||
color: Qt.rgba(Colours.palette.m3surface.r,
|
|
||||||
Colours.palette.m3surface.g,
|
|
||||||
Colours.palette.m3surface.b, 0.9)
|
|
||||||
}
|
|
||||||
GradientStop {
|
|
||||||
position: 1.0
|
|
||||||
color: Qt.rgba(Colours.palette.m3surface.r,
|
|
||||||
Colours.palette.m3surface.g,
|
|
||||||
Colours.palette.m3surface.b, 0.95)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
opacity: 0
|
|
||||||
|
|
||||||
Behavior on opacity {
|
|
||||||
NumberAnimation {
|
|
||||||
duration: 1000
|
|
||||||
easing.type: Easing.OutCubic
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
opacity = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.leftMargin: itemMargin
|
|
||||||
anchors.rightMargin: itemMargin
|
|
||||||
anchors.topMargin: itemMargin
|
|
||||||
anchors.bottomMargin: itemMargin
|
|
||||||
color: "transparent"
|
|
||||||
radius: itemRadius + border.width
|
|
||||||
border.width: isCurrent ? 2 : 0
|
|
||||||
border.color: Colours.palette.m3primary
|
|
||||||
antialiasing: true
|
antialiasing: true
|
||||||
smooth: true
|
smooth: true
|
||||||
|
sourceSize: Qt.size(width, height)
|
||||||
|
|
||||||
Behavior on border.width {
|
opacity: status === Image.Ready ? 1 : 0
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: 150
|
duration: 1000
|
||||||
easing.type: Easing.OutQuad
|
easing.type: Easing.OutQuad
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
MaterialIcon {
|
// Fallback if CachingImage fails to load
|
||||||
anchors.right: parent.right
|
Image {
|
||||||
anchors.top: parent.top
|
id: fallbackImage
|
||||||
anchors.margins: Appearance.padding.small
|
|
||||||
|
|
||||||
visible: isCurrent
|
anchors.fill: parent
|
||||||
text: "check_circle"
|
source: fallbackTimer.triggered && cachingImage.status !== Image.Ready ? modelData.path : ""
|
||||||
color: Colours.palette.m3primary
|
asynchronous: true
|
||||||
font.pointSize: Appearance.font.size.large
|
fillMode: Image.PreserveAspectCrop
|
||||||
|
cache: true
|
||||||
|
visible: opacity > 0
|
||||||
|
antialiasing: true
|
||||||
|
smooth: true
|
||||||
|
sourceSize: Qt.size(width, height)
|
||||||
|
|
||||||
|
opacity: status === Image.Ready && cachingImage.status !== Image.Ready ? 1 : 0
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
NumberAnimation {
|
||||||
|
duration: 1000
|
||||||
|
easing.type: Easing.OutQuad
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
Timer {
|
||||||
id: filenameText
|
id: fallbackTimer
|
||||||
|
|
||||||
|
property bool triggered: false
|
||||||
|
interval: 800
|
||||||
|
running: cachingImage.status === Image.Loading || cachingImage.status === Image.Null
|
||||||
|
onTriggered: triggered = true
|
||||||
|
}
|
||||||
|
|
||||||
|
// Gradient overlay for filename
|
||||||
|
Rectangle {
|
||||||
|
id: filenameOverlay
|
||||||
|
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.leftMargin: Appearance.padding.normal + Appearance.spacing.normal / 2
|
|
||||||
anchors.rightMargin: Appearance.padding.normal + Appearance.spacing.normal / 2
|
|
||||||
anchors.bottomMargin: Appearance.padding.normal
|
|
||||||
|
|
||||||
text: modelData.name
|
implicitHeight: filenameText.implicitHeight + Appearance.padding.normal * 1.5
|
||||||
font.pointSize: Appearance.font.size.smaller
|
radius: 0
|
||||||
font.weight: 500
|
|
||||||
color: isCurrent ? Colours.palette.m3primary : Colours.palette.m3onSurface
|
gradient: Gradient {
|
||||||
elide: Text.ElideMiddle
|
GradientStop {
|
||||||
maximumLineCount: 1
|
position: 0.0
|
||||||
horizontalAlignment: Text.AlignHCenter
|
color: Qt.rgba(Colours.palette.m3surface.r, Colours.palette.m3surface.g, Colours.palette.m3surface.b, 0)
|
||||||
|
}
|
||||||
|
GradientStop {
|
||||||
|
position: 0.3
|
||||||
|
color: Qt.rgba(Colours.palette.m3surface.r, Colours.palette.m3surface.g, Colours.palette.m3surface.b, 0.7)
|
||||||
|
}
|
||||||
|
GradientStop {
|
||||||
|
position: 0.6
|
||||||
|
color: Qt.rgba(Colours.palette.m3surface.r, Colours.palette.m3surface.g, Colours.palette.m3surface.b, 0.9)
|
||||||
|
}
|
||||||
|
GradientStop {
|
||||||
|
position: 1.0
|
||||||
|
color: Qt.rgba(Colours.palette.m3surface.r, Colours.palette.m3surface.g, Colours.palette.m3surface.b, 0.95)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
opacity: 0
|
opacity: 0
|
||||||
|
|
||||||
|
|
@ -238,4 +166,68 @@ GridView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.leftMargin: itemMargin
|
||||||
|
anchors.rightMargin: itemMargin
|
||||||
|
anchors.topMargin: itemMargin
|
||||||
|
anchors.bottomMargin: itemMargin
|
||||||
|
color: "transparent"
|
||||||
|
radius: itemRadius + border.width
|
||||||
|
border.width: isCurrent ? 2 : 0
|
||||||
|
border.color: Colours.palette.m3primary
|
||||||
|
antialiasing: true
|
||||||
|
smooth: true
|
||||||
|
|
||||||
|
Behavior on border.width {
|
||||||
|
NumberAnimation {
|
||||||
|
duration: 150
|
||||||
|
easing.type: Easing.OutQuad
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MaterialIcon {
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.margins: Appearance.padding.small
|
||||||
|
|
||||||
|
visible: isCurrent
|
||||||
|
text: "check_circle"
|
||||||
|
color: Colours.palette.m3primary
|
||||||
|
font.pointSize: Appearance.font.size.large
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
id: filenameText
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.leftMargin: Appearance.padding.normal + Appearance.spacing.normal / 2
|
||||||
|
anchors.rightMargin: Appearance.padding.normal + Appearance.spacing.normal / 2
|
||||||
|
anchors.bottomMargin: Appearance.padding.normal
|
||||||
|
|
||||||
|
text: modelData.name
|
||||||
|
font.pointSize: Appearance.font.size.smaller
|
||||||
|
font.weight: 500
|
||||||
|
color: isCurrent ? Colours.palette.m3primary : Colours.palette.m3onSurface
|
||||||
|
elide: Text.ElideMiddle
|
||||||
|
maximumLineCount: 1
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
|
||||||
|
opacity: 0
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
NumberAnimation {
|
||||||
|
duration: 1000
|
||||||
|
easing.type: Easing.OutCubic
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
opacity = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,6 @@ Item {
|
||||||
Config.save();
|
Config.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
AppDb {
|
AppDb {
|
||||||
id: allAppsDb
|
id: allAppsDb
|
||||||
|
|
||||||
|
|
@ -118,9 +117,7 @@ Item {
|
||||||
scoreFn: r => r[0].score
|
scoreFn: r => r[0].score
|
||||||
});
|
});
|
||||||
|
|
||||||
return results
|
return results.sort((a, b) => b._score - a._score).map(r => r.obj._item);
|
||||||
.sort((a, b) => b._score - a._score)
|
|
||||||
.map(r => r.obj._item);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
property list<var> filteredApps: []
|
property list<var> filteredApps: []
|
||||||
|
|
@ -156,214 +153,214 @@ Item {
|
||||||
spacing: Appearance.spacing.small
|
spacing: Appearance.spacing.small
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
spacing: Appearance.spacing.smaller
|
spacing: Appearance.spacing.smaller
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: qsTr("Launcher")
|
||||||
|
font.pointSize: Appearance.font.size.large
|
||||||
|
font.weight: 500
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
|
||||||
|
ToggleButton {
|
||||||
|
toggled: !root.session.launcher.active
|
||||||
|
icon: "settings"
|
||||||
|
accent: "Primary"
|
||||||
|
iconSize: Appearance.font.size.normal
|
||||||
|
horizontalPadding: Appearance.padding.normal
|
||||||
|
verticalPadding: Appearance.padding.smaller
|
||||||
|
tooltip: qsTr("Launcher settings")
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
if (root.session.launcher.active) {
|
||||||
|
root.session.launcher.active = null;
|
||||||
|
} else {
|
||||||
|
if (root.filteredApps.length > 0) {
|
||||||
|
root.session.launcher.active = root.filteredApps[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: qsTr("Launcher")
|
Layout.topMargin: Appearance.spacing.large
|
||||||
font.pointSize: Appearance.font.size.large
|
text: qsTr("Applications (%1)").arg(root.searchText ? root.filteredApps.length : allAppsDb.apps.length)
|
||||||
|
font.pointSize: Appearance.font.size.normal
|
||||||
font.weight: 500
|
font.weight: 500
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
StyledText {
|
||||||
Layout.fillWidth: true
|
text: qsTr("All applications available in the launcher")
|
||||||
|
color: Colours.palette.m3outline
|
||||||
}
|
}
|
||||||
|
|
||||||
ToggleButton {
|
StyledRect {
|
||||||
toggled: !root.session.launcher.active
|
Layout.fillWidth: true
|
||||||
icon: "settings"
|
Layout.topMargin: Appearance.spacing.normal
|
||||||
accent: "Primary"
|
Layout.bottomMargin: Appearance.spacing.small
|
||||||
iconSize: Appearance.font.size.normal
|
|
||||||
horizontalPadding: Appearance.padding.normal
|
|
||||||
verticalPadding: Appearance.padding.smaller
|
|
||||||
tooltip: qsTr("Launcher settings")
|
|
||||||
|
|
||||||
onClicked: {
|
color: Colours.layer(Colours.palette.m3surfaceContainer, 2)
|
||||||
if (root.session.launcher.active) {
|
radius: Appearance.rounding.full
|
||||||
root.session.launcher.active = null;
|
|
||||||
} else {
|
implicitHeight: Math.max(searchIcon.implicitHeight, searchField.implicitHeight, clearIcon.implicitHeight)
|
||||||
if (root.filteredApps.length > 0) {
|
|
||||||
root.session.launcher.active = root.filteredApps[0];
|
MaterialIcon {
|
||||||
|
id: searchIcon
|
||||||
|
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.leftMargin: Appearance.padding.normal
|
||||||
|
|
||||||
|
text: "search"
|
||||||
|
color: Colours.palette.m3onSurfaceVariant
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledTextField {
|
||||||
|
id: searchField
|
||||||
|
|
||||||
|
anchors.left: searchIcon.right
|
||||||
|
anchors.right: clearIcon.left
|
||||||
|
anchors.leftMargin: Appearance.spacing.small
|
||||||
|
anchors.rightMargin: Appearance.spacing.small
|
||||||
|
|
||||||
|
topPadding: Appearance.padding.normal
|
||||||
|
bottomPadding: Appearance.padding.normal
|
||||||
|
|
||||||
|
placeholderText: qsTr("Search applications...")
|
||||||
|
|
||||||
|
onTextChanged: {
|
||||||
|
root.searchText = text;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MaterialIcon {
|
||||||
|
id: clearIcon
|
||||||
|
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.rightMargin: Appearance.padding.normal
|
||||||
|
|
||||||
|
width: searchField.text ? implicitWidth : implicitWidth / 2
|
||||||
|
opacity: {
|
||||||
|
if (!searchField.text)
|
||||||
|
return 0;
|
||||||
|
if (clearMouse.pressed)
|
||||||
|
return 0.7;
|
||||||
|
if (clearMouse.containsMouse)
|
||||||
|
return 0.8;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
text: "close"
|
||||||
|
color: Colours.palette.m3onSurfaceVariant
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: clearMouse
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
hoverEnabled: true
|
||||||
|
cursorShape: searchField.text ? Qt.PointingHandCursor : undefined
|
||||||
|
|
||||||
|
onClicked: searchField.text = ""
|
||||||
|
}
|
||||||
|
|
||||||
|
Behavior on width {
|
||||||
|
Anim {
|
||||||
|
duration: Appearance.anim.durations.small
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
Layout.topMargin: Appearance.spacing.large
|
|
||||||
text: qsTr("Applications (%1)").arg(root.searchText ? root.filteredApps.length : allAppsDb.apps.length)
|
|
||||||
font.pointSize: Appearance.font.size.normal
|
|
||||||
font.weight: 500
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: qsTr("All applications available in the launcher")
|
|
||||||
color: Colours.palette.m3outline
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledRect {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.topMargin: Appearance.spacing.normal
|
|
||||||
Layout.bottomMargin: Appearance.spacing.small
|
|
||||||
|
|
||||||
color: Colours.layer(Colours.palette.m3surfaceContainer, 2)
|
|
||||||
radius: Appearance.rounding.full
|
|
||||||
|
|
||||||
implicitHeight: Math.max(searchIcon.implicitHeight, searchField.implicitHeight, clearIcon.implicitHeight)
|
|
||||||
|
|
||||||
MaterialIcon {
|
|
||||||
id: searchIcon
|
|
||||||
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: Appearance.padding.normal
|
|
||||||
|
|
||||||
text: "search"
|
|
||||||
color: Colours.palette.m3onSurfaceVariant
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledTextField {
|
|
||||||
id: searchField
|
|
||||||
|
|
||||||
anchors.left: searchIcon.right
|
|
||||||
anchors.right: clearIcon.left
|
|
||||||
anchors.leftMargin: Appearance.spacing.small
|
|
||||||
anchors.rightMargin: Appearance.spacing.small
|
|
||||||
|
|
||||||
topPadding: Appearance.padding.normal
|
|
||||||
bottomPadding: Appearance.padding.normal
|
|
||||||
|
|
||||||
placeholderText: qsTr("Search applications...")
|
|
||||||
|
|
||||||
onTextChanged: {
|
|
||||||
root.searchText = text;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MaterialIcon {
|
|
||||||
id: clearIcon
|
|
||||||
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.rightMargin: Appearance.padding.normal
|
|
||||||
|
|
||||||
width: searchField.text ? implicitWidth : implicitWidth / 2
|
|
||||||
opacity: {
|
|
||||||
if (!searchField.text)
|
|
||||||
return 0;
|
|
||||||
if (clearMouse.pressed)
|
|
||||||
return 0.7;
|
|
||||||
if (clearMouse.containsMouse)
|
|
||||||
return 0.8;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
text: "close"
|
|
||||||
color: Colours.palette.m3onSurfaceVariant
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: clearMouse
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: searchField.text ? Qt.PointingHandCursor : undefined
|
|
||||||
|
|
||||||
onClicked: searchField.text = ""
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on width {
|
|
||||||
Anim {
|
|
||||||
duration: Appearance.anim.durations.small
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on opacity {
|
|
||||||
Anim {
|
|
||||||
duration: Appearance.anim.durations.small
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Loader {
|
|
||||||
id: appsListLoader
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.fillHeight: true
|
|
||||||
active: true
|
|
||||||
|
|
||||||
sourceComponent: StyledListView {
|
|
||||||
id: appsListView
|
|
||||||
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.fillHeight: true
|
|
||||||
|
|
||||||
model: root.filteredApps
|
|
||||||
spacing: Appearance.spacing.small / 2
|
|
||||||
clip: true
|
|
||||||
|
|
||||||
StyledScrollBar.vertical: StyledScrollBar {
|
|
||||||
flickable: parent
|
|
||||||
}
|
|
||||||
|
|
||||||
delegate: StyledRect {
|
|
||||||
required property var modelData
|
|
||||||
|
|
||||||
width: parent ? parent.width : 0
|
|
||||||
|
|
||||||
readonly property bool isSelected: root.selectedApp === modelData
|
|
||||||
|
|
||||||
color: isSelected ? Colours.layer(Colours.palette.m3surfaceContainer, 2) : "transparent"
|
|
||||||
radius: Appearance.rounding.normal
|
|
||||||
|
|
||||||
opacity: 0
|
|
||||||
|
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
NumberAnimation {
|
Anim {
|
||||||
duration: 1000
|
duration: Appearance.anim.durations.small
|
||||||
easing.type: Easing.OutCubic
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Loader {
|
||||||
opacity = 1;
|
id: appsListLoader
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.fillHeight: true
|
||||||
|
active: true
|
||||||
|
|
||||||
|
sourceComponent: StyledListView {
|
||||||
|
id: appsListView
|
||||||
|
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.fillHeight: true
|
||||||
|
|
||||||
|
model: root.filteredApps
|
||||||
|
spacing: Appearance.spacing.small / 2
|
||||||
|
clip: true
|
||||||
|
|
||||||
|
StyledScrollBar.vertical: StyledScrollBar {
|
||||||
|
flickable: parent
|
||||||
}
|
}
|
||||||
|
|
||||||
StateLayer {
|
delegate: StyledRect {
|
||||||
function onClicked(): void {
|
required property var modelData
|
||||||
root.session.launcher.active = modelData;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
RowLayout {
|
width: parent ? parent.width : 0
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
anchors.margins: Appearance.padding.normal
|
|
||||||
|
|
||||||
spacing: Appearance.spacing.normal
|
readonly property bool isSelected: root.selectedApp === modelData
|
||||||
|
|
||||||
IconImage {
|
color: isSelected ? Colours.layer(Colours.palette.m3surfaceContainer, 2) : "transparent"
|
||||||
Layout.alignment: Qt.AlignVCenter
|
radius: Appearance.rounding.normal
|
||||||
implicitSize: 32
|
|
||||||
source: {
|
opacity: 0
|
||||||
const entry = modelData.entry;
|
|
||||||
return entry ? Quickshell.iconPath(entry.icon, "image-missing") : "image-missing";
|
Behavior on opacity {
|
||||||
|
NumberAnimation {
|
||||||
|
duration: 1000
|
||||||
|
easing.type: Easing.OutCubic
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
Component.onCompleted: {
|
||||||
Layout.fillWidth: true
|
opacity = 1;
|
||||||
text: modelData.name || modelData.entry?.name || qsTr("Unknown")
|
|
||||||
font.pointSize: Appearance.font.size.normal
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
implicitHeight: 40
|
StateLayer {
|
||||||
|
function onClicked(): void {
|
||||||
|
root.session.launcher.active = modelData;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
anchors.margins: Appearance.padding.normal
|
||||||
|
|
||||||
|
spacing: Appearance.spacing.normal
|
||||||
|
|
||||||
|
IconImage {
|
||||||
|
Layout.alignment: Qt.AlignVCenter
|
||||||
|
implicitSize: 32
|
||||||
|
source: {
|
||||||
|
const entry = modelData.entry;
|
||||||
|
return entry ? Quickshell.iconPath(entry.icon, "image-missing") : "image-missing";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
text: modelData.name || modelData.entry?.name || qsTr("Unknown")
|
||||||
|
font.pointSize: Appearance.font.size.normal
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
implicitHeight: 40
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
rightContent: Component {
|
rightContent: Component {
|
||||||
Item {
|
Item {
|
||||||
|
|
@ -518,7 +515,8 @@ Item {
|
||||||
implicitSize: Appearance.font.size.extraLarge * 3 * 2
|
implicitSize: Appearance.font.size.extraLarge * 3 * 2
|
||||||
source: {
|
source: {
|
||||||
const app = appDetailsLayout.displayedApp;
|
const app = appDetailsLayout.displayedApp;
|
||||||
if (!app) return "image-missing";
|
if (!app)
|
||||||
|
return "image-missing";
|
||||||
const entry = app.entry;
|
const entry = app.entry;
|
||||||
if (entry && entry.icon) {
|
if (entry && entry.icon) {
|
||||||
return Quickshell.iconPath(entry.icon, "image-missing");
|
return Quickshell.iconPath(entry.icon, "image-missing");
|
||||||
|
|
@ -561,35 +559,34 @@ Item {
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
spacing: Appearance.spacing.normal
|
spacing: Appearance.spacing.normal
|
||||||
|
|
||||||
SwitchRow {
|
SwitchRow {
|
||||||
Layout.topMargin: Appearance.spacing.normal
|
Layout.topMargin: Appearance.spacing.normal
|
||||||
visible: appDetailsLayout.displayedApp !== null
|
visible: appDetailsLayout.displayedApp !== null
|
||||||
label: qsTr("Hide from launcher")
|
label: qsTr("Hide from launcher")
|
||||||
checked: root.hideFromLauncherChecked
|
checked: root.hideFromLauncherChecked
|
||||||
enabled: appDetailsLayout.displayedApp !== null
|
enabled: appDetailsLayout.displayedApp !== null
|
||||||
onToggled: checked => {
|
onToggled: checked => {
|
||||||
root.hideFromLauncherChecked = checked;
|
root.hideFromLauncherChecked = checked;
|
||||||
const app = appDetailsLayout.displayedApp;
|
const app = appDetailsLayout.displayedApp;
|
||||||
if (app) {
|
if (app) {
|
||||||
const appId = app.id || app.entry?.id;
|
const appId = app.id || app.entry?.id;
|
||||||
const hiddenApps = Config.launcher.hiddenApps ? [...Config.launcher.hiddenApps] : [];
|
const hiddenApps = Config.launcher.hiddenApps ? [...Config.launcher.hiddenApps] : [];
|
||||||
if (checked) {
|
if (checked) {
|
||||||
if (!hiddenApps.includes(appId)) {
|
if (!hiddenApps.includes(appId)) {
|
||||||
hiddenApps.push(appId);
|
hiddenApps.push(appId);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const index = hiddenApps.indexOf(appId);
|
const index = hiddenApps.indexOf(appId);
|
||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
hiddenApps.splice(index, 1);
|
hiddenApps.splice(index, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Config.launcher.hiddenApps = hiddenApps;
|
||||||
|
Config.save();
|
||||||
}
|
}
|
||||||
Config.launcher.hiddenApps = hiddenApps;
|
|
||||||
Config.save();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -215,4 +215,3 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ DeviceDetails {
|
||||||
|
|
||||||
required property Session session
|
required property Session session
|
||||||
readonly property var ethernetDevice: root.session.ethernet.active
|
readonly property var ethernetDevice: root.session.ethernet.active
|
||||||
|
|
||||||
device: ethernetDevice
|
device: ethernetDevice
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
|
|
|
||||||
|
|
@ -171,7 +171,7 @@ DeviceList {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onItemSelected: function(item) {
|
onItemSelected: function (item) {
|
||||||
session.ethernet.active = item;
|
session.ethernet.active = item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ SplitPaneWithDetails {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
activeItem: session.ethernet.active
|
activeItem: session.ethernet.active
|
||||||
paneIdGenerator: function(item) {
|
paneIdGenerator: function (item) {
|
||||||
return item ? (item.interface || "") : "";
|
return item ? (item.interface || "") : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -73,4 +73,4 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -138,30 +138,30 @@ ColumnLayout {
|
||||||
|
|
||||||
Popup {
|
Popup {
|
||||||
id: vpnSettingsDialog
|
id: vpnSettingsDialog
|
||||||
|
|
||||||
parent: Overlay.overlay
|
parent: Overlay.overlay
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
width: Math.min(600, parent.width - Appearance.padding.large * 2)
|
width: Math.min(600, parent.width - Appearance.padding.large * 2)
|
||||||
height: Math.min(700, parent.height - Appearance.padding.large * 2)
|
height: Math.min(700, parent.height - Appearance.padding.large * 2)
|
||||||
|
|
||||||
modal: true
|
modal: true
|
||||||
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
||||||
|
|
||||||
background: StyledRect {
|
background: StyledRect {
|
||||||
color: Colours.palette.m3surface
|
color: Colours.palette.m3surface
|
||||||
radius: Appearance.rounding.large
|
radius: Appearance.rounding.large
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledFlickable {
|
StyledFlickable {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: Appearance.padding.large * 1.5
|
anchors.margins: Appearance.padding.large * 1.5
|
||||||
flickableDirection: Flickable.VerticalFlick
|
flickableDirection: Flickable.VerticalFlick
|
||||||
contentHeight: vpnSettingsContent.height
|
contentHeight: vpnSettingsContent.height
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
VpnSettings {
|
VpnSettings {
|
||||||
id: vpnSettingsContent
|
id: vpnSettingsContent
|
||||||
|
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
session: root.session
|
session: root.session
|
||||||
|
|
@ -169,4 +169,3 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -171,7 +171,7 @@ Item {
|
||||||
rightContent: Component {
|
rightContent: Component {
|
||||||
Item {
|
Item {
|
||||||
id: rightPaneItem
|
id: rightPaneItem
|
||||||
|
|
||||||
property var vpnPane: root.session && root.session.vpn ? root.session.vpn.active : null
|
property var vpnPane: root.session && root.session.vpn ? root.session.vpn.active : null
|
||||||
property var ethernetPane: root.session && root.session.ethernet ? root.session.ethernet.active : null
|
property var ethernetPane: root.session && root.session.ethernet ? root.session.ethernet.active : null
|
||||||
property var wirelessPane: root.session && root.session.network ? root.session.network.active : null
|
property var wirelessPane: root.session && root.session.network ? root.session.network.active : null
|
||||||
|
|
@ -181,9 +181,12 @@ Item {
|
||||||
property Component nextComponent: settingsComponent
|
property Component nextComponent: settingsComponent
|
||||||
|
|
||||||
function getComponentForPane() {
|
function getComponentForPane() {
|
||||||
if (vpnPane) return vpnDetailsComponent;
|
if (vpnPane)
|
||||||
if (ethernetPane) return ethernetDetailsComponent;
|
return vpnDetailsComponent;
|
||||||
if (wirelessPane) return wirelessDetailsComponent;
|
if (ethernetPane)
|
||||||
|
return ethernetDetailsComponent;
|
||||||
|
if (wirelessPane)
|
||||||
|
return wirelessDetailsComponent;
|
||||||
return settingsComponent;
|
return settingsComponent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -195,12 +198,14 @@ Item {
|
||||||
Connections {
|
Connections {
|
||||||
target: root.session && root.session.vpn ? root.session.vpn : null
|
target: root.session && root.session.vpn ? root.session.vpn : null
|
||||||
enabled: target !== null
|
enabled: target !== null
|
||||||
|
|
||||||
function onActiveChanged() {
|
function onActiveChanged() {
|
||||||
// Clear others when VPN is selected
|
// Clear others when VPN is selected
|
||||||
if (root.session && root.session.vpn && root.session.vpn.active) {
|
if (root.session && root.session.vpn && root.session.vpn.active) {
|
||||||
if (root.session.ethernet && root.session.ethernet.active) root.session.ethernet.active = null;
|
if (root.session.ethernet && root.session.ethernet.active)
|
||||||
if (root.session.network && root.session.network.active) root.session.network.active = null;
|
root.session.ethernet.active = null;
|
||||||
|
if (root.session.network && root.session.network.active)
|
||||||
|
root.session.network.active = null;
|
||||||
}
|
}
|
||||||
rightPaneItem.nextComponent = rightPaneItem.getComponentForPane();
|
rightPaneItem.nextComponent = rightPaneItem.getComponentForPane();
|
||||||
}
|
}
|
||||||
|
|
@ -209,12 +214,14 @@ Item {
|
||||||
Connections {
|
Connections {
|
||||||
target: root.session && root.session.ethernet ? root.session.ethernet : null
|
target: root.session && root.session.ethernet ? root.session.ethernet : null
|
||||||
enabled: target !== null
|
enabled: target !== null
|
||||||
|
|
||||||
function onActiveChanged() {
|
function onActiveChanged() {
|
||||||
// Clear others when ethernet is selected
|
// Clear others when ethernet is selected
|
||||||
if (root.session && root.session.ethernet && root.session.ethernet.active) {
|
if (root.session && root.session.ethernet && root.session.ethernet.active) {
|
||||||
if (root.session.vpn && root.session.vpn.active) root.session.vpn.active = null;
|
if (root.session.vpn && root.session.vpn.active)
|
||||||
if (root.session.network && root.session.network.active) root.session.network.active = null;
|
root.session.vpn.active = null;
|
||||||
|
if (root.session.network && root.session.network.active)
|
||||||
|
root.session.network.active = null;
|
||||||
}
|
}
|
||||||
rightPaneItem.nextComponent = rightPaneItem.getComponentForPane();
|
rightPaneItem.nextComponent = rightPaneItem.getComponentForPane();
|
||||||
}
|
}
|
||||||
|
|
@ -223,12 +230,14 @@ Item {
|
||||||
Connections {
|
Connections {
|
||||||
target: root.session && root.session.network ? root.session.network : null
|
target: root.session && root.session.network ? root.session.network : null
|
||||||
enabled: target !== null
|
enabled: target !== null
|
||||||
|
|
||||||
function onActiveChanged() {
|
function onActiveChanged() {
|
||||||
// Clear others when wireless is selected
|
// Clear others when wireless is selected
|
||||||
if (root.session && root.session.network && root.session.network.active) {
|
if (root.session && root.session.network && root.session.network.active) {
|
||||||
if (root.session.vpn && root.session.vpn.active) root.session.vpn.active = null;
|
if (root.session.vpn && root.session.vpn.active)
|
||||||
if (root.session.ethernet && root.session.ethernet.active) root.session.ethernet.active = null;
|
root.session.vpn.active = null;
|
||||||
|
if (root.session.ethernet && root.session.ethernet.active)
|
||||||
|
root.session.ethernet.active = null;
|
||||||
}
|
}
|
||||||
rightPaneItem.nextComponent = rightPaneItem.getComponentForPane();
|
rightPaneItem.nextComponent = rightPaneItem.getComponentForPane();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,17 +54,17 @@ ColumnLayout {
|
||||||
ListView {
|
ListView {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: contentHeight
|
Layout.preferredHeight: contentHeight
|
||||||
|
|
||||||
interactive: false
|
interactive: false
|
||||||
spacing: Appearance.spacing.smaller
|
spacing: Appearance.spacing.smaller
|
||||||
|
|
||||||
model: ScriptModel {
|
model: ScriptModel {
|
||||||
values: Config.utilities.vpn.provider.map((provider, index) => {
|
values: Config.utilities.vpn.provider.map((provider, index) => {
|
||||||
const isObject = typeof provider === "object";
|
const isObject = typeof provider === "object";
|
||||||
const name = isObject ? (provider.name || "custom") : String(provider);
|
const name = isObject ? (provider.name || "custom") : String(provider);
|
||||||
const displayName = isObject ? (provider.displayName || name) : name;
|
const displayName = isObject ? (provider.displayName || name) : name;
|
||||||
const iface = isObject ? (provider.interface || "") : "";
|
const iface = isObject ? (provider.interface || "") : "";
|
||||||
|
|
||||||
return {
|
return {
|
||||||
index: index,
|
index: index,
|
||||||
name: name,
|
name: name,
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ DeviceDetails {
|
||||||
|
|
||||||
required property Session session
|
required property Session session
|
||||||
readonly property var network: root.session.network.active
|
readonly property var network: root.session.network.active
|
||||||
|
|
||||||
device: network
|
device: network
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
|
|
@ -66,8 +66,7 @@ DeviceDetails {
|
||||||
const isActive = network.active || (Nmcli.active && Nmcli.active.ssid === network.ssid);
|
const isActive = network.active || (Nmcli.active && Nmcli.active.ssid === network.ssid);
|
||||||
if (isActive) {
|
if (isActive) {
|
||||||
if (!Nmcli.wirelessDeviceDetails || Nmcli.wirelessDeviceDetails === null) {
|
if (!Nmcli.wirelessDeviceDetails || Nmcli.wirelessDeviceDetails === null) {
|
||||||
Nmcli.getWirelessDeviceDetails("", () => {
|
Nmcli.getWirelessDeviceDetails("", () => {});
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
connectionUpdateTimer.stop();
|
connectionUpdateTimer.stop();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ DeviceList {
|
||||||
title: qsTr("Networks (%1)").arg(Nmcli.networks.length)
|
title: qsTr("Networks (%1)").arg(Nmcli.networks.length)
|
||||||
description: qsTr("All available WiFi networks")
|
description: qsTr("All available WiFi networks")
|
||||||
activeItem: session.network.active
|
activeItem: session.network.active
|
||||||
|
|
||||||
titleSuffix: Component {
|
titleSuffix: Component {
|
||||||
StyledText {
|
StyledText {
|
||||||
visible: Nmcli.scanning
|
visible: Nmcli.scanning
|
||||||
|
|
@ -165,11 +165,13 @@ DeviceList {
|
||||||
StyledText {
|
StyledText {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
text: {
|
text: {
|
||||||
if (modelData.active) return qsTr("Connected");
|
if (modelData.active)
|
||||||
|
return qsTr("Connected");
|
||||||
if (modelData.isSecure && modelData.security && modelData.security.length > 0) {
|
if (modelData.isSecure && modelData.security && modelData.security.length > 0) {
|
||||||
return modelData.security;
|
return modelData.security;
|
||||||
}
|
}
|
||||||
if (modelData.isSecure) return qsTr("Secured");
|
if (modelData.isSecure)
|
||||||
|
return qsTr("Secured");
|
||||||
return qsTr("Open");
|
return qsTr("Open");
|
||||||
}
|
}
|
||||||
color: modelData.active ? Colours.palette.m3primary : Colours.palette.m3outline
|
color: modelData.active ? Colours.palette.m3primary : Colours.palette.m3outline
|
||||||
|
|
@ -211,7 +213,7 @@ DeviceList {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onItemSelected: function(item) {
|
onItemSelected: function (item) {
|
||||||
session.network.active = item;
|
session.network.active = item;
|
||||||
if (item && item.ssid) {
|
if (item && item.ssid) {
|
||||||
checkSavedProfileForNetwork(item.ssid);
|
checkSavedProfileForNetwork(item.ssid);
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ SplitPaneWithDetails {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
activeItem: session.network.active
|
activeItem: session.network.active
|
||||||
paneIdGenerator: function(item) {
|
paneIdGenerator: function (item) {
|
||||||
return item ? (item.ssid || item.bssid || "") : "";
|
return item ? (item.ssid || item.bssid || "") : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -384,8 +384,7 @@ Item {
|
||||||
text = qsTr("Connecting...");
|
text = qsTr("Connecting...");
|
||||||
|
|
||||||
NetworkConnection.connectWithPassword(root.network, password, result => {
|
NetworkConnection.connectWithPassword(root.network, password, result => {
|
||||||
if (result && result.success) {
|
if (result && result.success) {} else if (result && result.needsPassword) {
|
||||||
} else if (result && result.needsPassword) {
|
|
||||||
connectionMonitor.stop();
|
connectionMonitor.stop();
|
||||||
connecting = false;
|
connecting = false;
|
||||||
hasError = true;
|
hasError = true;
|
||||||
|
|
|
||||||
|
|
@ -70,4 +70,4 @@ ColumnLayout {
|
||||||
value: Nmcli.active ? qsTr("%1 MHz").arg(Nmcli.active.frequency) : qsTr("N/A")
|
value: Nmcli.active ? qsTr("%1 MHz").arg(Nmcli.active.frequency) : qsTr("N/A")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,4 +10,3 @@ QtObject {
|
||||||
property bool fabMenuOpen: false
|
property bool fabMenuOpen: false
|
||||||
property bool editingDeviceName: false
|
property bool editingDeviceName: false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,4 +5,3 @@ QtObject {
|
||||||
|
|
||||||
property var active: null
|
property var active: null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,4 +5,3 @@ QtObject {
|
||||||
|
|
||||||
property var active: null
|
property var active: null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,4 +7,3 @@ QtObject {
|
||||||
property bool showPasswordDialog: false
|
property bool showPasswordDialog: false
|
||||||
property var pendingNetwork: null
|
property var pendingNetwork: null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,9 +53,9 @@ StyledRect {
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
text: modelData.label
|
text: modelData.label
|
||||||
|
|
||||||
property bool _checked: false
|
property bool _checked: false
|
||||||
|
|
||||||
checked: _checked
|
checked: _checked
|
||||||
toggle: false
|
toggle: false
|
||||||
type: TextButton.Tonal
|
type: TextButton.Tonal
|
||||||
|
|
@ -65,7 +65,7 @@ StyledRect {
|
||||||
if (root.rootItem && modelData.propertyName) {
|
if (root.rootItem && modelData.propertyName) {
|
||||||
const propName = modelData.propertyName;
|
const propName = modelData.propertyName;
|
||||||
const rootItem = root.rootItem;
|
const rootItem = root.rootItem;
|
||||||
_checked = Qt.binding(function() {
|
_checked = Qt.binding(function () {
|
||||||
return rootItem[propName] ?? false;
|
return rootItem[propName] ?? false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -77,7 +77,7 @@ StyledRect {
|
||||||
|
|
||||||
// Match utilities Toggles inactive color
|
// Match utilities Toggles inactive color
|
||||||
inactiveColour: Colours.layer(Colours.palette.m3surfaceContainerHighest, 2)
|
inactiveColour: Colours.layer(Colours.palette.m3surfaceContainerHighest, 2)
|
||||||
|
|
||||||
// Adjust width similar to utilities toggles
|
// Adjust width similar to utilities toggles
|
||||||
Layout.preferredWidth: implicitWidth + (stateLayer.pressed ? Appearance.padding.large : internalChecked ? Appearance.padding.smaller : 0)
|
Layout.preferredWidth: implicitWidth + (stateLayer.pressed ? Appearance.padding.large : internalChecked ? Appearance.padding.smaller : 0)
|
||||||
|
|
||||||
|
|
@ -106,4 +106,3 @@ StyledRect {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -183,7 +183,7 @@ Item {
|
||||||
{
|
{
|
||||||
label: qsTr("Speakers"),
|
label: qsTr("Speakers"),
|
||||||
propertyName: "showAudio",
|
propertyName: "showAudio",
|
||||||
onToggled: function(checked) {
|
onToggled: function (checked) {
|
||||||
root.showAudio = checked;
|
root.showAudio = checked;
|
||||||
root.saveConfig();
|
root.saveConfig();
|
||||||
}
|
}
|
||||||
|
|
@ -191,7 +191,7 @@ Item {
|
||||||
{
|
{
|
||||||
label: qsTr("Microphone"),
|
label: qsTr("Microphone"),
|
||||||
propertyName: "showMicrophone",
|
propertyName: "showMicrophone",
|
||||||
onToggled: function(checked) {
|
onToggled: function (checked) {
|
||||||
root.showMicrophone = checked;
|
root.showMicrophone = checked;
|
||||||
root.saveConfig();
|
root.saveConfig();
|
||||||
}
|
}
|
||||||
|
|
@ -199,7 +199,7 @@ Item {
|
||||||
{
|
{
|
||||||
label: qsTr("Keyboard"),
|
label: qsTr("Keyboard"),
|
||||||
propertyName: "showKbLayout",
|
propertyName: "showKbLayout",
|
||||||
onToggled: function(checked) {
|
onToggled: function (checked) {
|
||||||
root.showKbLayout = checked;
|
root.showKbLayout = checked;
|
||||||
root.saveConfig();
|
root.saveConfig();
|
||||||
}
|
}
|
||||||
|
|
@ -207,7 +207,7 @@ Item {
|
||||||
{
|
{
|
||||||
label: qsTr("Network"),
|
label: qsTr("Network"),
|
||||||
propertyName: "showNetwork",
|
propertyName: "showNetwork",
|
||||||
onToggled: function(checked) {
|
onToggled: function (checked) {
|
||||||
root.showNetwork = checked;
|
root.showNetwork = checked;
|
||||||
root.saveConfig();
|
root.saveConfig();
|
||||||
}
|
}
|
||||||
|
|
@ -215,7 +215,7 @@ Item {
|
||||||
{
|
{
|
||||||
label: qsTr("Wifi"),
|
label: qsTr("Wifi"),
|
||||||
propertyName: "showWifi",
|
propertyName: "showWifi",
|
||||||
onToggled: function(checked) {
|
onToggled: function (checked) {
|
||||||
root.showWifi = checked;
|
root.showWifi = checked;
|
||||||
root.saveConfig();
|
root.saveConfig();
|
||||||
}
|
}
|
||||||
|
|
@ -223,7 +223,7 @@ Item {
|
||||||
{
|
{
|
||||||
label: qsTr("Bluetooth"),
|
label: qsTr("Bluetooth"),
|
||||||
propertyName: "showBluetooth",
|
propertyName: "showBluetooth",
|
||||||
onToggled: function(checked) {
|
onToggled: function (checked) {
|
||||||
root.showBluetooth = checked;
|
root.showBluetooth = checked;
|
||||||
root.saveConfig();
|
root.saveConfig();
|
||||||
}
|
}
|
||||||
|
|
@ -231,7 +231,7 @@ Item {
|
||||||
{
|
{
|
||||||
label: qsTr("Battery"),
|
label: qsTr("Battery"),
|
||||||
propertyName: "showBattery",
|
propertyName: "showBattery",
|
||||||
onToggled: function(checked) {
|
onToggled: function (checked) {
|
||||||
root.showBattery = checked;
|
root.showBattery = checked;
|
||||||
root.saveConfig();
|
root.saveConfig();
|
||||||
}
|
}
|
||||||
|
|
@ -239,7 +239,7 @@ Item {
|
||||||
{
|
{
|
||||||
label: qsTr("Capslock"),
|
label: qsTr("Capslock"),
|
||||||
propertyName: "showLockStatus",
|
propertyName: "showLockStatus",
|
||||||
onToggled: function(checked) {
|
onToggled: function (checked) {
|
||||||
root.showLockStatus = checked;
|
root.showLockStatus = checked;
|
||||||
root.saveConfig();
|
root.saveConfig();
|
||||||
}
|
}
|
||||||
|
|
@ -268,173 +268,173 @@ Item {
|
||||||
font.pointSize: Appearance.font.size.normal
|
font.pointSize: Appearance.font.size.normal
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledRect {
|
StyledRect {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
implicitHeight: workspacesShownRow.implicitHeight + Appearance.padding.large * 2
|
implicitHeight: workspacesShownRow.implicitHeight + Appearance.padding.large * 2
|
||||||
radius: Appearance.rounding.normal
|
radius: Appearance.rounding.normal
|
||||||
color: Colours.layer(Colours.palette.m3surfaceContainer, 2)
|
color: Colours.layer(Colours.palette.m3surfaceContainer, 2)
|
||||||
|
|
||||||
Behavior on implicitHeight {
|
Behavior on implicitHeight {
|
||||||
Anim {}
|
Anim {}
|
||||||
}
|
|
||||||
|
|
||||||
RowLayout {
|
|
||||||
id: workspacesShownRow
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
anchors.margins: Appearance.padding.large
|
|
||||||
spacing: Appearance.spacing.normal
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
text: qsTr("Shown")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomSpinBox {
|
RowLayout {
|
||||||
min: 1
|
id: workspacesShownRow
|
||||||
max: 20
|
anchors.left: parent.left
|
||||||
value: root.workspacesShown
|
anchors.right: parent.right
|
||||||
onValueModified: value => {
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
root.workspacesShown = value;
|
anchors.margins: Appearance.padding.large
|
||||||
root.saveConfig();
|
spacing: Appearance.spacing.normal
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
text: qsTr("Shown")
|
||||||
|
}
|
||||||
|
|
||||||
|
CustomSpinBox {
|
||||||
|
min: 1
|
||||||
|
max: 20
|
||||||
|
value: root.workspacesShown
|
||||||
|
onValueModified: value => {
|
||||||
|
root.workspacesShown = value;
|
||||||
|
root.saveConfig();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
StyledRect {
|
StyledRect {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
implicitHeight: workspacesActiveIndicatorRow.implicitHeight + Appearance.padding.large * 2
|
implicitHeight: workspacesActiveIndicatorRow.implicitHeight + Appearance.padding.large * 2
|
||||||
radius: Appearance.rounding.normal
|
radius: Appearance.rounding.normal
|
||||||
color: Colours.layer(Colours.palette.m3surfaceContainer, 2)
|
color: Colours.layer(Colours.palette.m3surfaceContainer, 2)
|
||||||
|
|
||||||
Behavior on implicitHeight {
|
Behavior on implicitHeight {
|
||||||
Anim {}
|
Anim {}
|
||||||
}
|
|
||||||
|
|
||||||
RowLayout {
|
|
||||||
id: workspacesActiveIndicatorRow
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
anchors.margins: Appearance.padding.large
|
|
||||||
spacing: Appearance.spacing.normal
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
text: qsTr("Active indicator")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledSwitch {
|
RowLayout {
|
||||||
checked: root.workspacesActiveIndicator
|
id: workspacesActiveIndicatorRow
|
||||||
onToggled: {
|
anchors.left: parent.left
|
||||||
root.workspacesActiveIndicator = checked;
|
anchors.right: parent.right
|
||||||
root.saveConfig();
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
anchors.margins: Appearance.padding.large
|
||||||
|
spacing: Appearance.spacing.normal
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
text: qsTr("Active indicator")
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledSwitch {
|
||||||
|
checked: root.workspacesActiveIndicator
|
||||||
|
onToggled: {
|
||||||
|
root.workspacesActiveIndicator = checked;
|
||||||
|
root.saveConfig();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
StyledRect {
|
StyledRect {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
implicitHeight: workspacesOccupiedBgRow.implicitHeight + Appearance.padding.large * 2
|
implicitHeight: workspacesOccupiedBgRow.implicitHeight + Appearance.padding.large * 2
|
||||||
radius: Appearance.rounding.normal
|
radius: Appearance.rounding.normal
|
||||||
color: Colours.layer(Colours.palette.m3surfaceContainer, 2)
|
color: Colours.layer(Colours.palette.m3surfaceContainer, 2)
|
||||||
|
|
||||||
Behavior on implicitHeight {
|
Behavior on implicitHeight {
|
||||||
Anim {}
|
Anim {}
|
||||||
}
|
|
||||||
|
|
||||||
RowLayout {
|
|
||||||
id: workspacesOccupiedBgRow
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
anchors.margins: Appearance.padding.large
|
|
||||||
spacing: Appearance.spacing.normal
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
text: qsTr("Occupied background")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledSwitch {
|
RowLayout {
|
||||||
checked: root.workspacesOccupiedBg
|
id: workspacesOccupiedBgRow
|
||||||
onToggled: {
|
anchors.left: parent.left
|
||||||
root.workspacesOccupiedBg = checked;
|
anchors.right: parent.right
|
||||||
root.saveConfig();
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
anchors.margins: Appearance.padding.large
|
||||||
|
spacing: Appearance.spacing.normal
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
text: qsTr("Occupied background")
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledSwitch {
|
||||||
|
checked: root.workspacesOccupiedBg
|
||||||
|
onToggled: {
|
||||||
|
root.workspacesOccupiedBg = checked;
|
||||||
|
root.saveConfig();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
StyledRect {
|
StyledRect {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
implicitHeight: workspacesShowWindowsRow.implicitHeight + Appearance.padding.large * 2
|
implicitHeight: workspacesShowWindowsRow.implicitHeight + Appearance.padding.large * 2
|
||||||
radius: Appearance.rounding.normal
|
radius: Appearance.rounding.normal
|
||||||
color: Colours.layer(Colours.palette.m3surfaceContainer, 2)
|
color: Colours.layer(Colours.palette.m3surfaceContainer, 2)
|
||||||
|
|
||||||
Behavior on implicitHeight {
|
Behavior on implicitHeight {
|
||||||
Anim {}
|
Anim {}
|
||||||
}
|
|
||||||
|
|
||||||
RowLayout {
|
|
||||||
id: workspacesShowWindowsRow
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
anchors.margins: Appearance.padding.large
|
|
||||||
spacing: Appearance.spacing.normal
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
text: qsTr("Show windows")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledSwitch {
|
RowLayout {
|
||||||
checked: root.workspacesShowWindows
|
id: workspacesShowWindowsRow
|
||||||
onToggled: {
|
anchors.left: parent.left
|
||||||
root.workspacesShowWindows = checked;
|
anchors.right: parent.right
|
||||||
root.saveConfig();
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
anchors.margins: Appearance.padding.large
|
||||||
|
spacing: Appearance.spacing.normal
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
text: qsTr("Show windows")
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledSwitch {
|
||||||
|
checked: root.workspacesShowWindows
|
||||||
|
onToggled: {
|
||||||
|
root.workspacesShowWindows = checked;
|
||||||
|
root.saveConfig();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
StyledRect {
|
StyledRect {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
implicitHeight: workspacesPerMonitorRow.implicitHeight + Appearance.padding.large * 2
|
implicitHeight: workspacesPerMonitorRow.implicitHeight + Appearance.padding.large * 2
|
||||||
radius: Appearance.rounding.normal
|
radius: Appearance.rounding.normal
|
||||||
color: Colours.layer(Colours.palette.m3surfaceContainer, 2)
|
color: Colours.layer(Colours.palette.m3surfaceContainer, 2)
|
||||||
|
|
||||||
Behavior on implicitHeight {
|
Behavior on implicitHeight {
|
||||||
Anim {}
|
Anim {}
|
||||||
}
|
|
||||||
|
|
||||||
RowLayout {
|
|
||||||
id: workspacesPerMonitorRow
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
anchors.margins: Appearance.padding.large
|
|
||||||
spacing: Appearance.spacing.normal
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
text: qsTr("Per monitor workspaces")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledSwitch {
|
RowLayout {
|
||||||
checked: root.workspacesPerMonitor
|
id: workspacesPerMonitorRow
|
||||||
onToggled: {
|
anchors.left: parent.left
|
||||||
root.workspacesPerMonitor = checked;
|
anchors.right: parent.right
|
||||||
root.saveConfig();
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
anchors.margins: Appearance.padding.large
|
||||||
|
spacing: Appearance.spacing.normal
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
text: qsTr("Per monitor workspaces")
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledSwitch {
|
||||||
|
checked: root.workspacesPerMonitor
|
||||||
|
onToggled: {
|
||||||
|
root.workspacesPerMonitor = checked;
|
||||||
|
root.saveConfig();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
SectionContainer {
|
SectionContainer {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
@ -452,7 +452,7 @@ Item {
|
||||||
{
|
{
|
||||||
label: qsTr("Workspaces"),
|
label: qsTr("Workspaces"),
|
||||||
propertyName: "scrollWorkspaces",
|
propertyName: "scrollWorkspaces",
|
||||||
onToggled: function(checked) {
|
onToggled: function (checked) {
|
||||||
root.scrollWorkspaces = checked;
|
root.scrollWorkspaces = checked;
|
||||||
root.saveConfig();
|
root.saveConfig();
|
||||||
}
|
}
|
||||||
|
|
@ -460,7 +460,7 @@ Item {
|
||||||
{
|
{
|
||||||
label: qsTr("Volume"),
|
label: qsTr("Volume"),
|
||||||
propertyName: "scrollVolume",
|
propertyName: "scrollVolume",
|
||||||
onToggled: function(checked) {
|
onToggled: function (checked) {
|
||||||
root.scrollVolume = checked;
|
root.scrollVolume = checked;
|
||||||
root.saveConfig();
|
root.saveConfig();
|
||||||
}
|
}
|
||||||
|
|
@ -468,7 +468,7 @@ Item {
|
||||||
{
|
{
|
||||||
label: qsTr("Brightness"),
|
label: qsTr("Brightness"),
|
||||||
propertyName: "scrollBrightness",
|
propertyName: "scrollBrightness",
|
||||||
onToggled: function(checked) {
|
onToggled: function (checked) {
|
||||||
root.scrollBrightness = checked;
|
root.scrollBrightness = checked;
|
||||||
root.saveConfig();
|
root.saveConfig();
|
||||||
}
|
}
|
||||||
|
|
@ -541,11 +541,14 @@ Item {
|
||||||
from: 0
|
from: 0
|
||||||
to: 100
|
to: 100
|
||||||
suffix: "px"
|
suffix: "px"
|
||||||
validator: IntValidator { bottom: 0; top: 100 }
|
validator: IntValidator {
|
||||||
formatValueFunction: (val) => Math.round(val).toString()
|
bottom: 0
|
||||||
parseValueFunction: (text) => parseInt(text)
|
top: 100
|
||||||
|
}
|
||||||
|
formatValueFunction: val => Math.round(val).toString()
|
||||||
|
parseValueFunction: text => parseInt(text)
|
||||||
|
|
||||||
onValueModified: (newValue) => {
|
onValueModified: newValue => {
|
||||||
root.dragThreshold = Math.round(newValue);
|
root.dragThreshold = Math.round(newValue);
|
||||||
root.saveConfig();
|
root.saveConfig();
|
||||||
}
|
}
|
||||||
|
|
@ -613,7 +616,7 @@ Item {
|
||||||
{
|
{
|
||||||
label: qsTr("Background"),
|
label: qsTr("Background"),
|
||||||
propertyName: "trayBackground",
|
propertyName: "trayBackground",
|
||||||
onToggled: function(checked) {
|
onToggled: function (checked) {
|
||||||
root.trayBackground = checked;
|
root.trayBackground = checked;
|
||||||
root.saveConfig();
|
root.saveConfig();
|
||||||
}
|
}
|
||||||
|
|
@ -621,7 +624,7 @@ Item {
|
||||||
{
|
{
|
||||||
label: qsTr("Compact"),
|
label: qsTr("Compact"),
|
||||||
propertyName: "trayCompact",
|
propertyName: "trayCompact",
|
||||||
onToggled: function(checked) {
|
onToggled: function (checked) {
|
||||||
root.trayCompact = checked;
|
root.trayCompact = checked;
|
||||||
root.saveConfig();
|
root.saveConfig();
|
||||||
}
|
}
|
||||||
|
|
@ -629,7 +632,7 @@ Item {
|
||||||
{
|
{
|
||||||
label: qsTr("Recolour"),
|
label: qsTr("Recolour"),
|
||||||
propertyName: "trayRecolour",
|
propertyName: "trayRecolour",
|
||||||
onToggled: function(checked) {
|
onToggled: function (checked) {
|
||||||
root.trayRecolour = checked;
|
root.trayRecolour = checked;
|
||||||
root.saveConfig();
|
root.saveConfig();
|
||||||
}
|
}
|
||||||
|
|
@ -639,7 +642,6 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,8 @@ Item {
|
||||||
|
|
||||||
Component.onCompleted: active = Qt.binding(() => {
|
Component.onCompleted: active = Qt.binding(() => {
|
||||||
// Always keep current tab loaded
|
// Always keep current tab loaded
|
||||||
if (pane.index === view.currentIndex) return true;
|
if (pane.index === view.currentIndex)
|
||||||
|
return true;
|
||||||
const vx = Math.floor(view.visibleArea.xPosition * view.contentWidth);
|
const vx = Math.floor(view.visibleArea.xPosition * view.contentWidth);
|
||||||
const vex = Math.floor(vx + view.visibleArea.widthRatio * view.contentWidth);
|
const vex = Math.floor(vx + view.visibleArea.widthRatio * view.contentWidth);
|
||||||
return (vx >= x && vx <= x + implicitWidth) || (vex >= x && vex <= x + implicitWidth);
|
return (vx >= x && vx <= x + implicitWidth) || (vex >= x && vex <= x + implicitWidth);
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,6 @@ StyledRect {
|
||||||
visible: Config.utilities.vpn.provider.some(p => typeof p === "object" ? (p.enabled === true) : false)
|
visible: Config.utilities.vpn.provider.some(p => typeof p === "object" ? (p.enabled === true) : false)
|
||||||
onClicked: VPN.toggle()
|
onClicked: VPN.toggle()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,8 @@ Singleton {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getStreamName(stream: PwNode): string {
|
function getStreamName(stream: PwNode): string {
|
||||||
if (!stream) return qsTr("Unknown");
|
if (!stream)
|
||||||
|
return qsTr("Unknown");
|
||||||
// Try application name first, then description, then name
|
// Try application name first, then description, then name
|
||||||
return stream.applicationName || stream.description || stream.name || qsTr("Unknown Application");
|
return stream.applicationName || stream.description || stream.name || qsTr("Unknown Application");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ Singleton {
|
||||||
root.savedConnectionSsids = Nmcli.savedConnectionSsids;
|
root.savedConnectionSsids = Nmcli.savedConnectionSsids;
|
||||||
});
|
});
|
||||||
// Get initial WiFi status
|
// Get initial WiFi status
|
||||||
Nmcli.getWifiStatus((enabled) => {
|
Nmcli.getWifiStatus(enabled => {
|
||||||
root.wifiEnabled = enabled;
|
root.wifiEnabled = enabled;
|
||||||
});
|
});
|
||||||
// Sync networks from Nmcli on startup
|
// Sync networks from Nmcli on startup
|
||||||
|
|
@ -41,7 +41,7 @@ Singleton {
|
||||||
property var wirelessDeviceDetails: null
|
property var wirelessDeviceDetails: null
|
||||||
|
|
||||||
function enableWifi(enabled: bool): void {
|
function enableWifi(enabled: bool): void {
|
||||||
Nmcli.enableWifi(enabled, (result) => {
|
Nmcli.enableWifi(enabled, result => {
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
root.getWifiStatus();
|
root.getWifiStatus();
|
||||||
Nmcli.getNetworks(() => {
|
Nmcli.getNetworks(() => {
|
||||||
|
|
@ -52,7 +52,7 @@ Singleton {
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleWifi(): void {
|
function toggleWifi(): void {
|
||||||
Nmcli.toggleWifi((result) => {
|
Nmcli.toggleWifi(result => {
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
root.getWifiStatus();
|
root.getWifiStatus();
|
||||||
Nmcli.getNetworks(() => {
|
Nmcli.getNetworks(() => {
|
||||||
|
|
@ -73,23 +73,30 @@ Singleton {
|
||||||
// Set up pending connection tracking if callback provided
|
// Set up pending connection tracking if callback provided
|
||||||
if (callback) {
|
if (callback) {
|
||||||
const hasBssid = bssid !== undefined && bssid !== null && bssid.length > 0;
|
const hasBssid = bssid !== undefined && bssid !== null && bssid.length > 0;
|
||||||
root.pendingConnection = { ssid: ssid, bssid: hasBssid ? bssid : "", callback: callback };
|
root.pendingConnection = {
|
||||||
|
ssid: ssid,
|
||||||
|
bssid: hasBssid ? bssid : "",
|
||||||
|
callback: callback
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
Nmcli.connectToNetwork(ssid, password, bssid, (result) => {
|
Nmcli.connectToNetwork(ssid, password, bssid, result => {
|
||||||
if (result && result.success) {
|
if (result && result.success) {
|
||||||
// Connection successful
|
// Connection successful
|
||||||
if (callback) callback(result);
|
if (callback)
|
||||||
|
callback(result);
|
||||||
root.pendingConnection = null;
|
root.pendingConnection = null;
|
||||||
} else if (result && result.needsPassword) {
|
} else if (result && result.needsPassword) {
|
||||||
// Password needed - callback will handle showing dialog
|
// Password needed - callback will handle showing dialog
|
||||||
if (callback) callback(result);
|
if (callback)
|
||||||
|
callback(result);
|
||||||
} else {
|
} else {
|
||||||
// Connection failed
|
// Connection failed
|
||||||
if (result && result.error) {
|
if (result && result.error) {
|
||||||
root.connectionFailed(ssid);
|
root.connectionFailed(ssid);
|
||||||
}
|
}
|
||||||
if (callback) callback(result);
|
if (callback)
|
||||||
|
callback(result);
|
||||||
root.pendingConnection = null;
|
root.pendingConnection = null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -98,22 +105,29 @@ Singleton {
|
||||||
function connectToNetworkWithPasswordCheck(ssid: string, isSecure: bool, callback: var, bssid: string): void {
|
function connectToNetworkWithPasswordCheck(ssid: string, isSecure: bool, callback: var, bssid: string): void {
|
||||||
// Set up pending connection tracking
|
// Set up pending connection tracking
|
||||||
const hasBssid = bssid !== undefined && bssid !== null && bssid.length > 0;
|
const hasBssid = bssid !== undefined && bssid !== null && bssid.length > 0;
|
||||||
root.pendingConnection = { ssid: ssid, bssid: hasBssid ? bssid : "", callback: callback };
|
root.pendingConnection = {
|
||||||
|
ssid: ssid,
|
||||||
Nmcli.connectToNetworkWithPasswordCheck(ssid, isSecure, (result) => {
|
bssid: hasBssid ? bssid : "",
|
||||||
|
callback: callback
|
||||||
|
};
|
||||||
|
|
||||||
|
Nmcli.connectToNetworkWithPasswordCheck(ssid, isSecure, result => {
|
||||||
if (result && result.success) {
|
if (result && result.success) {
|
||||||
// Connection successful
|
// Connection successful
|
||||||
if (callback) callback(result);
|
if (callback)
|
||||||
|
callback(result);
|
||||||
root.pendingConnection = null;
|
root.pendingConnection = null;
|
||||||
} else if (result && result.needsPassword) {
|
} else if (result && result.needsPassword) {
|
||||||
// Password needed - callback will handle showing dialog
|
// Password needed - callback will handle showing dialog
|
||||||
if (callback) callback(result);
|
if (callback)
|
||||||
|
callback(result);
|
||||||
} else {
|
} else {
|
||||||
// Connection failed
|
// Connection failed
|
||||||
if (result && result.error) {
|
if (result && result.error) {
|
||||||
root.connectionFailed(ssid);
|
root.connectionFailed(ssid);
|
||||||
}
|
}
|
||||||
if (callback) callback(result);
|
if (callback)
|
||||||
|
callback(result);
|
||||||
root.pendingConnection = null;
|
root.pendingConnection = null;
|
||||||
}
|
}
|
||||||
}, bssid);
|
}, bssid);
|
||||||
|
|
@ -133,7 +147,7 @@ Singleton {
|
||||||
function forgetNetwork(ssid: string): void {
|
function forgetNetwork(ssid: string): void {
|
||||||
// Delete the connection profile for this network
|
// Delete the connection profile for this network
|
||||||
// This will remove the saved password and connection settings
|
// This will remove the saved password and connection settings
|
||||||
Nmcli.forgetNetwork(ssid, (result) => {
|
Nmcli.forgetNetwork(ssid, result => {
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
// Refresh network list after deletion
|
// Refresh network list after deletion
|
||||||
Qt.callLater(() => {
|
Qt.callLater(() => {
|
||||||
|
|
@ -145,7 +159,6 @@ Singleton {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
property list<string> savedConnections: []
|
property list<string> savedConnections: []
|
||||||
property list<string> savedConnectionSsids: []
|
property list<string> savedConnectionSsids: []
|
||||||
|
|
||||||
|
|
@ -163,21 +176,21 @@ Singleton {
|
||||||
function syncNetworksFromNmcli(): void {
|
function syncNetworksFromNmcli(): void {
|
||||||
const rNetworks = root.networks;
|
const rNetworks = root.networks;
|
||||||
const nNetworks = Nmcli.networks;
|
const nNetworks = Nmcli.networks;
|
||||||
|
|
||||||
// Build a map of existing networks by key
|
// Build a map of existing networks by key
|
||||||
const existingMap = new Map();
|
const existingMap = new Map();
|
||||||
for (const rn of rNetworks) {
|
for (const rn of rNetworks) {
|
||||||
const key = `${rn.frequency}:${rn.ssid}:${rn.bssid}`;
|
const key = `${rn.frequency}:${rn.ssid}:${rn.bssid}`;
|
||||||
existingMap.set(key, rn);
|
existingMap.set(key, rn);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build a map of new networks by key
|
// Build a map of new networks by key
|
||||||
const newMap = new Map();
|
const newMap = new Map();
|
||||||
for (const nn of nNetworks) {
|
for (const nn of nNetworks) {
|
||||||
const key = `${nn.frequency}:${nn.ssid}:${nn.bssid}`;
|
const key = `${nn.frequency}:${nn.ssid}:${nn.bssid}`;
|
||||||
newMap.set(key, nn);
|
newMap.set(key, nn);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove networks that no longer exist
|
// Remove networks that no longer exist
|
||||||
for (const [key, network] of existingMap) {
|
for (const [key, network] of existingMap) {
|
||||||
if (!newMap.has(key)) {
|
if (!newMap.has(key)) {
|
||||||
|
|
@ -188,7 +201,7 @@ Singleton {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add or update networks from Nmcli
|
// Add or update networks from Nmcli
|
||||||
for (const [key, nNetwork] of newMap) {
|
for (const [key, nNetwork] of newMap) {
|
||||||
const existing = existingMap.get(key);
|
const existing = existingMap.get(key);
|
||||||
|
|
@ -226,28 +239,29 @@ Singleton {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getWifiStatus(): void {
|
function getWifiStatus(): void {
|
||||||
Nmcli.getWifiStatus((enabled) => {
|
Nmcli.getWifiStatus(enabled => {
|
||||||
root.wifiEnabled = enabled;
|
root.wifiEnabled = enabled;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function getEthernetDevices(): void {
|
function getEthernetDevices(): void {
|
||||||
root.ethernetProcessRunning = true;
|
root.ethernetProcessRunning = true;
|
||||||
Nmcli.getEthernetInterfaces((interfaces) => {
|
Nmcli.getEthernetInterfaces(interfaces => {
|
||||||
root.ethernetDevices = Nmcli.ethernetDevices;
|
root.ethernetDevices = Nmcli.ethernetDevices;
|
||||||
root.ethernetDeviceCount = Nmcli.ethernetDevices.length;
|
root.ethernetDeviceCount = Nmcli.ethernetDevices.length;
|
||||||
root.ethernetProcessRunning = false;
|
root.ethernetProcessRunning = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function connectEthernet(connectionName: string, interfaceName: string): void {
|
function connectEthernet(connectionName: string, interfaceName: string): void {
|
||||||
Nmcli.connectEthernet(connectionName, interfaceName, (result) => {
|
Nmcli.connectEthernet(connectionName, interfaceName, result => {
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
getEthernetDevices();
|
getEthernetDevices();
|
||||||
// Refresh device details after connection
|
// Refresh device details after connection
|
||||||
Qt.callLater(() => {
|
Qt.callLater(() => {
|
||||||
const activeDevice = root.ethernetDevices.find(function(d) { return d.connected; });
|
const activeDevice = root.ethernetDevices.find(function (d) {
|
||||||
|
return d.connected;
|
||||||
|
});
|
||||||
if (activeDevice && activeDevice.interface) {
|
if (activeDevice && activeDevice.interface) {
|
||||||
updateEthernetDeviceDetails(activeDevice.interface);
|
updateEthernetDeviceDetails(activeDevice.interface);
|
||||||
}
|
}
|
||||||
|
|
@ -257,7 +271,7 @@ Singleton {
|
||||||
}
|
}
|
||||||
|
|
||||||
function disconnectEthernet(connectionName: string): void {
|
function disconnectEthernet(connectionName: string): void {
|
||||||
Nmcli.disconnectEthernet(connectionName, (result) => {
|
Nmcli.disconnectEthernet(connectionName, result => {
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
getEthernetDevices();
|
getEthernetDevices();
|
||||||
// Clear device details after disconnection
|
// Clear device details after disconnection
|
||||||
|
|
@ -269,7 +283,7 @@ Singleton {
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateEthernetDeviceDetails(interfaceName: string): void {
|
function updateEthernetDeviceDetails(interfaceName: string): void {
|
||||||
Nmcli.getEthernetDeviceDetails(interfaceName, (details) => {
|
Nmcli.getEthernetDeviceDetails(interfaceName, details => {
|
||||||
root.ethernetDeviceDetails = details;
|
root.ethernetDeviceDetails = details;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -277,7 +291,7 @@ Singleton {
|
||||||
function updateWirelessDeviceDetails(): void {
|
function updateWirelessDeviceDetails(): void {
|
||||||
// Find the wireless interface by looking for wifi devices
|
// Find the wireless interface by looking for wifi devices
|
||||||
// Pass empty string to let Nmcli find the active interface automatically
|
// Pass empty string to let Nmcli find the active interface automatically
|
||||||
Nmcli.getWirelessDeviceDetails("", (details) => {
|
Nmcli.getWirelessDeviceDetails("", details => {
|
||||||
root.wirelessDeviceDetails = details;
|
root.wirelessDeviceDetails = details;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -290,12 +304,7 @@ Singleton {
|
||||||
}
|
}
|
||||||
|
|
||||||
const mask = (0xffffffff << (32 - cidrNum)) >>> 0;
|
const mask = (0xffffffff << (32 - cidrNum)) >>> 0;
|
||||||
const octets = [
|
const octets = [(mask >>> 24) & 0xff, (mask >>> 16) & 0xff, (mask >>> 8) & 0xff, mask & 0xff];
|
||||||
(mask >>> 24) & 0xff,
|
|
||||||
(mask >>> 16) & 0xff,
|
|
||||||
(mask >>> 8) & 0xff,
|
|
||||||
mask & 0xff
|
|
||||||
];
|
|
||||||
|
|
||||||
return octets.join(".");
|
return octets.join(".");
|
||||||
}
|
}
|
||||||
|
|
@ -312,5 +321,4 @@ Singleton {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -129,9 +129,9 @@ Singleton {
|
||||||
|
|
||||||
command: ["ip", "link", "show"]
|
command: ["ip", "link", "show"]
|
||||||
environment: ({
|
environment: ({
|
||||||
LANG: "C.UTF-8",
|
LANG: "C.UTF-8",
|
||||||
LC_ALL: "C.UTF-8"
|
LC_ALL: "C.UTF-8"
|
||||||
})
|
})
|
||||||
stdout: StdioCollector {
|
stdout: StdioCollector {
|
||||||
onStreamFinished: {
|
onStreamFinished: {
|
||||||
const iface = root.currentConfig ? root.currentConfig.interface : "";
|
const iface = root.currentConfig ? root.currentConfig.interface : "";
|
||||||
|
|
|
||||||
|
|
@ -5,18 +5,18 @@ import QtQuick
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NetworkConnection
|
* NetworkConnection
|
||||||
*
|
*
|
||||||
* Centralized utility for network connection logic. Provides a single source of truth
|
* Centralized utility for network connection logic. Provides a single source of truth
|
||||||
* for connecting to wireless networks, eliminating code duplication across
|
* for connecting to wireless networks, eliminating code duplication across
|
||||||
* controlcenter components and bar popouts.
|
* controlcenter components and bar popouts.
|
||||||
*
|
*
|
||||||
* Usage:
|
* Usage:
|
||||||
* ```qml
|
* ```qml
|
||||||
* import qs.utils
|
* import qs.utils
|
||||||
*
|
*
|
||||||
* // With Session object (controlcenter)
|
* // With Session object (controlcenter)
|
||||||
* NetworkConnection.handleConnect(network, session);
|
* NetworkConnection.handleConnect(network, session);
|
||||||
*
|
*
|
||||||
* // Without Session object (bar popouts) - provide password dialog callback
|
* // Without Session object (bar popouts) - provide password dialog callback
|
||||||
* NetworkConnection.handleConnect(network, null, (network) => {
|
* NetworkConnection.handleConnect(network, null, (network) => {
|
||||||
* // Show password dialog
|
* // Show password dialog
|
||||||
|
|
@ -32,7 +32,7 @@ QtObject {
|
||||||
* Handle network connection with automatic disconnection if needed.
|
* Handle network connection with automatic disconnection if needed.
|
||||||
* If there's an active network different from the target, disconnects first,
|
* If there's an active network different from the target, disconnects first,
|
||||||
* then connects to the target network.
|
* then connects to the target network.
|
||||||
*
|
*
|
||||||
* @param network The network object to connect to (must have ssid property)
|
* @param network The network object to connect to (must have ssid property)
|
||||||
* @param session Optional Session object (for controlcenter - must have network property with showPasswordDialog and pendingNetwork)
|
* @param session Optional Session object (for controlcenter - must have network property with showPasswordDialog and pendingNetwork)
|
||||||
* @param onPasswordNeeded Optional callback function(network) called when password is needed (for bar popouts)
|
* @param onPasswordNeeded Optional callback function(network) called when password is needed (for bar popouts)
|
||||||
|
|
@ -56,7 +56,7 @@ QtObject {
|
||||||
* Connect to a wireless network.
|
* Connect to a wireless network.
|
||||||
* Handles both secured and open networks, checks for saved profiles,
|
* Handles both secured and open networks, checks for saved profiles,
|
||||||
* and shows password dialog if needed.
|
* and shows password dialog if needed.
|
||||||
*
|
*
|
||||||
* @param network The network object to connect to (must have ssid, isSecure, bssid properties)
|
* @param network The network object to connect to (must have ssid, isSecure, bssid properties)
|
||||||
* @param session Optional Session object (for controlcenter - must have network property with showPasswordDialog and pendingNetwork)
|
* @param session Optional Session object (for controlcenter - must have network property with showPasswordDialog and pendingNetwork)
|
||||||
* @param onPasswordNeeded Optional callback function(network) called when password is needed (for bar popouts)
|
* @param onPasswordNeeded Optional callback function(network) called when password is needed (for bar popouts)
|
||||||
|
|
@ -73,30 +73,25 @@ QtObject {
|
||||||
Nmcli.connectToNetwork(network.ssid, "", network.bssid, null);
|
Nmcli.connectToNetwork(network.ssid, "", network.bssid, null);
|
||||||
} else {
|
} else {
|
||||||
// Use password check with callback
|
// Use password check with callback
|
||||||
Nmcli.connectToNetworkWithPasswordCheck(
|
Nmcli.connectToNetworkWithPasswordCheck(network.ssid, network.isSecure, result => {
|
||||||
network.ssid,
|
if (result.needsPassword) {
|
||||||
network.isSecure,
|
// Clear pending connection if exists
|
||||||
(result) => {
|
if (Nmcli.pendingConnection) {
|
||||||
if (result.needsPassword) {
|
Nmcli.connectionCheckTimer.stop();
|
||||||
// Clear pending connection if exists
|
Nmcli.immediateCheckTimer.stop();
|
||||||
if (Nmcli.pendingConnection) {
|
Nmcli.immediateCheckTimer.checkCount = 0;
|
||||||
Nmcli.connectionCheckTimer.stop();
|
Nmcli.pendingConnection = null;
|
||||||
Nmcli.immediateCheckTimer.stop();
|
|
||||||
Nmcli.immediateCheckTimer.checkCount = 0;
|
|
||||||
Nmcli.pendingConnection = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handle password dialog - use session if available, otherwise use callback
|
|
||||||
if (session && session.network) {
|
|
||||||
session.network.showPasswordDialog = true;
|
|
||||||
session.network.pendingNetwork = network;
|
|
||||||
} else if (onPasswordNeeded) {
|
|
||||||
onPasswordNeeded(network);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
|
||||||
network.bssid
|
// Handle password dialog - use session if available, otherwise use callback
|
||||||
);
|
if (session && session.network) {
|
||||||
|
session.network.showPasswordDialog = true;
|
||||||
|
session.network.pendingNetwork = network;
|
||||||
|
} else if (onPasswordNeeded) {
|
||||||
|
onPasswordNeeded(network);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, network.bssid);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Nmcli.connectToNetwork(network.ssid, "", network.bssid, null);
|
Nmcli.connectToNetwork(network.ssid, "", network.bssid, null);
|
||||||
|
|
@ -106,7 +101,7 @@ QtObject {
|
||||||
/**
|
/**
|
||||||
* Connect to a wireless network with a provided password.
|
* Connect to a wireless network with a provided password.
|
||||||
* Used by password dialogs when the user has already entered a password.
|
* Used by password dialogs when the user has already entered a password.
|
||||||
*
|
*
|
||||||
* @param network The network object to connect to (must have ssid, bssid properties)
|
* @param network The network object to connect to (must have ssid, bssid properties)
|
||||||
* @param password The password to use for connection
|
* @param password The password to use for connection
|
||||||
* @param onResult Optional callback function(result) called with connection result
|
* @param onResult Optional callback function(result) called with connection result
|
||||||
|
|
@ -119,4 +114,3 @@ QtObject {
|
||||||
Nmcli.connectToNetwork(network.ssid, password || "", network.bssid || "", onResult || null);
|
Nmcli.connectToNetwork(network.ssid, password || "", network.bssid || "", onResult || null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue