mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-04 12:38:31 -04:00
qs: large sweep of dead code removals
This commit is contained in:
@@ -4,6 +4,7 @@ import QtQuick
|
||||
import qs.Common
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
import "../../../Common/QmlUtils.js" as QmlUtils
|
||||
|
||||
Item {
|
||||
id: root
|
||||
@@ -20,16 +21,6 @@ Item {
|
||||
|
||||
readonly property bool isHighlighted: settingKey !== "" && SettingsSearchService.highlightSection === settingKey
|
||||
|
||||
function findParentFlickable() {
|
||||
let p = root.parent;
|
||||
while (p) {
|
||||
if (p.hasOwnProperty("contentY") && p.hasOwnProperty("contentItem"))
|
||||
return p;
|
||||
p = p.parent;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (!settingKey)
|
||||
return;
|
||||
@@ -37,7 +28,7 @@ Item {
|
||||
Qt.callLater(() => {
|
||||
if (!root.parent)
|
||||
return;
|
||||
var flickable = findParentFlickable();
|
||||
var flickable = QmlUtils.findParentFlickable(root.parent);
|
||||
if (flickable)
|
||||
SettingsSearchService.registerCard(key, root, flickable);
|
||||
});
|
||||
|
||||
@@ -4,6 +4,7 @@ import QtQuick
|
||||
import qs.Common
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
import "../../../Common/QmlUtils.js" as QmlUtils
|
||||
|
||||
StyledRect {
|
||||
id: root
|
||||
@@ -43,17 +44,6 @@ StyledRect {
|
||||
readonly property bool hasHeader: root.title !== "" || root.iconName !== ""
|
||||
property bool userToggledCollapse: false
|
||||
|
||||
function findParentFlickable() {
|
||||
let p = root.parent;
|
||||
while (p) {
|
||||
if (p.hasOwnProperty("contentY") && p.hasOwnProperty("contentItem")) {
|
||||
return p;
|
||||
}
|
||||
p = p.parent;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (!settingKey)
|
||||
return;
|
||||
@@ -61,7 +51,7 @@ StyledRect {
|
||||
Qt.callLater(() => {
|
||||
if (!root.parent)
|
||||
return;
|
||||
var flickable = findParentFlickable();
|
||||
var flickable = QmlUtils.findParentFlickable(root.parent);
|
||||
if (flickable)
|
||||
SettingsSearchService.registerCard(key, root, flickable);
|
||||
});
|
||||
|
||||
@@ -4,6 +4,7 @@ import QtQuick
|
||||
import qs.Common
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
import "../../../Common/QmlUtils.js" as QmlUtils
|
||||
|
||||
DankDropdown {
|
||||
id: root
|
||||
@@ -35,16 +36,6 @@ DankDropdown {
|
||||
}
|
||||
}
|
||||
|
||||
function findParentFlickable() {
|
||||
let p = root.parent;
|
||||
while (p) {
|
||||
if (p.hasOwnProperty("contentY") && p.hasOwnProperty("contentItem"))
|
||||
return p;
|
||||
p = p.parent;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (!settingKey)
|
||||
return;
|
||||
@@ -52,7 +43,7 @@ DankDropdown {
|
||||
Qt.callLater(() => {
|
||||
if (!root.parent)
|
||||
return;
|
||||
var flickable = findParentFlickable();
|
||||
var flickable = QmlUtils.findParentFlickable(root.parent);
|
||||
if (flickable)
|
||||
SettingsSearchService.registerCard(key, root, flickable);
|
||||
});
|
||||
|
||||
@@ -4,6 +4,7 @@ import QtQuick
|
||||
import qs.Common
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
import "../../../Common/QmlUtils.js" as QmlUtils
|
||||
|
||||
StyledRect {
|
||||
id: root
|
||||
@@ -36,16 +37,6 @@ StyledRect {
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainerHigh
|
||||
|
||||
function findParentFlickable() {
|
||||
let p = root.parent;
|
||||
while (p) {
|
||||
if (p.hasOwnProperty("contentY") && p.hasOwnProperty("contentItem"))
|
||||
return p;
|
||||
p = p.parent;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (!settingKey)
|
||||
return;
|
||||
@@ -53,7 +44,7 @@ StyledRect {
|
||||
Qt.callLater(() => {
|
||||
if (!root.parent)
|
||||
return;
|
||||
const flickable = findParentFlickable();
|
||||
const flickable = QmlUtils.findParentFlickable(root.parent);
|
||||
if (flickable)
|
||||
SettingsSearchService.registerCard(key, root, flickable);
|
||||
});
|
||||
|
||||
@@ -4,6 +4,7 @@ import QtQuick
|
||||
import qs.Common
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
import "../../../Common/QmlUtils.js" as QmlUtils
|
||||
|
||||
Item {
|
||||
id: root
|
||||
@@ -20,16 +21,6 @@ Item {
|
||||
|
||||
readonly property bool isHighlighted: settingKey !== "" && SettingsSearchService.highlightSection === settingKey
|
||||
|
||||
function findParentFlickable() {
|
||||
let p = root.parent;
|
||||
while (p) {
|
||||
if (p.hasOwnProperty("contentY") && p.hasOwnProperty("contentItem"))
|
||||
return p;
|
||||
p = p.parent;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (!settingKey)
|
||||
return;
|
||||
@@ -37,7 +28,7 @@ Item {
|
||||
Qt.callLater(() => {
|
||||
if (!root.parent)
|
||||
return;
|
||||
var flickable = findParentFlickable();
|
||||
var flickable = QmlUtils.findParentFlickable(root.parent);
|
||||
if (flickable)
|
||||
SettingsSearchService.registerCard(key, root, flickable);
|
||||
});
|
||||
|
||||
@@ -4,6 +4,7 @@ import QtQuick
|
||||
import qs.Common
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
import "../../../Common/QmlUtils.js" as QmlUtils
|
||||
|
||||
StyledRect {
|
||||
id: root
|
||||
@@ -30,16 +31,6 @@ StyledRect {
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainerHigh
|
||||
|
||||
function findParentFlickable() {
|
||||
let p = root.parent;
|
||||
while (p) {
|
||||
if (p.hasOwnProperty("contentY") && p.hasOwnProperty("contentItem"))
|
||||
return p;
|
||||
p = p.parent;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (!settingKey)
|
||||
return;
|
||||
@@ -47,7 +38,7 @@ StyledRect {
|
||||
Qt.callLater(() => {
|
||||
if (!root.parent)
|
||||
return;
|
||||
const flickable = findParentFlickable();
|
||||
const flickable = QmlUtils.findParentFlickable(root.parent);
|
||||
if (flickable)
|
||||
SettingsSearchService.registerCard(key, root, flickable);
|
||||
});
|
||||
|
||||
@@ -4,6 +4,7 @@ import QtQuick
|
||||
import qs.Common
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
import "../../../Common/QmlUtils.js" as QmlUtils
|
||||
|
||||
DankToggle {
|
||||
id: root
|
||||
@@ -19,16 +20,6 @@ DankToggle {
|
||||
|
||||
width: parent?.width ?? 0
|
||||
|
||||
function findParentFlickable() {
|
||||
let p = root.parent;
|
||||
while (p) {
|
||||
if (p.hasOwnProperty("contentY") && p.hasOwnProperty("contentItem"))
|
||||
return p;
|
||||
p = p.parent;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (!settingKey)
|
||||
return;
|
||||
@@ -36,7 +27,7 @@ DankToggle {
|
||||
Qt.callLater(() => {
|
||||
if (!root.parent)
|
||||
return;
|
||||
var flickable = findParentFlickable();
|
||||
var flickable = QmlUtils.findParentFlickable(root.parent);
|
||||
if (flickable)
|
||||
SettingsSearchService.registerCard(key, root, flickable);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user