Merge branch 'main' into module/wifi
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 10s
Python / lint-format (pull_request) Successful in 30s
Python / test (pull_request) Successful in 42s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m36s
C++ / build (pull_request) Successful in 2m20s
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 10s
Python / lint-format (pull_request) Successful in 30s
Python / test (pull_request) Successful in 42s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m36s
C++ / build (pull_request) Successful in 2m20s
This commit is contained in:
@@ -267,8 +267,6 @@ Item {
|
||||
function restoreFromData() {
|
||||
let data = Wallpapers.getCrop(wrapper.currentScreen.name);
|
||||
|
||||
console.log(data.x, data.y);
|
||||
|
||||
if (data && (Math.abs(data.x) > 0.001 || Math.abs(data.y) > 0.001 || Math.abs(data.width - 1.0) > 0.001 || Math.abs(data.height - 1.0) > 0.001)) {
|
||||
zoom = data.zoom > 0 ? data.zoom : 1.0;
|
||||
x = imageX + (data.x * scaledImg.paintedWidth);
|
||||
|
||||
@@ -249,7 +249,7 @@ VerticalFadeFlickable {
|
||||
elide: Text.ElideRight
|
||||
font.pointSize: Appearance.font.size.medium
|
||||
text: SettingsSearcher.highlight(result.modelData.title, root.search, DynamicColors.palette.m3primary)
|
||||
textFormat: Text.StyledText
|
||||
textFormat: text.includes("<font") ? Text.StyledText : Text.PlainText
|
||||
}
|
||||
|
||||
CustomText {
|
||||
@@ -258,7 +258,7 @@ VerticalFadeFlickable {
|
||||
elide: Text.ElideRight
|
||||
font.pointSize: Appearance.font.size.small
|
||||
text: SettingsSearcher.highlight(result.modelData.subtext, root.search, DynamicColors.palette.m3primary)
|
||||
textFormat: Text.StyledText
|
||||
textFormat: text.includes("<font") ? Text.StyledText : Text.PlainText
|
||||
visible: result.modelData.subtext.length > 0
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,6 +56,14 @@ PageBase {
|
||||
onToggled: Config.dashboard.performance.showGpu = checked
|
||||
}
|
||||
|
||||
ToggleRow {
|
||||
checked: Config.dashboard.performance.showVram
|
||||
settingAnchor: "resources-vram"
|
||||
text: qsTr("Video memory")
|
||||
|
||||
onToggled: Config.dashboard.performance.showVram = checked
|
||||
}
|
||||
|
||||
ToggleRow {
|
||||
checked: Config.dashboard.performance.showCpu
|
||||
settingAnchor: "resources-cpu"
|
||||
|
||||
@@ -10,16 +10,39 @@ Singleton {
|
||||
id: root
|
||||
|
||||
property var fzfFinder: null
|
||||
readonly property var highlightCache: ({
|
||||
"search": "",
|
||||
"pattern": null
|
||||
})
|
||||
property var inverted: ({})
|
||||
property var ranking: ({})
|
||||
|
||||
function highlight(text: string, search: string, colour: color): string {
|
||||
const escaped = text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
||||
const tokens = tokenize(search);
|
||||
if (tokens.length === 0)
|
||||
if (search.length === 0)
|
||||
return escaped;
|
||||
const escapedTokens = tokens.map(t => t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
|
||||
const pattern = new RegExp("\\b(" + escapedTokens.join("|") + ")", "gi");
|
||||
|
||||
const cache = root.highlightCache;
|
||||
if (search !== cache.search) {
|
||||
const tokens = tokenize(search);
|
||||
cache.search = search;
|
||||
if (tokens.length === 0)
|
||||
cache.pattern = null;
|
||||
else {
|
||||
const escapedTokens = tokens.map(t => t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
|
||||
cache.pattern = new RegExp("\\b(" + escapedTokens.join("|") + ")", "gi");
|
||||
}
|
||||
}
|
||||
|
||||
const pattern = cache.pattern;
|
||||
if (!pattern)
|
||||
return escaped;
|
||||
|
||||
pattern.lastIndex = 0;
|
||||
if (!pattern.test(escaped))
|
||||
return escaped;
|
||||
|
||||
pattern.lastIndex = 0;
|
||||
return escaped.replace(pattern, `<font color="${colour}">$1</font>`);
|
||||
}
|
||||
|
||||
|
||||
@@ -39,8 +39,6 @@ Item {
|
||||
sState.animatingContainer: content.opacity < 1
|
||||
sState.currentPageIdx: ["wallpaper"][0]
|
||||
sState.screen: root.screen
|
||||
|
||||
onClose: console.log("shouldclose")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user