mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
Merge branch 'main' into patch-3
This commit is contained in:
@@ -19,8 +19,7 @@ SmartPanel {
|
||||
readonly property bool isReady: battery && battery.ready && battery.isLaptopBattery && battery.isPresent
|
||||
readonly property int percent: isReady ? Math.round(battery.percentage * 100) : -1
|
||||
readonly property bool charging: isReady ? battery.state === UPowerDeviceState.Charging : false
|
||||
readonly property bool healthSupported: isReady && battery.healthSupported
|
||||
readonly property bool healthAvailable: healthSupported
|
||||
readonly property bool healthAvailable: isReady && battery.healthSupported
|
||||
readonly property int healthPercent: healthAvailable ? Math.round(battery.healthPercentage) : -1
|
||||
readonly property bool powerProfileAvailable: PowerProfileService.available
|
||||
readonly property var powerProfiles: [PowerProfile.PowerSaver, PowerProfile.Balanced, PowerProfile.Performance]
|
||||
@@ -117,7 +116,7 @@ SmartPanel {
|
||||
|
||||
ColumnLayout {
|
||||
NText {
|
||||
text: I18n.tr("battery.charge-level")
|
||||
text: I18n.tr("battery.battery-level")
|
||||
color: Color.mOnSurface
|
||||
pointSize: Style.fontSizeS
|
||||
}
|
||||
|
||||
@@ -25,9 +25,10 @@ NBox {
|
||||
anchors.margins: Style.marginM
|
||||
spacing: Style.marginM
|
||||
|
||||
NImageCircled {
|
||||
NImageRounded {
|
||||
Layout.preferredWidth: Math.round(Style.baseWidgetSize * 1.25 * Style.uiScaleRatio)
|
||||
Layout.preferredHeight: Math.round(Style.baseWidgetSize * 1.25 * Style.uiScaleRatio)
|
||||
radius: width * 0.5
|
||||
imagePath: Settings.preprocessPath(Settings.data.general.avatarImage)
|
||||
fallbackIcon: "person"
|
||||
borderColor: Color.mPrimary
|
||||
|
||||
@@ -689,7 +689,7 @@ SmartPanel {
|
||||
id: imagePreview
|
||||
anchors.fill: parent
|
||||
visible: modelData.isImage && !modelData.emojiChar
|
||||
imageRadius: Style.radiusM
|
||||
radius: Style.radiusM
|
||||
|
||||
// This property creates a dependency on the service's revision counter
|
||||
readonly property int _rev: ClipboardService.revision
|
||||
@@ -934,7 +934,7 @@ SmartPanel {
|
||||
id: gridImagePreview
|
||||
anchors.fill: parent
|
||||
visible: modelData.isImage && !modelData.emojiChar
|
||||
imageRadius: Style.radiusM
|
||||
radius: Style.radiusM
|
||||
|
||||
readonly property int _rev: ClipboardService.revision
|
||||
|
||||
|
||||
@@ -197,10 +197,11 @@ SmartPanel {
|
||||
spacing: Style.marginM
|
||||
|
||||
// Icon
|
||||
NImageCircled {
|
||||
NImageRounded {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: Math.round(40 * Style.uiScaleRatio)
|
||||
height: Math.round(40 * Style.uiScaleRatio)
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
radius: width * 0.5
|
||||
imagePath: model.cachedImage || model.originalImage || ""
|
||||
borderColor: Color.transparent
|
||||
borderWidth: 0
|
||||
|
||||
@@ -59,10 +59,11 @@ ColumnLayout {
|
||||
description: I18n.tr("bar.widget-settings.control-center.icon.description")
|
||||
}
|
||||
|
||||
NImageCircled {
|
||||
NImageRounded {
|
||||
Layout.preferredWidth: Style.fontSizeXL * 2
|
||||
Layout.preferredHeight: Style.fontSizeXL * 2
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
radius: width * 0.5
|
||||
imagePath: valueCustomIconPath
|
||||
visible: valueCustomIconPath !== ""
|
||||
}
|
||||
|
||||
@@ -189,10 +189,11 @@ ColumnLayout {
|
||||
Layout.preferredWidth: Style.baseWidgetSize * 2 * Style.uiScaleRatio
|
||||
Layout.preferredHeight: Style.baseWidgetSize * 2 * Style.uiScaleRatio
|
||||
|
||||
NImageCircled {
|
||||
imagePath: modelData.avatar_url || ""
|
||||
NImageRounded {
|
||||
anchors.fill: parent
|
||||
anchors.margins: Style.marginXS
|
||||
radius: width * 0.5
|
||||
imagePath: modelData.avatar_url || ""
|
||||
fallbackIcon: "person"
|
||||
borderColor: contributorArea.containsMouse ? Color.mOnHover : Color.mPrimary
|
||||
borderWidth: Style.borderM
|
||||
|
||||
@@ -21,9 +21,10 @@ ColumnLayout {
|
||||
spacing: Style.marginL
|
||||
|
||||
// Avatar preview
|
||||
NImageCircled {
|
||||
NImageRounded {
|
||||
Layout.preferredWidth: 88 * Style.uiScaleRatio
|
||||
Layout.preferredHeight: width
|
||||
radius: width * 0.5
|
||||
imagePath: Settings.preprocessPath(Settings.data.general.avatarImage)
|
||||
fallbackIcon: "person"
|
||||
borderColor: Color.mPrimary
|
||||
|
||||
@@ -401,7 +401,6 @@ SmartPanel {
|
||||
|
||||
Settings.data.general.scaleRatio = selectedScaleRatio;
|
||||
Settings.data.bar.position = selectedBarPosition;
|
||||
Settings.data.setupCompleted = true;
|
||||
|
||||
// Save settings immediately and wait for settingsSaved signal before closing
|
||||
Settings.saveImmediate();
|
||||
|
||||
@@ -43,8 +43,14 @@ SmartPanel {
|
||||
function wildCardMatch(str, rule) {
|
||||
if (!str || !rule)
|
||||
return false;
|
||||
let escaped = rule.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
||||
let pattern = '^' + escaped.replace(/\\\*/g, '.*') + '$';
|
||||
// First, convert '*' to a placeholder to preserve it, then escape other special regex characters
|
||||
// Use a unique placeholder that won't appear in normal strings
|
||||
const placeholder = '\uE000'; // Private use character
|
||||
let processedRule = rule.replace(/\*/g, placeholder);
|
||||
// Escape all special regex characters (but placeholder won't match this)
|
||||
let escaped = processedRule.replace(/[.+?^${}()|[\]\\]/g, '\\$&');
|
||||
// Convert placeholder back to '.*' for wildcard matching
|
||||
let pattern = '^' + escaped.replace(new RegExp(placeholder, 'g'), '.*') + '$';
|
||||
try {
|
||||
return new RegExp(pattern, 'i').test(str);
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user