Merge branch 'Ly-sec:main' into main

This commit is contained in:
Jose Chasey Pratama 2025-08-03 22:34:49 +07:00 committed by GitHub
commit 70c0debe99
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 40 additions and 27 deletions

View file

@ -110,6 +110,7 @@ Scope {
Brightness { Brightness {
id: widgetsBrightness id: widgetsBrightness
screen: modelData
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }
@ -251,4 +252,4 @@ Scope {
// This alias exposes the visual bar's visibility to the outside world // This alias exposes the visual bar's visibility to the outside world
property alias visible: barRootItem.visible property alias visible: barRootItem.visible
} }

View file

@ -91,7 +91,7 @@ Singleton {
FolderListModel { FolderListModel {
id: folderModel id: folderModel
nameFilters: ["*.jpg", "*.jpeg", "*.png", "*.gif", "*.pnm", "*.bmp"] nameFilters: Settings.settings.useSWWW ? ["*.avif", "*.jpg", "*.jpeg", "*.png", "*.gif", "*.pnm", "*.tga", "*.tiff", "*.webp", "*.bmp", "*.farbfeld"] : ["*.jpg", "*.jpeg", "*.png", "*.gif", "*.pnm", "*.bmp"]
showDirs: false showDirs: false
sortField: FolderListModel.Name sortField: FolderListModel.Name
onStatusChanged: { onStatusChanged: {

View file

@ -34,7 +34,7 @@ Item {
hoverEnabled: true hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
acceptedButtons: Qt.LeftButton | Qt.RightButton acceptedButtons: Qt.LeftButton | Qt.RightButton
onClicked: function(mouse): void { onClicked: function(mouse) {
if (mouse.button === Qt.RightButton) { if (mouse.button === Qt.RightButton) {
root.isSilence = !root.isSilence; root.isSilence = !root.isSilence;
rightClickProcess.running = true; rightClickProcess.running = true;
@ -60,4 +60,4 @@ Item {
targetItem: bell targetItem: bell
delay: 200 delay: 200
} }
} }

View file

@ -59,15 +59,15 @@ PanelWithOverlay {
if (sidebarPopupRect.settingsModal && sidebarPopupRect.settingsModal.visible) { if (sidebarPopupRect.settingsModal && sidebarPopupRect.settingsModal.visible) {
sidebarPopupRect.settingsModal.visible = false; sidebarPopupRect.settingsModal.visible = false;
} }
if (sidebarPopupRect.wallpaperPanelModal && sidebarPopupRect.wallpaperPanelModal.visible) { if (wallpaperPanelLoader && wallpaperPanelLoader.active) {
sidebarPopupRect.wallpaperPanelModal.visible = false; wallpaperPanelLoader.active = false;
}
if (sidebarPopupRect.wifiPanelModal && sidebarPopupRect.wifiPanelModal.visible) {
sidebarPopupRect.wifiPanelModal.visible = false;
}
if (sidebarPopupRect.bluetoothPanelModal && sidebarPopupRect.bluetoothPanelModal.visible) {
sidebarPopupRect.bluetoothPanelModal.visible = false;
} }
if (sidebarPopupRect.wifiPanelModal && sidebarPopupRect.wifiPanelModal.visible) {
sidebarPopupRect.wifiPanelModal.visible = false;
}
if (sidebarPopupRect.bluetoothPanelModal && sidebarPopupRect.bluetoothPanelModal.visible) {
sidebarPopupRect.bluetoothPanelModal.visible = false;
}
if (sidebarPopup.visible) { if (sidebarPopup.visible) {
slideAnim.from = 0; slideAnim.from = 0;
slideAnim.to = width; slideAnim.to = width;
@ -125,7 +125,6 @@ PanelWithOverlay {
} }
property alias settingsModal: settingsModal property alias settingsModal: settingsModal
property alias wallpaperPanelModal: wallpaperPanelModal
property alias wifiPanelModal: wifiPanel.panel property alias wifiPanelModal: wifiPanel.panel
property alias bluetoothPanelModal: bluetoothPanel.panel property alias bluetoothPanelModal: bluetoothPanel.panel
SettingsModal { SettingsModal {
@ -313,9 +312,7 @@ PanelWithOverlay {
onSettingsRequested: { onSettingsRequested: {
settingsModal.visible = true; settingsModal.visible = true;
} }
onWallpaperRequested: { onWallpaperRequested: wallpaperPanelLoader.active = true;
wallpaperPanelModal.visible = true;
}
} }
} }
Keys.onEscapePressed: sidebarPopupRect.hidePopup() Keys.onEscapePressed: sidebarPopupRect.hidePopup()
@ -402,16 +399,20 @@ PanelWithOverlay {
} }
} }
WallpaperPanel { LazyLoader {
id: wallpaperPanelModal id: wallpaperPanelLoader
visible: false loading: false
Component.onCompleted: {
if (parent) { WallpaperPanel {
wallpaperPanelModal.anchors.top = parent.top; // Need to keep this visible so it shows once loaded
wallpaperPanelModal.anchors.right = parent.right; visible: true
Component.onCompleted: {
if (parent) {
anchors.top = parent.top;
anchors.right = parent.right;
}
} }
} }
// Add a close button inside WallpaperPanel.qml for user to close the modal
} }
} }
} }

View file

@ -30,7 +30,7 @@ PanelWindow {
} }
onVisibleChanged: { onVisibleChanged: {
if (wallpaperPanelModal.visible) { if (wallpaperPanelLoader.active) {
wallpapers = WallpaperManager.wallpaperList wallpapers = WallpaperManager.wallpaperList
} else { } else {
wallpapers = [] wallpapers = []
@ -81,7 +81,7 @@ PanelWindow {
id: closeButtonArea id: closeButtonArea
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: true
onClicked: wallpaperPanelModal.visible = false onClicked: wallpaperPanelLoader.active = false;
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
} }
} }
@ -136,13 +136,24 @@ PanelWindow {
source: modelData source: modelData
fillMode: Image.PreserveAspectCrop fillMode: Image.PreserveAspectCrop
asynchronous: true asynchronous: true
cache: true cache: false
smooth: true smooth: true
mipmap: true mipmap: true
// Limit memory usage // Limit memory usage
sourceSize.width: 480 sourceSize.width: 480
sourceSize.height: 270 sourceSize.height: 270
} }
Rectangle {
anchors.fill: parent
color: Theme.textPrimary
opacity: (wallpaperImage.status == Image.Ready) ? 0.0 : 1.0
Behavior on opacity {
NumberAnimation {
duration: 500
easing.type: Easing.OutCubic
}
}
}
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: true