mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-10 07:25:37 -05:00
Add font override options in Notepad
This commit is contained in:
@@ -83,6 +83,12 @@ Singleton {
|
|||||||
property string monoFontFamily: "Fira Code"
|
property string monoFontFamily: "Fira Code"
|
||||||
property int fontWeight: Font.Normal
|
property int fontWeight: Font.Normal
|
||||||
property real fontScale: 1.0
|
property real fontScale: 1.0
|
||||||
|
property bool notepadUseMonospace: true
|
||||||
|
property string notepadFontFamily: ""
|
||||||
|
property real notepadFontSize: 14
|
||||||
|
onNotepadUseMonospaceChanged: saveSettings()
|
||||||
|
onNotepadFontFamilyChanged: saveSettings()
|
||||||
|
onNotepadFontSizeChanged: saveSettings()
|
||||||
property bool gtkThemingEnabled: false
|
property bool gtkThemingEnabled: false
|
||||||
property bool qtThemingEnabled: false
|
property bool qtThemingEnabled: false
|
||||||
property bool showDock: false
|
property bool showDock: false
|
||||||
@@ -248,6 +254,9 @@ Singleton {
|
|||||||
monoFontFamily = settings.monoFontFamily !== undefined ? settings.monoFontFamily : defaultMonoFontFamily
|
monoFontFamily = settings.monoFontFamily !== undefined ? settings.monoFontFamily : defaultMonoFontFamily
|
||||||
fontWeight = settings.fontWeight !== undefined ? settings.fontWeight : Font.Normal
|
fontWeight = settings.fontWeight !== undefined ? settings.fontWeight : Font.Normal
|
||||||
fontScale = settings.fontScale !== undefined ? settings.fontScale : 1.0
|
fontScale = settings.fontScale !== undefined ? settings.fontScale : 1.0
|
||||||
|
notepadUseMonospace = settings.notepadUseMonospace !== undefined ? settings.notepadUseMonospace : true
|
||||||
|
notepadFontFamily = settings.notepadFontFamily !== undefined ? settings.notepadFontFamily : ""
|
||||||
|
notepadFontSize = settings.notepadFontSize !== undefined ? settings.notepadFontSize : 14
|
||||||
gtkThemingEnabled = settings.gtkThemingEnabled !== undefined ? settings.gtkThemingEnabled : false
|
gtkThemingEnabled = settings.gtkThemingEnabled !== undefined ? settings.gtkThemingEnabled : false
|
||||||
qtThemingEnabled = settings.qtThemingEnabled !== undefined ? settings.qtThemingEnabled : false
|
qtThemingEnabled = settings.qtThemingEnabled !== undefined ? settings.qtThemingEnabled : false
|
||||||
showDock = settings.showDock !== undefined ? settings.showDock : false
|
showDock = settings.showDock !== undefined ? settings.showDock : false
|
||||||
@@ -346,6 +355,9 @@ Singleton {
|
|||||||
"monoFontFamily": monoFontFamily,
|
"monoFontFamily": monoFontFamily,
|
||||||
"fontWeight": fontWeight,
|
"fontWeight": fontWeight,
|
||||||
"fontScale": fontScale,
|
"fontScale": fontScale,
|
||||||
|
"notepadUseMonospace": notepadUseMonospace,
|
||||||
|
"notepadFontFamily": notepadFontFamily,
|
||||||
|
"notepadFontSize": notepadFontSize,
|
||||||
"gtkThemingEnabled": gtkThemingEnabled,
|
"gtkThemingEnabled": gtkThemingEnabled,
|
||||||
"qtThemingEnabled": qtThemingEnabled,
|
"qtThemingEnabled": qtThemingEnabled,
|
||||||
"showDock": showDock,
|
"showDock": showDock,
|
||||||
|
|||||||
@@ -30,6 +30,10 @@ PanelWindow {
|
|||||||
property string currentContent: ""
|
property string currentContent: ""
|
||||||
property string lastSavedContent: ""
|
property string lastSavedContent: ""
|
||||||
property bool contentLoaded: false
|
property bool contentLoaded: false
|
||||||
|
property bool showSettingsMenu: false
|
||||||
|
property var cachedFontFamilies: []
|
||||||
|
property var cachedMonoFamilies: []
|
||||||
|
property bool fontsEnumerated: false
|
||||||
|
|
||||||
function hasUnsavedChanges() {
|
function hasUnsavedChanges() {
|
||||||
if (!currentTab || !contentLoaded) {
|
if (!currentTab || !contentLoaded) {
|
||||||
@@ -40,8 +44,6 @@ PanelWindow {
|
|||||||
if (currentTab.isTemporary) {
|
if (currentTab.isTemporary) {
|
||||||
return textArea.text.length > 0
|
return textArea.text.length > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// For non-temporary files, show unsaved if content differs from last saved state
|
|
||||||
return textArea.text !== lastSavedContent
|
return textArea.text !== lastSavedContent
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,6 +61,54 @@ PanelWindow {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function enumerateFonts() {
|
||||||
|
var fonts = ["Default"]
|
||||||
|
var availableFonts = Qt.fontFamilies()
|
||||||
|
var rootFamilies = []
|
||||||
|
var seenFamilies = new Set()
|
||||||
|
for (var i = 0; i < availableFonts.length; i++) {
|
||||||
|
var fontName = availableFonts[i]
|
||||||
|
if (fontName.startsWith("."))
|
||||||
|
continue
|
||||||
|
|
||||||
|
if (fontName === SettingsData.defaultFontFamily)
|
||||||
|
continue
|
||||||
|
|
||||||
|
var rootName = fontName.replace(/ (Thin|Extra Light|Light|Regular|Medium|Semi Bold|Demi Bold|Bold|Extra Bold|Black|Heavy)$/i, "").replace(/ (Italic|Oblique|Condensed|Extended|Narrow|Wide)$/i,
|
||||||
|
"").replace(/ (UI|Display|Text|Mono|Sans|Serif)$/i, function (match, suffix) {
|
||||||
|
return match
|
||||||
|
}).trim()
|
||||||
|
if (!seenFamilies.has(rootName) && rootName !== "") {
|
||||||
|
seenFamilies.add(rootName)
|
||||||
|
rootFamilies.push(rootName)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cachedFontFamilies = fonts.concat(rootFamilies.sort())
|
||||||
|
var monoFonts = ["Default"]
|
||||||
|
var monoFamilies = []
|
||||||
|
var seenMonoFamilies = new Set()
|
||||||
|
for (var j = 0; j < availableFonts.length; j++) {
|
||||||
|
var fontName2 = availableFonts[j]
|
||||||
|
if (fontName2.startsWith("."))
|
||||||
|
continue
|
||||||
|
|
||||||
|
if (fontName2 === SettingsData.defaultMonoFontFamily)
|
||||||
|
continue
|
||||||
|
|
||||||
|
var lowerName = fontName2.toLowerCase()
|
||||||
|
if (lowerName.includes("mono") || lowerName.includes("code") || lowerName.includes("console") || lowerName.includes("terminal") || lowerName.includes("courier") || lowerName.includes("dejavu sans mono") || lowerName.includes(
|
||||||
|
"jetbrains") || lowerName.includes("fira") || lowerName.includes("hack") || lowerName.includes("source code") || lowerName.includes("ubuntu mono") || lowerName.includes("cascadia")) {
|
||||||
|
var rootName2 = fontName2.replace(/ (Thin|Extra Light|Light|Regular|Medium|Semi Bold|Demi Bold|Bold|Extra Bold|Black|Heavy)$/i, "").replace(/ (Italic|Oblique|Condensed|Extended|Narrow|Wide)$/i, "").trim()
|
||||||
|
if (!seenMonoFamilies.has(rootName2) && rootName2 !== "") {
|
||||||
|
seenMonoFamilies.add(rootName2)
|
||||||
|
monoFamilies.push(rootName2)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cachedMonoFamilies = monoFonts.concat(monoFamilies.sort())
|
||||||
|
fontsEnumerated = true
|
||||||
|
}
|
||||||
|
|
||||||
function loadCurrentTabContent() {
|
function loadCurrentTabContent() {
|
||||||
if (!currentTab) return
|
if (!currentTab) return
|
||||||
|
|
||||||
@@ -173,6 +223,12 @@ PanelWindow {
|
|||||||
WlrLayershell.exclusiveZone: 0
|
WlrLayershell.exclusiveZone: 0
|
||||||
WlrLayershell.keyboardFocus: isVisible ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None
|
WlrLayershell.keyboardFocus: isVisible ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
if (!fontsEnumerated) {
|
||||||
|
enumerateFonts()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
StyledRect {
|
StyledRect {
|
||||||
id: contentRect
|
id: contentRect
|
||||||
|
|
||||||
@@ -417,8 +473,8 @@ PanelWindow {
|
|||||||
TextArea {
|
TextArea {
|
||||||
id: textArea
|
id: textArea
|
||||||
placeholderText: qsTr("Start typing your notes here...")
|
placeholderText: qsTr("Start typing your notes here...")
|
||||||
font.family: SettingsData.monoFontFamily
|
font.family: SettingsData.notepadUseMonospace ? SettingsData.monoFontFamily : (SettingsData.notepadFontFamily || SettingsData.fontFamily)
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
font.pixelSize: SettingsData.notepadFontSize * SettingsData.fontScale
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
selectByMouse: true
|
selectByMouse: true
|
||||||
selectByKeyboard: true
|
selectByKeyboard: true
|
||||||
@@ -529,69 +585,85 @@ PanelWindow {
|
|||||||
width: parent.width
|
width: parent.width
|
||||||
spacing: Theme.spacingS
|
spacing: Theme.spacingS
|
||||||
|
|
||||||
Row {
|
Item {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
spacing: Theme.spacingL
|
height: 32
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
spacing: Theme.spacingS
|
anchors.left: parent.left
|
||||||
DankActionButton {
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
iconName: "save"
|
spacing: Theme.spacingL
|
||||||
iconSize: Theme.iconSize - 2
|
|
||||||
iconColor: Theme.primary
|
|
||||||
enabled: currentTab && (hasUnsavedChanges() || textArea.text.length > 0)
|
|
||||||
onClicked: {
|
|
||||||
root.fileDialogOpen = true
|
|
||||||
saveBrowser.open()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
StyledText {
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
text: qsTr("Save")
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceTextMedium
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
spacing: Theme.spacingS
|
spacing: Theme.spacingS
|
||||||
DankActionButton {
|
DankActionButton {
|
||||||
iconName: "folder_open"
|
iconName: "save"
|
||||||
iconSize: Theme.iconSize - 2
|
iconSize: Theme.iconSize - 2
|
||||||
iconColor: Theme.secondary
|
iconColor: Theme.primary
|
||||||
onClicked: {
|
enabled: currentTab && (hasUnsavedChanges() || textArea.text.length > 0)
|
||||||
if (hasUnsavedChanges()) {
|
onClicked: {
|
||||||
root.pendingAction = "open"
|
|
||||||
root.confirmationDialogOpen = true
|
|
||||||
confirmationDialog.open()
|
|
||||||
} else {
|
|
||||||
root.fileDialogOpen = true
|
root.fileDialogOpen = true
|
||||||
loadBrowser.open()
|
saveBrowser.open()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
StyledText {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
text: qsTr("Save")
|
||||||
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
|
color: Theme.surfaceTextMedium
|
||||||
|
}
|
||||||
}
|
}
|
||||||
StyledText {
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
Row {
|
||||||
text: qsTr("Open")
|
spacing: Theme.spacingS
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
DankActionButton {
|
||||||
color: Theme.surfaceTextMedium
|
iconName: "folder_open"
|
||||||
|
iconSize: Theme.iconSize - 2
|
||||||
|
iconColor: Theme.secondary
|
||||||
|
onClicked: {
|
||||||
|
if (hasUnsavedChanges()) {
|
||||||
|
root.pendingAction = "open"
|
||||||
|
root.confirmationDialogOpen = true
|
||||||
|
confirmationDialog.open()
|
||||||
|
} else {
|
||||||
|
root.fileDialogOpen = true
|
||||||
|
loadBrowser.open()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
StyledText {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
text: qsTr("Open")
|
||||||
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
|
color: Theme.surfaceTextMedium
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
spacing: Theme.spacingS
|
||||||
|
DankActionButton {
|
||||||
|
iconName: "note_add"
|
||||||
|
iconSize: Theme.iconSize - 2
|
||||||
|
iconColor: Theme.surfaceText
|
||||||
|
onClicked: createNewTab()
|
||||||
|
}
|
||||||
|
StyledText {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
text: qsTr("New")
|
||||||
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
|
color: Theme.surfaceTextMedium
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
DankActionButton {
|
||||||
spacing: Theme.spacingS
|
id: settingsButton
|
||||||
DankActionButton {
|
anchors.right: parent.right
|
||||||
iconName: "note_add"
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
iconSize: Theme.iconSize - 2
|
iconName: "more_horiz"
|
||||||
iconColor: Theme.surfaceText
|
iconSize: Theme.iconSize - 2
|
||||||
onClicked: createNewTab()
|
iconColor: Theme.surfaceText
|
||||||
}
|
onClicked: showSettingsMenu = !showSettingsMenu
|
||||||
StyledText {
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
text: qsTr("New")
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceTextMedium
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -645,6 +717,203 @@ PanelWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
visible: showSettingsMenu
|
||||||
|
onClicked: showSettingsMenu = false
|
||||||
|
z: 50
|
||||||
|
}
|
||||||
|
|
||||||
|
// Settings Menu Popup
|
||||||
|
Rectangle {
|
||||||
|
id: settingsMenu
|
||||||
|
visible: showSettingsMenu
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
y: 423
|
||||||
|
width: 360
|
||||||
|
height: settingsColumn.implicitHeight + Theme.spacingXL * 2
|
||||||
|
radius: Theme.cornerRadius
|
||||||
|
color: Theme.popupBackground()
|
||||||
|
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
||||||
|
border.width: 1
|
||||||
|
z: 100
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.topMargin: 4
|
||||||
|
anchors.leftMargin: 2
|
||||||
|
anchors.rightMargin: -2
|
||||||
|
anchors.bottomMargin: -4
|
||||||
|
radius: parent.radius
|
||||||
|
color: Qt.rgba(0, 0, 0, 0.15)
|
||||||
|
z: parent.z - 1
|
||||||
|
}
|
||||||
|
|
||||||
|
Column {
|
||||||
|
id: settingsColumn
|
||||||
|
width: parent.width - Theme.spacingXL * 2
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.topMargin: Theme.spacingXL
|
||||||
|
spacing: Theme.spacingS
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
width: parent.width
|
||||||
|
height: 36
|
||||||
|
color: "transparent"
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.leftMargin: -Theme.spacingXS
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
text: "Notepad Font Settings"
|
||||||
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
|
font.weight: Font.Medium
|
||||||
|
color: Theme.surfaceText
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
width: parent.width
|
||||||
|
height: 1
|
||||||
|
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
|
||||||
|
}
|
||||||
|
|
||||||
|
DankToggle {
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.leftMargin: -Theme.spacingM
|
||||||
|
width: parent.width + Theme.spacingM
|
||||||
|
text: "Use Monospace Font"
|
||||||
|
description: "Toggle fonts"
|
||||||
|
checked: SettingsData.notepadUseMonospace
|
||||||
|
onToggled: checked => {
|
||||||
|
SettingsData.notepadUseMonospace = checked
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
width: parent.width
|
||||||
|
height: visible ? (fontDropdown.height + Theme.spacingS) : 0
|
||||||
|
color: "transparent"
|
||||||
|
visible: !SettingsData.notepadUseMonospace
|
||||||
|
|
||||||
|
DankDropdown {
|
||||||
|
id: fontDropdown
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.leftMargin: -Theme.spacingM
|
||||||
|
width: parent.width + Theme.spacingM
|
||||||
|
text: "Font Family"
|
||||||
|
options: cachedFontFamilies
|
||||||
|
currentValue: {
|
||||||
|
if (!SettingsData.notepadFontFamily || SettingsData.notepadFontFamily === "")
|
||||||
|
return "Default (Global)"
|
||||||
|
else
|
||||||
|
return SettingsData.notepadFontFamily
|
||||||
|
}
|
||||||
|
enableFuzzySearch: true
|
||||||
|
onValueChanged: value => {
|
||||||
|
if (value && (value.startsWith("Default") || value === "Default (Global)")) {
|
||||||
|
SettingsData.notepadFontFamily = ""
|
||||||
|
} else {
|
||||||
|
SettingsData.notepadFontFamily = value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
width: parent.width
|
||||||
|
height: fontSizeRow.height + Theme.spacingS
|
||||||
|
color: "transparent"
|
||||||
|
|
||||||
|
Row {
|
||||||
|
id: fontSizeRow
|
||||||
|
width: parent.width
|
||||||
|
spacing: Theme.spacingS
|
||||||
|
|
||||||
|
Column {
|
||||||
|
width: parent.width - fontSizeControls.width - Theme.spacingM
|
||||||
|
spacing: Theme.spacingXS
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: "Font Size"
|
||||||
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
|
font.weight: Font.Medium
|
||||||
|
color: Theme.surfaceText
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: SettingsData.notepadFontSize + "px"
|
||||||
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
|
color: Theme.surfaceVariantText
|
||||||
|
width: parent.width
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
id: fontSizeControls
|
||||||
|
spacing: Theme.spacingS
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
|
DankActionButton {
|
||||||
|
buttonSize: 32
|
||||||
|
iconName: "remove"
|
||||||
|
iconSize: Theme.iconSizeSmall
|
||||||
|
enabled: SettingsData.notepadFontSize > 8
|
||||||
|
backgroundColor: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.5)
|
||||||
|
iconColor: Theme.surfaceText
|
||||||
|
onClicked: {
|
||||||
|
var newSize = Math.max(8, SettingsData.notepadFontSize - 1)
|
||||||
|
SettingsData.notepadFontSize = newSize
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
width: 60
|
||||||
|
height: 32
|
||||||
|
radius: Theme.cornerRadius
|
||||||
|
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
|
||||||
|
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
|
||||||
|
border.width: 1
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
text: SettingsData.notepadFontSize + "px"
|
||||||
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
|
font.weight: Font.Medium
|
||||||
|
color: Theme.surfaceText
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DankActionButton {
|
||||||
|
buttonSize: 32
|
||||||
|
iconName: "add"
|
||||||
|
iconSize: Theme.iconSizeSmall
|
||||||
|
enabled: SettingsData.notepadFontSize < 48
|
||||||
|
backgroundColor: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.5)
|
||||||
|
iconColor: Theme.surfaceText
|
||||||
|
onClicked: {
|
||||||
|
var newSize = Math.min(48, SettingsData.notepadFontSize + 1)
|
||||||
|
SettingsData.notepadFontSize = newSize
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
width: parent.width
|
||||||
|
text: SettingsData.notepadUseMonospace ?
|
||||||
|
"Using global monospace font from Settings → Personalization" :
|
||||||
|
"Global fonts can be configured in Settings → Personalization"
|
||||||
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
|
color: Theme.surfaceTextMedium
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
opacity: 0.8
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
@@ -669,7 +938,6 @@ PanelWindow {
|
|||||||
pendingSaveContent = content
|
pendingSaveContent = content
|
||||||
saveFileView.path = filePath
|
saveFileView.path = filePath
|
||||||
|
|
||||||
// Use Qt.callLater to ensure path is set before calling setText
|
|
||||||
Qt.callLater(() => {
|
Qt.callLater(() => {
|
||||||
saveFileView.setText(pendingSaveContent)
|
saveFileView.setText(pendingSaveContent)
|
||||||
})
|
})
|
||||||
@@ -765,7 +1033,6 @@ PanelWindow {
|
|||||||
if (currentTab && currentTab.title && currentTab.title !== "Untitled") {
|
if (currentTab && currentTab.title && currentTab.title !== "Untitled") {
|
||||||
return currentTab.title
|
return currentTab.title
|
||||||
} else if (currentTab && !currentTab.isTemporary && currentTab.filePath) {
|
} else if (currentTab && !currentTab.isTemporary && currentTab.filePath) {
|
||||||
// Extract filename from path for non-temporary files
|
|
||||||
return currentTab.filePath.split('/').pop()
|
return currentTab.filePath.split('/').pop()
|
||||||
} else {
|
} else {
|
||||||
return "note.txt"
|
return "note.txt"
|
||||||
|
|||||||
Reference in New Issue
Block a user