1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-26 22:42:50 -05:00

network: listen to NM Wired interface + use nmcli for route metrics

- Some other misc floating window change, too lazy to separate the
  commit
This commit is contained in:
bbedward
2026-01-06 16:01:28 -05:00
parent c45eb2cccf
commit c1fbeb3f5e
16 changed files with 285 additions and 188 deletions

View File

@@ -213,7 +213,7 @@ FloatingWindow {
spacing: Theme.spacingXS
DankActionButton {
visible: windowControls.supported
visible: windowControls.supported && windowControls.canMaximize
iconName: root.maximized ? "fullscreen_exit" : "fullscreen"
iconSize: Theme.iconSize - 4
iconColor: Theme.surfaceText

View File

@@ -117,7 +117,7 @@ FloatingWindow {
onDoubleClicked: windowControls.tryToggleMaximize()
}
Row {
Item {
id: headerRow
anchors.left: parent.left
anchors.right: parent.right
@@ -125,9 +125,13 @@ FloatingWindow {
anchors.leftMargin: Theme.spacingM
anchors.rightMargin: Theme.spacingM
anchors.topMargin: Theme.spacingM
height: Math.max(titleColumn.height, buttonRow.height)
Column {
width: parent.width - 60
id: titleColumn
anchors.left: parent.left
anchors.right: buttonRow.left
anchors.rightMargin: Theme.spacingM
spacing: Theme.spacingXS
StyledText {
@@ -162,10 +166,12 @@ FloatingWindow {
}
Row {
id: buttonRow
anchors.right: parent.right
spacing: Theme.spacingXS
DankActionButton {
visible: windowControls.supported
visible: windowControls.supported && windowControls.canMaximize
iconName: root.maximized ? "fullscreen_exit" : "fullscreen"
iconSize: Theme.iconSize - 4
iconColor: Theme.surfaceText

View File

@@ -44,12 +44,18 @@ FloatingWindow {
property int calculatedHeight: {
let h = headerHeight + buttonRowHeight + Theme.spacingL * 2;
h += fieldsInfo.length * inputFieldWithSpacing;
if (showUsernameField) h += inputFieldWithSpacing;
if (showPasswordField) h += inputFieldWithSpacing;
if (showAnonField) h += inputFieldWithSpacing;
if (showDomainField) h += inputFieldWithSpacing;
if (showShowPasswordCheckbox) h += checkboxRowHeight;
if (showSavePasswordCheckbox) h += checkboxRowHeight;
if (showUsernameField)
h += inputFieldWithSpacing;
if (showPasswordField)
h += inputFieldWithSpacing;
if (showAnonField)
h += inputFieldWithSpacing;
if (showDomainField)
h += inputFieldWithSpacing;
if (showShowPasswordCheckbox)
h += checkboxRowHeight;
if (showSavePasswordCheckbox)
h += checkboxRowHeight;
return h;
}
@@ -267,11 +273,14 @@ FloatingWindow {
width: parent.width - Theme.spacingL * 2
spacing: Theme.spacingM
Row {
Item {
width: contentCol.width
height: Math.max(headerCol.height, buttonRow.height)
MouseArea {
width: parent.width - 60
anchors.left: parent.left
anchors.right: buttonRow.left
anchors.rightMargin: Theme.spacingM
height: headerCol.height
onPressed: windowControls.tryStartMove()
onDoubleClicked: windowControls.tryToggleMaximize()
@@ -327,10 +336,12 @@ FloatingWindow {
}
Row {
id: buttonRow
anchors.right: parent.right
spacing: Theme.spacingXS
DankActionButton {
visible: windowControls.supported
visible: windowControls.supported && windowControls.canMaximize
iconName: root.maximized ? "fullscreen_exit" : "fullscreen"
iconSize: Theme.iconSize - 4
iconColor: Theme.surfaceText

View File

@@ -399,14 +399,14 @@ Item {
text: "•"
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
visible: modelData.ip && modelData.ip.length > 0
visible: (modelData.ip || "").length > 0
}
StyledText {
text: modelData.ip || ""
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
visible: modelData.ip && modelData.ip.length > 0
visible: (modelData.ip || "").length > 0
}
}
}

View File

@@ -328,7 +328,6 @@ FloatingWindow {
anchors.top: browserSearchField.bottom
anchors.topMargin: Theme.spacingM
anchors.bottom: parent.bottom
anchors.bottomMargin: Theme.spacingM
Item {
anchors.fill: parent
@@ -366,10 +365,6 @@ FloatingWindow {
id: themeBrowserList
anchors.fill: parent
anchors.leftMargin: Theme.spacingM
anchors.rightMargin: Theme.spacingM
anchors.topMargin: Theme.spacingS
anchors.bottomMargin: Theme.spacingS
spacing: Theme.spacingS
model: ScriptModel {
values: root.filteredThemes

View File

@@ -323,7 +323,6 @@ Singleton {
}
}
userPreference = state.preference || "auto";
isConnecting = state.isConnecting || false;
connectingSSID = state.connectingSSID || "";
connectionError = state.lastError || "";

View File

@@ -6,6 +6,7 @@ Item {
readonly property real edgeSize: 8
required property var targetWindow
property bool supported: typeof targetWindow.startSystemMove === "function"
readonly property bool canMaximize: targetWindow.minimumSize.width !== targetWindow.maximumSize.width || targetWindow.minimumSize.height !== targetWindow.maximumSize.height
anchors.fill: parent
@@ -16,19 +17,19 @@ Item {
}
function tryStartResize(edges) {
if (!supported)
if (!supported || !canMaximize)
return;
targetWindow.startSystemResize(edges);
}
function tryToggleMaximize() {
if (!supported)
if (!supported || !canMaximize)
return;
targetWindow.maximized = !targetWindow.maximized;
}
MouseArea {
visible: root.supported
visible: root.supported && root.canMaximize
height: root.edgeSize
anchors.left: parent.left
anchors.right: parent.right
@@ -40,7 +41,7 @@ Item {
}
MouseArea {
visible: root.supported
visible: root.supported && root.canMaximize
width: root.edgeSize
anchors.left: parent.left
anchors.top: parent.top
@@ -52,7 +53,7 @@ Item {
}
MouseArea {
visible: root.supported
visible: root.supported && root.canMaximize
width: root.edgeSize
anchors.right: parent.right
anchors.top: parent.top
@@ -64,7 +65,7 @@ Item {
}
MouseArea {
visible: root.supported
visible: root.supported && root.canMaximize
width: root.edgeSize
height: root.edgeSize
anchors.left: parent.left
@@ -74,7 +75,7 @@ Item {
}
MouseArea {
visible: root.supported
visible: root.supported && root.canMaximize
width: root.edgeSize
height: root.edgeSize
anchors.right: parent.right
@@ -84,7 +85,7 @@ Item {
}
MouseArea {
visible: root.supported
visible: root.supported && root.canMaximize
height: root.edgeSize
anchors.left: parent.left
anchors.right: parent.right
@@ -96,7 +97,7 @@ Item {
}
MouseArea {
visible: root.supported
visible: root.supported && root.canMaximize
width: root.edgeSize
height: root.edgeSize
anchors.left: parent.left
@@ -106,7 +107,7 @@ Item {
}
MouseArea {
visible: root.supported
visible: root.supported && root.canMaximize
width: root.edgeSize
height: root.edgeSize
anchors.right: parent.right