diff --git a/Modules/Notepad/Notepad.qml b/Modules/Notepad/Notepad.qml index e95d0b1b..800388e8 100644 --- a/Modules/Notepad/Notepad.qml +++ b/Modules/Notepad/Notepad.qml @@ -15,6 +15,7 @@ pragma ComponentBehavior: Bound Item { id: root + property real devicePixelRatio: 1 property bool fileDialogOpen: false property string currentFileName: "" property url currentFileUrl @@ -150,6 +151,7 @@ Item { id: tabBar width: parent.width contentLoaded: textEditor.contentLoaded + devicePixelRatio: root.devicePixelRatio onTabSwitched: (tabIndex) => { switchToTab(tabIndex) @@ -168,6 +170,7 @@ Item { id: textEditor width: parent.width height: parent.height - tabBar.height - Theme.spacingM * 2 + devicePixelRatio: root.devicePixelRatio onSaveRequested: { if (currentTab && !currentTab.isTemporary && currentTab.filePath) { @@ -214,6 +217,7 @@ Item { id: notepadSettings anchors.fill: parent isVisible: showSettingsMenu + devicePixelRatio: root.devicePixelRatio onSettingsRequested: showSettingsMenu = !showSettingsMenu onFindRequested: { showSettingsMenu = false diff --git a/Modules/Notepad/NotepadSettings.qml b/Modules/Notepad/NotepadSettings.qml index 6955f5af..06330b9d 100644 --- a/Modules/Notepad/NotepadSettings.qml +++ b/Modules/Notepad/NotepadSettings.qml @@ -9,6 +9,7 @@ pragma ComponentBehavior: Bound Item { id: root + property real devicePixelRatio: 1 property bool isVisible: false property var cachedFontFamilies: [] property var cachedMonoFamilies: [] diff --git a/Modules/Notepad/NotepadTabs.qml b/Modules/Notepad/NotepadTabs.qml index ec027d88..9b199847 100644 --- a/Modules/Notepad/NotepadTabs.qml +++ b/Modules/Notepad/NotepadTabs.qml @@ -9,6 +9,7 @@ pragma ComponentBehavior: Bound Column { id: root + property real devicePixelRatio: 1 property var currentTab: NotepadStorageService.tabs.length > NotepadStorageService.currentTabIndex ? NotepadStorageService.tabs[NotepadStorageService.currentTabIndex] : null property bool contentLoaded: false diff --git a/Modules/Notepad/NotepadTextEditor.qml b/Modules/Notepad/NotepadTextEditor.qml index 998c015b..715021b4 100644 --- a/Modules/Notepad/NotepadTextEditor.qml +++ b/Modules/Notepad/NotepadTextEditor.qml @@ -11,6 +11,7 @@ pragma ComponentBehavior: Bound Column { id: root + property real devicePixelRatio: 1 property alias text: textArea.text property alias textArea: textArea property bool contentLoaded: false diff --git a/Widgets/DankSlideout.qml b/Widgets/DankSlideout.qml index 3a7e7806..9d954e99 100644 --- a/Widgets/DankSlideout.qml +++ b/Widgets/DankSlideout.qml @@ -3,6 +3,7 @@ import QtQuick.Controls import Quickshell import Quickshell.Wayland import qs.Common +import qs.Services import qs.Widgets pragma ComponentBehavior: Bound @@ -83,7 +84,7 @@ PanelWindow { StyledRect { id: contentRect - readonly property real dpr: root.modelData?.devicePixelRatio || 1 + readonly property real dpr: CompositorService.getScreenScale(root.modelData) layer.enabled: true layer.smooth: false layer.textureSize: Qt.size(width * dpr, height * dpr) @@ -182,8 +183,15 @@ PanelWindow { anchors.bottomMargin: Theme.spacingL Loader { + id: contentLoader anchors.fill: parent sourceComponent: root.content + + onLoaded: { + if (item && "devicePixelRatio" in item) { + item.devicePixelRatio = contentRect.dpr + } + } } } }