mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 21:42:51 -05:00
feat: Add Transparency override option to Notepad
This commit is contained in:
@@ -85,7 +85,7 @@ Item {
|
||||
width: 360
|
||||
height: settingsColumn.implicitHeight + Theme.spacingXL * 2
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.popupBackground()
|
||||
color: Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g, Theme.surfaceContainer.b, Theme.notepadTransparency)
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
||||
border.width: 1
|
||||
z: 100
|
||||
@@ -265,6 +265,53 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
height: transparencySliderColumn.height + Theme.spacingS
|
||||
color: "transparent"
|
||||
|
||||
Column {
|
||||
id: transparencySliderColumn
|
||||
width: parent.width
|
||||
spacing: Theme.spacingS
|
||||
|
||||
DankToggle {
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: -Theme.spacingM
|
||||
width: parent.width + Theme.spacingM
|
||||
text: "Custom Transparency"
|
||||
description: "Override global transparency for Notepad"
|
||||
checked: SettingsData.notepadTransparencyOverride >= 0
|
||||
onToggled: checked => {
|
||||
if (checked) {
|
||||
SettingsData.notepadTransparencyOverride = SettingsData.notepadLastCustomTransparency
|
||||
} else {
|
||||
SettingsData.notepadTransparencyOverride = -1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DankSlider {
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: -Theme.spacingM
|
||||
width: parent.width + Theme.spacingM
|
||||
height: 24
|
||||
visible: SettingsData.notepadTransparencyOverride >= 0
|
||||
value: Math.round((SettingsData.notepadTransparencyOverride >= 0 ? SettingsData.notepadTransparencyOverride : SettingsData.popupTransparency) * 100)
|
||||
minimum: 0
|
||||
maximum: 100
|
||||
unit: ""
|
||||
showValue: true
|
||||
wheelEnabled: false
|
||||
onSliderValueChanged: newValue => {
|
||||
if (SettingsData.notepadTransparencyOverride >= 0) {
|
||||
SettingsData.notepadTransparencyOverride = newValue / 100
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StyledText {
|
||||
width: parent.width
|
||||
text: SettingsData.notepadUseMonospace ?
|
||||
|
||||
@@ -88,7 +88,7 @@ Column {
|
||||
StyledRect {
|
||||
width: parent.width
|
||||
height: parent.height - bottomControls.height - Theme.spacingM
|
||||
color: Theme.surface
|
||||
color: Qt.rgba(Theme.surface.r, Theme.surface.g, Theme.surface.b, Theme.notepadTransparency)
|
||||
border.color: Theme.outlineMedium
|
||||
border.width: 1
|
||||
radius: Theme.cornerRadius
|
||||
@@ -329,6 +329,7 @@ Column {
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceTextMedium
|
||||
visible: textArea.text.length > 0
|
||||
opacity: 1.0
|
||||
}
|
||||
|
||||
StyledText {
|
||||
@@ -359,7 +360,7 @@ Column {
|
||||
return Theme.success
|
||||
}
|
||||
}
|
||||
opacity: textArea.text.length > 0 ? 1 : 0
|
||||
opacity: textArea.text.length > 0 ? 1.0 : 0.0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user