chore: cleanup comments

This commit is contained in:
2026-06-30 22:27:37 +02:00
parent 2b89c8e4a1
commit 865b5bda53
5 changed files with 11 additions and 164 deletions
+7 -18
View File
@@ -9,8 +9,6 @@ import qs.Config
ColumnLayout {
id: root
// Enables a smooth scroll animation only for search jumps, so normal
// flicking stays instant.
property bool animateScroll: false
readonly property int cappedWidth: Math.min(800, width)
default property Item contentChild
@@ -31,7 +29,7 @@ ColumnLayout {
function findAnchor(item: Item, anchor: string): Item {
if (!item)
return null;
if (item.settingAnchor !== undefined && item.settingAnchor === anchor) // qmllint disable missing-property
if (item.settingAnchor !== undefined && item.settingAnchor === anchor)
return item;
const kids = item.children;
for (let i = 0; i < kids.length; i++) {
@@ -42,14 +40,12 @@ ColumnLayout {
return null;
}
// Flash a row without scrolling (used when re-selecting the current setting).
function highlightAnchor(anchor: string): void {
const row = findAnchor(contentChild, anchor);
if (row && row.flashHighlight !== undefined) // qmllint disable missing-property
row.flashHighlight(); // qmllint disable missing-property
if (row && row.flashHighlight !== undefined)
row.flashHighlight();
}
// When the settings search jumps to this page, scroll to the matching row.
function scrollToAnchor(anchor: string): bool {
if (!anchor || !contentChild)
return false;
@@ -57,8 +53,6 @@ ColumnLayout {
if (!row)
return false;
const pos = row.mapToItem(flickable.contentItem, 0, 0);
// Land the row below the top fade so it isn't dimmed by the edge effect,
// clamped to the flickable's real scroll range (which includes margins).
const inset = flickable.height * flickable.fadeAmount + Appearance.padding.large;
const minY = -flickable.topMargin;
const maxY = Math.max(minY, flickable.contentHeight + flickable.bottomMargin - flickable.height);
@@ -66,8 +60,8 @@ ColumnLayout {
root.animateScroll = true;
flickable.contentY = target;
Qt.callLater(() => root.animateScroll = false);
if (row.flashHighlight !== undefined) // qmllint disable missing-property
row.flashHighlight(); // qmllint disable missing-property
if (row.flashHighlight !== undefined)
row.flashHighlight();
return true;
}
@@ -86,10 +80,6 @@ ColumnLayout {
repeat: true
onTriggered: {
// Pages like the ethernet detail load their content asynchronously
// (device info, IP config), so the layout keeps growing for a while.
// Wait until contentHeight has held steady for a few frames (or we've
// waited long enough) before scrolling, so the target doesn't drift.
const h = flickable.contentHeight;
if (h === lastHeight && h > flickable.height)
stableFrames++;
@@ -119,9 +109,8 @@ ColumnLayout {
target: root.sState
}
MouseArea { // Prevent clicks from reaching flickable
Layout.bottomMargin: -flickable.topMargin // Extra height to block clicks on flickable top margin
MouseArea {
Layout.bottomMargin: -flickable.topMargin
implicitHeight: header.implicitHeight - Layout.bottomMargin
implicitWidth: header.implicitWidth
z: 1