mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-14 09:42:10 -04:00
(dms): Remove beta features for stable release v1.4.4
This commit is contained in:
@@ -1 +1 @@
|
|||||||
The Wolverine
|
Saffron Bloom
|
||||||
|
|||||||
@@ -49,15 +49,15 @@ var SPEC = {
|
|||||||
modalAnimationSpeed: { def: 1 },
|
modalAnimationSpeed: { def: 1 },
|
||||||
modalCustomAnimationDuration: { def: 150 },
|
modalCustomAnimationDuration: { def: 150 },
|
||||||
enableRippleEffects: { def: true },
|
enableRippleEffects: { def: true },
|
||||||
m3ElevationEnabled: { def: true },
|
m3ElevationEnabled: { def: false },
|
||||||
m3ElevationIntensity: { def: 12 },
|
m3ElevationIntensity: { def: 12 },
|
||||||
m3ElevationOpacity: { def: 30 },
|
m3ElevationOpacity: { def: 30 },
|
||||||
m3ElevationColorMode: { def: "default" },
|
m3ElevationColorMode: { def: "default" },
|
||||||
m3ElevationLightDirection: { def: "top" },
|
m3ElevationLightDirection: { def: "top" },
|
||||||
m3ElevationCustomColor: { def: "#000000" },
|
m3ElevationCustomColor: { def: "#000000" },
|
||||||
modalElevationEnabled: { def: true },
|
modalElevationEnabled: { def: false },
|
||||||
popoutElevationEnabled: { def: true },
|
popoutElevationEnabled: { def: false },
|
||||||
barElevationEnabled: { def: true },
|
barElevationEnabled: { def: false },
|
||||||
wallpaperFillMode: { def: "Fill" },
|
wallpaperFillMode: { def: "Fill" },
|
||||||
blurredWallpaperLayer: { def: false },
|
blurredWallpaperLayer: { def: false },
|
||||||
blurWallpaperOnOverview: { def: false },
|
blurWallpaperOnOverview: { def: false },
|
||||||
@@ -484,7 +484,7 @@ var SPEC = {
|
|||||||
scrollYBehavior: "workspace",
|
scrollYBehavior: "workspace",
|
||||||
shadowIntensity: 0,
|
shadowIntensity: 0,
|
||||||
shadowOpacity: 60,
|
shadowOpacity: 60,
|
||||||
shadowColorMode: "default",
|
shadowColorMode: "text",
|
||||||
shadowCustomColor: "#000000",
|
shadowCustomColor: "#000000",
|
||||||
clickThrough: false
|
clickThrough: false
|
||||||
}], onChange: "updateBarConfigs"
|
}], onChange: "updateBarConfigs"
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ FloatingWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
objectName: "changelogModal"
|
objectName: "changelogModal"
|
||||||
title: i18n("What's New")
|
title: I18n.tr("What's New")
|
||||||
minimumSize: Qt.size(modalWidth, modalHeight)
|
minimumSize: Qt.size(modalWidth, modalHeight)
|
||||||
maximumSize: Qt.size(modalWidth, modalHeight)
|
maximumSize: Qt.size(modalWidth, modalHeight)
|
||||||
color: Theme.surfaceContainer
|
color: Theme.surfaceContainer
|
||||||
@@ -81,7 +81,7 @@ FloatingWindow {
|
|||||||
onClicked: root.dismiss()
|
onClicked: root.dismiss()
|
||||||
|
|
||||||
DankTooltip {
|
DankTooltip {
|
||||||
text: i18n("Close")
|
text: I18n.tr("Close")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -125,7 +125,7 @@ FloatingWindow {
|
|||||||
spacing: Theme.spacingM
|
spacing: Theme.spacingM
|
||||||
|
|
||||||
DankButton {
|
DankButton {
|
||||||
text: i18n("Read Full Release Notes")
|
text: I18n.tr("Read Full Release Notes")
|
||||||
iconName: "open_in_new"
|
iconName: "open_in_new"
|
||||||
backgroundColor: Theme.surfaceContainerHighest
|
backgroundColor: Theme.surfaceContainerHighest
|
||||||
textColor: Theme.surfaceText
|
textColor: Theme.surfaceText
|
||||||
@@ -133,7 +133,7 @@ FloatingWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DankButton {
|
DankButton {
|
||||||
text: i18n("Got It")
|
text: I18n.tr("Got It")
|
||||||
iconName: "check"
|
iconName: "check"
|
||||||
backgroundColor: Theme.primary
|
backgroundColor: Theme.primary
|
||||||
textColor: Theme.primaryText
|
textColor: Theme.primaryText
|
||||||
|
|||||||
@@ -244,8 +244,8 @@ FocusScope {
|
|||||||
Loader {
|
Loader {
|
||||||
id: greeterLoader
|
id: greeterLoader
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
active: root.currentIndex === 31
|
active: false
|
||||||
visible: active
|
visible: false
|
||||||
focus: active
|
focus: active
|
||||||
|
|
||||||
sourceComponent: GreeterTab {}
|
sourceComponent: GreeterTab {}
|
||||||
|
|||||||
@@ -293,12 +293,6 @@ Rectangle {
|
|||||||
"icon": "lock",
|
"icon": "lock",
|
||||||
"tabIndex": 11
|
"tabIndex": 11
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"id": "greeter",
|
|
||||||
"text": I18n.tr("Greeter"),
|
|
||||||
"icon": "login",
|
|
||||||
"tabIndex": 31
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"id": "power_sleep",
|
"id": "power_sleep",
|
||||||
"text": I18n.tr("Power & Sleep"),
|
"text": I18n.tr("Power & Sleep"),
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
|
import QtQuick.Effects
|
||||||
import QtQuick.Shapes
|
import QtQuick.Shapes
|
||||||
import qs.Common
|
import qs.Common
|
||||||
import qs.Services
|
import qs.Services
|
||||||
@@ -52,43 +53,15 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// M3 elevation shadow — Level 2 baseline (navigation bar), with per-bar override support
|
readonly property real shadowIntensity: barConfig?.shadowIntensity ?? 0
|
||||||
readonly property bool hasPerBarOverride: (barConfig?.shadowIntensity ?? 0) > 0
|
readonly property bool shadowEnabled: shadowIntensity > 0
|
||||||
readonly property var elevLevel: Theme.elevationLevel2
|
readonly property int blurMax: 64
|
||||||
readonly property bool shadowEnabled: (Theme.elevationEnabled && (typeof SettingsData !== "undefined" ? (SettingsData.barElevationEnabled ?? true) : false)) || hasPerBarOverride
|
readonly property real shadowBlurPx: shadowIntensity * 0.2
|
||||||
readonly property string autoBarShadowDirection: isTop ? "top" : (isBottom ? "bottom" : (isLeft ? "left" : (isRight ? "right" : "top")))
|
readonly property real shadowBlur: Math.max(0, Math.min(1, shadowBlurPx / blurMax))
|
||||||
readonly property string globalShadowDirection: Theme.elevationLightDirection === "autoBar" ? autoBarShadowDirection : Theme.elevationLightDirection
|
readonly property real shadowOpacity: (barConfig?.shadowOpacity ?? 60) / 100
|
||||||
readonly property string perBarShadowDirectionMode: barConfig?.shadowDirectionMode ?? "inherit"
|
readonly property string shadowColorMode: barConfig?.shadowColorMode ?? "text"
|
||||||
readonly property string perBarManualShadowDirection: {
|
readonly property color shadowBaseColor: {
|
||||||
switch (barConfig?.shadowDirection) {
|
switch (shadowColorMode) {
|
||||||
case "top":
|
|
||||||
case "topLeft":
|
|
||||||
case "topRight":
|
|
||||||
case "bottom":
|
|
||||||
return barConfig.shadowDirection;
|
|
||||||
default:
|
|
||||||
return "top";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
readonly property string effectiveShadowDirection: {
|
|
||||||
if (!hasPerBarOverride)
|
|
||||||
return globalShadowDirection;
|
|
||||||
switch (perBarShadowDirectionMode) {
|
|
||||||
case "autoBar":
|
|
||||||
return autoBarShadowDirection;
|
|
||||||
case "manual":
|
|
||||||
return perBarManualShadowDirection === "autoBar" ? autoBarShadowDirection : perBarManualShadowDirection;
|
|
||||||
default:
|
|
||||||
return globalShadowDirection;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Per-bar override values (when barConfig.shadowIntensity > 0)
|
|
||||||
readonly property real overrideBlurPx: (barConfig?.shadowIntensity ?? 0) * 0.2
|
|
||||||
readonly property real overrideOpacity: (barConfig?.shadowOpacity ?? 60) / 100
|
|
||||||
readonly property string overrideColorMode: barConfig?.shadowColorMode ?? "default"
|
|
||||||
readonly property color overrideBaseColor: {
|
|
||||||
switch (overrideColorMode) {
|
|
||||||
case "surface":
|
case "surface":
|
||||||
return Theme.surface;
|
return Theme.surface;
|
||||||
case "primary":
|
case "primary":
|
||||||
@@ -98,16 +71,10 @@ Item {
|
|||||||
case "custom":
|
case "custom":
|
||||||
return barConfig?.shadowCustomColor ?? "#000000";
|
return barConfig?.shadowCustomColor ?? "#000000";
|
||||||
default:
|
default:
|
||||||
return "#000000";
|
return Theme.surfaceText;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
readonly property color shadowColor: Theme.withAlpha(shadowBaseColor, shadowOpacity * barWindow._backgroundAlpha)
|
||||||
// Resolved values — per-bar override wins if set, otherwise use global M3 elevation
|
|
||||||
readonly property real shadowBlurPx: hasPerBarOverride ? overrideBlurPx : (elevLevel.blurPx ?? 8)
|
|
||||||
readonly property color shadowColor: hasPerBarOverride ? Theme.withAlpha(overrideBaseColor, overrideOpacity) : Theme.elevationShadowColor(elevLevel)
|
|
||||||
readonly property real shadowOffsetMagnitude: hasPerBarOverride ? (overrideBlurPx * 0.5) : Theme.elevationOffsetMagnitude(elevLevel, 4, effectiveShadowDirection)
|
|
||||||
readonly property real shadowOffsetX: Theme.elevationOffsetXFor(hasPerBarOverride ? null : elevLevel, effectiveShadowDirection, shadowOffsetMagnitude)
|
|
||||||
readonly property real shadowOffsetY: Theme.elevationOffsetYFor(hasPerBarOverride ? null : elevLevel, effectiveShadowDirection, shadowOffsetMagnitude)
|
|
||||||
|
|
||||||
readonly property string mainPath: generatePathForPosition(width, height)
|
readonly property string mainPath: generatePathForPosition(width, height)
|
||||||
readonly property string borderFullPath: generateBorderFullPath(width, height)
|
readonly property string borderFullPath: generateBorderFullPath(width, height)
|
||||||
@@ -151,28 +118,42 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ElevationShadow {
|
Loader {
|
||||||
id: barShadow
|
id: shadowLoader
|
||||||
visible: root.shadowEnabled && root.width > 0 && root.height > 0
|
anchors.fill: parent
|
||||||
|
active: root.shadowEnabled && mainPathCorrectShape
|
||||||
|
asynchronous: false
|
||||||
|
sourceComponent: Item {
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
// Size to the bar's rectangular body, excluding gothic wing extensions
|
layer.enabled: true
|
||||||
x: root.isRight ? root.wing : 0
|
layer.smooth: true
|
||||||
y: root.isBottom ? root.wing : 0
|
layer.samples: 8
|
||||||
width: axis.isVertical ? (parent.width - root.wing) : parent.width
|
layer.textureSize: Qt.size(Math.round(width * barWindow._dpr * 2), Math.round(height * barWindow._dpr * 2))
|
||||||
height: axis.isVertical ? parent.height : (parent.height - root.wing)
|
layer.effect: MultiEffect {
|
||||||
|
shadowEnabled: true
|
||||||
|
shadowBlur: root.shadowBlur
|
||||||
|
shadowColor: root.shadowColor
|
||||||
|
shadowVerticalOffset: root.isTop ? root.shadowBlurPx * 0.5 : (root.isBottom ? -root.shadowBlurPx * 0.5 : 0)
|
||||||
|
shadowHorizontalOffset: root.isLeft ? root.shadowBlurPx * 0.5 : (root.isRight ? -root.shadowBlurPx * 0.5 : 0)
|
||||||
|
autoPaddingEnabled: true
|
||||||
|
}
|
||||||
|
|
||||||
shadowEnabled: root.shadowEnabled
|
Shape {
|
||||||
level: root.hasPerBarOverride ? null : root.elevLevel
|
anchors.fill: parent
|
||||||
direction: root.effectiveShadowDirection
|
preferredRendererType: Shape.CurveRenderer
|
||||||
fallbackOffset: 4
|
|
||||||
targetRadius: root.rt
|
|
||||||
targetColor: barWindow._bgColor
|
|
||||||
|
|
||||||
shadowBlurPx: root.shadowBlurPx
|
ShapePath {
|
||||||
shadowOffsetX: root.shadowOffsetX
|
fillColor: barWindow._bgColor
|
||||||
shadowOffsetY: root.shadowOffsetY
|
strokeColor: "transparent"
|
||||||
shadowColor: root.shadowColor
|
strokeWidth: 0
|
||||||
blurMax: Theme.elevationBlurMax
|
|
||||||
|
PathSvg {
|
||||||
|
path: root.mainPath
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
|
|||||||
@@ -10,10 +10,6 @@ Column {
|
|||||||
|
|
||||||
property var currentTab: NotepadStorageService.tabs.length > NotepadStorageService.currentTabIndex ? NotepadStorageService.tabs[NotepadStorageService.currentTabIndex] : null
|
property var currentTab: NotepadStorageService.tabs.length > NotepadStorageService.currentTabIndex ? NotepadStorageService.tabs[NotepadStorageService.currentTabIndex] : null
|
||||||
property bool contentLoaded: false
|
property bool contentLoaded: false
|
||||||
property int draggedIndex: -1
|
|
||||||
property int dropTargetIndex: -1
|
|
||||||
property bool suppressShiftAnimation: false
|
|
||||||
readonly property real tabItemSize: 128 + Theme.spacingXS
|
|
||||||
|
|
||||||
signal tabSwitched(int tabIndex)
|
signal tabSwitched(int tabIndex)
|
||||||
signal tabClosed(int tabIndex)
|
signal tabClosed(int tabIndex)
|
||||||
@@ -50,221 +46,92 @@ Column {
|
|||||||
Repeater {
|
Repeater {
|
||||||
model: NotepadStorageService.tabs
|
model: NotepadStorageService.tabs
|
||||||
|
|
||||||
delegate: Item {
|
delegate: Rectangle {
|
||||||
id: delegateItem
|
|
||||||
required property int index
|
required property int index
|
||||||
required property var modelData
|
required property var modelData
|
||||||
|
|
||||||
readonly property bool isActive: NotepadStorageService.currentTabIndex === index
|
readonly property bool isActive: NotepadStorageService.currentTabIndex === index
|
||||||
readonly property bool isHovered: tabMouseArea.containsMouse && !closeMouseArea.containsMouse
|
readonly property bool isHovered: tabMouseArea.containsMouse && !closeMouseArea.containsMouse
|
||||||
readonly property real tabWidth: 128
|
readonly property real tabWidth: 128
|
||||||
property bool longPressing: false
|
|
||||||
property bool dragging: false
|
|
||||||
property point dragStartPos: Qt.point(0, 0)
|
|
||||||
property int targetIndex: -1
|
|
||||||
property int originalIndex: -1
|
|
||||||
property real dragAxisOffset: 0
|
|
||||||
|
|
||||||
Timer {
|
|
||||||
id: longPressTimer
|
|
||||||
interval: 200
|
|
||||||
repeat: false
|
|
||||||
onTriggered: {
|
|
||||||
if (NotepadStorageService.tabs.length > 1) {
|
|
||||||
delegateItem.longPressing = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
readonly property real shiftOffset: {
|
|
||||||
if (root.draggedIndex < 0)
|
|
||||||
return 0
|
|
||||||
if (index === root.draggedIndex)
|
|
||||||
return 0
|
|
||||||
var dragIdx = root.draggedIndex
|
|
||||||
var dropIdx = root.dropTargetIndex
|
|
||||||
var myIdx = index
|
|
||||||
var shiftAmount = root.tabItemSize
|
|
||||||
if (dropIdx < 0)
|
|
||||||
return 0
|
|
||||||
if (dragIdx < dropIdx && myIdx > dragIdx && myIdx <= dropIdx)
|
|
||||||
return -shiftAmount
|
|
||||||
if (dragIdx > dropIdx && myIdx >= dropIdx && myIdx < dragIdx)
|
|
||||||
return shiftAmount
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
width: tabWidth
|
width: tabWidth
|
||||||
height: 32
|
height: 32
|
||||||
z: dragging ? 100 : 0
|
radius: Theme.cornerRadius
|
||||||
|
color: isActive ? Theme.primaryPressed : isHovered ? Theme.primaryHoverLight : Theme.withAlpha(Theme.primaryPressed, 0)
|
||||||
transform: Translate {
|
border.width: isActive ? 0 : 1
|
||||||
x: shiftOffset
|
border.color: Theme.outlineMedium
|
||||||
Behavior on x {
|
clip: true
|
||||||
enabled: !root.suppressShiftAnimation
|
|
||||||
NumberAnimation {
|
|
||||||
duration: 150
|
|
||||||
easing.type: Easing.OutCubic
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: tabVisual
|
|
||||||
anchors.fill: parent
|
|
||||||
z: 1
|
|
||||||
layer.enabled: dragging
|
|
||||||
layer.smooth: true
|
|
||||||
|
|
||||||
transform: Translate {
|
|
||||||
x: dragging ? dragAxisOffset : 0
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: tabRect
|
|
||||||
anchors.fill: parent
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: isActive ? Theme.primaryPressed : isHovered ? Theme.primaryHoverLight : Theme.withAlpha(Theme.primaryPressed, 0)
|
|
||||||
border.width: isActive || dragging ? 0 : 1
|
|
||||||
border.color: dragging ? Theme.primary : Theme.outlineMedium
|
|
||||||
clip: true
|
|
||||||
|
|
||||||
Row {
|
|
||||||
id: tabContent
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.leftMargin: Theme.spacingM
|
|
||||||
anchors.rightMargin: Theme.spacingM
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
id: tabText
|
|
||||||
width: parent.width - (tabCloseButton.visible ? tabCloseButton.width + Theme.spacingXS : 0)
|
|
||||||
text: {
|
|
||||||
var prefix = ""
|
|
||||||
if (hasUnsavedChangesForTab(modelData)) {
|
|
||||||
prefix = "● "
|
|
||||||
}
|
|
||||||
return prefix + (modelData.title || "Untitled")
|
|
||||||
}
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: isActive ? Theme.primary : Theme.surfaceText
|
|
||||||
font.weight: isActive ? Font.Medium : Font.Normal
|
|
||||||
elide: Text.ElideMiddle
|
|
||||||
maximumLineCount: 1
|
|
||||||
wrapMode: Text.NoWrap
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: tabCloseButton
|
|
||||||
width: 20
|
|
||||||
height: 20
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: closeMouseArea.containsMouse ? Theme.surfaceTextHover : Theme.withAlpha(Theme.surfaceTextHover, 0)
|
|
||||||
visible: NotepadStorageService.tabs.length > 1
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "close"
|
|
||||||
size: 14
|
|
||||||
color: Theme.surfaceTextMedium
|
|
||||||
anchors.centerIn: parent
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: closeMouseArea
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
z: 100
|
|
||||||
|
|
||||||
onClicked: root.tabClosed(index)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on color {
|
|
||||||
ColorAnimation {
|
|
||||||
duration: Theme.shortDuration
|
|
||||||
easing.type: Theme.standardEasing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: tabMouseArea
|
id: tabMouseArea
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
preventStealing: dragging || longPressing
|
cursorShape: Qt.PointingHandCursor
|
||||||
cursorShape: dragging || longPressing ? Qt.ClosedHandCursor : Qt.PointingHandCursor
|
|
||||||
acceptedButtons: Qt.LeftButton
|
acceptedButtons: Qt.LeftButton
|
||||||
|
|
||||||
onPressed: mouse => {
|
onClicked: root.tabSwitched(index)
|
||||||
if (mouse.button === Qt.LeftButton && NotepadStorageService.tabs.length > 1) {
|
}
|
||||||
delegateItem.dragStartPos = Qt.point(mouse.x, mouse.y)
|
|
||||||
longPressTimer.start()
|
Row {
|
||||||
|
id: tabContent
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.leftMargin: Theme.spacingM
|
||||||
|
anchors.rightMargin: Theme.spacingM
|
||||||
|
spacing: Theme.spacingXS
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
id: tabText
|
||||||
|
width: parent.width - (tabCloseButton.visible ? tabCloseButton.width + Theme.spacingXS : 0)
|
||||||
|
text: {
|
||||||
|
var prefix = "";
|
||||||
|
if (hasUnsavedChangesForTab(modelData)) {
|
||||||
|
prefix = "● ";
|
||||||
|
}
|
||||||
|
return prefix + (modelData.title || "Untitled");
|
||||||
}
|
}
|
||||||
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
|
color: isActive ? Theme.primary : Theme.surfaceText
|
||||||
|
font.weight: isActive ? Font.Medium : Font.Normal
|
||||||
|
elide: Text.ElideMiddle
|
||||||
|
maximumLineCount: 1
|
||||||
|
wrapMode: Text.NoWrap
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
onReleased: mouse => {
|
Rectangle {
|
||||||
longPressTimer.stop()
|
id: tabCloseButton
|
||||||
var wasDragging = delegateItem.dragging
|
width: 20
|
||||||
var didReorder = wasDragging && delegateItem.targetIndex >= 0 && delegateItem.targetIndex !== delegateItem.originalIndex
|
height: 20
|
||||||
|
radius: Theme.cornerRadius
|
||||||
|
color: closeMouseArea.containsMouse ? Theme.surfaceTextHover : Theme.withAlpha(Theme.surfaceTextHover, 0)
|
||||||
|
visible: NotepadStorageService.tabs.length > 1
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
if (didReorder) {
|
DankIcon {
|
||||||
root.suppressShiftAnimation = true
|
name: "close"
|
||||||
NotepadStorageService.reorderTab(delegateItem.originalIndex, delegateItem.targetIndex)
|
size: 14
|
||||||
|
color: Theme.surfaceTextMedium
|
||||||
|
anchors.centerIn: parent
|
||||||
}
|
}
|
||||||
|
|
||||||
delegateItem.longPressing = false
|
MouseArea {
|
||||||
delegateItem.dragging = false
|
id: closeMouseArea
|
||||||
delegateItem.dragAxisOffset = 0
|
anchors.fill: parent
|
||||||
delegateItem.targetIndex = -1
|
hoverEnabled: true
|
||||||
delegateItem.originalIndex = -1
|
cursorShape: Qt.PointingHandCursor
|
||||||
root.draggedIndex = -1
|
z: 100
|
||||||
root.dropTargetIndex = -1
|
|
||||||
if (didReorder) {
|
|
||||||
Qt.callLater(() => {
|
|
||||||
root.suppressShiftAnimation = false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
if (wasDragging || mouse.button !== Qt.LeftButton)
|
onClicked: {
|
||||||
return
|
root.tabClosed(index);
|
||||||
root.tabSwitched(index)
|
|
||||||
}
|
|
||||||
|
|
||||||
onPositionChanged: mouse => {
|
|
||||||
if (delegateItem.longPressing && !delegateItem.dragging) {
|
|
||||||
var distance = Math.sqrt(Math.pow(mouse.x - delegateItem.dragStartPos.x, 2) + Math.pow(mouse.y - delegateItem.dragStartPos.y, 2))
|
|
||||||
if (distance > 5) {
|
|
||||||
delegateItem.dragging = true
|
|
||||||
delegateItem.targetIndex = index
|
|
||||||
delegateItem.originalIndex = index
|
|
||||||
root.draggedIndex = index
|
|
||||||
root.dropTargetIndex = index
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!delegateItem.dragging)
|
Behavior on color {
|
||||||
return
|
ColorAnimation {
|
||||||
|
duration: Theme.shortDuration
|
||||||
var axisOffset = mouse.x - delegateItem.dragStartPos.x
|
easing.type: Theme.standardEasing
|
||||||
delegateItem.dragAxisOffset = axisOffset
|
|
||||||
|
|
||||||
var itemSize = root.tabItemSize
|
|
||||||
var rawSlot = axisOffset / itemSize
|
|
||||||
var slotOffset = rawSlot >= 0
|
|
||||||
? Math.floor(rawSlot + 0.4)
|
|
||||||
: Math.ceil(rawSlot - 0.4)
|
|
||||||
var tabCount = NotepadStorageService.tabs.length
|
|
||||||
var newTargetIndex = Math.max(0, Math.min(tabCount - 1, delegateItem.originalIndex + slotOffset))
|
|
||||||
|
|
||||||
if (newTargetIndex !== delegateItem.targetIndex) {
|
|
||||||
delegateItem.targetIndex = newTargetIndex
|
|
||||||
root.dropTargetIndex = newTargetIndex
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ PanelWindow {
|
|||||||
readonly property real maxPopupShadowBlurPx: Math.max((Theme.elevationLevel3 && Theme.elevationLevel3.blurPx !== undefined) ? Theme.elevationLevel3.blurPx : 12, (Theme.elevationLevel4 && Theme.elevationLevel4.blurPx !== undefined) ? Theme.elevationLevel4.blurPx : 16)
|
readonly property real maxPopupShadowBlurPx: Math.max((Theme.elevationLevel3 && Theme.elevationLevel3.blurPx !== undefined) ? Theme.elevationLevel3.blurPx : 12, (Theme.elevationLevel4 && Theme.elevationLevel4.blurPx !== undefined) ? Theme.elevationLevel4.blurPx : 16)
|
||||||
readonly property real maxPopupShadowOffsetXPx: Math.max(Math.abs(Theme.elevationOffsetX(Theme.elevationLevel3)), Math.abs(Theme.elevationOffsetX(Theme.elevationLevel4)))
|
readonly property real maxPopupShadowOffsetXPx: Math.max(Math.abs(Theme.elevationOffsetX(Theme.elevationLevel3)), Math.abs(Theme.elevationOffsetX(Theme.elevationLevel4)))
|
||||||
readonly property real maxPopupShadowOffsetYPx: Math.max(Math.abs(Theme.elevationOffsetY(Theme.elevationLevel3, 6)), Math.abs(Theme.elevationOffsetY(Theme.elevationLevel4, 8)))
|
readonly property real maxPopupShadowOffsetYPx: Math.max(Math.abs(Theme.elevationOffsetY(Theme.elevationLevel3, 6)), Math.abs(Theme.elevationOffsetY(Theme.elevationLevel4, 8)))
|
||||||
readonly property real windowShadowPad: Theme.elevationEnabled && SettingsData.notificationPopupShadowEnabled ? Theme.snap(Math.max(16, maxPopupShadowBlurPx + Math.max(maxPopupShadowOffsetXPx, maxPopupShadowOffsetYPx) + 8), dpr) : 0
|
readonly property real windowShadowPad: SettingsData.notificationPopupShadowEnabled ? Theme.snap(Math.max(16, maxPopupShadowBlurPx + Math.max(maxPopupShadowOffsetXPx, maxPopupShadowOffsetYPx) + 8), dpr) : 0
|
||||||
|
|
||||||
anchors.top: true
|
anchors.top: true
|
||||||
anchors.left: true
|
anchors.left: true
|
||||||
@@ -352,7 +352,7 @@ PanelWindow {
|
|||||||
readonly property bool swipeActive: swipeDragHandler.active
|
readonly property bool swipeActive: swipeDragHandler.active
|
||||||
property bool swipeDismissing: false
|
property bool swipeDismissing: false
|
||||||
|
|
||||||
readonly property bool shadowsAllowed: Theme.elevationEnabled && SettingsData.notificationPopupShadowEnabled
|
readonly property bool shadowsAllowed: SettingsData.notificationPopupShadowEnabled
|
||||||
readonly property var elevLevel: cardHoverHandler.hovered ? Theme.elevationLevel4 : Theme.elevationLevel3
|
readonly property var elevLevel: cardHoverHandler.hovered ? Theme.elevationLevel4 : Theme.elevationLevel3
|
||||||
readonly property real cardInset: Theme.snap(4, win.dpr)
|
readonly property real cardInset: Theme.snap(4, win.dpr)
|
||||||
readonly property real shadowRenderPadding: shadowsAllowed ? Theme.snap(Math.max(16, shadowBlurPx + Math.max(Math.abs(shadowOffsetX), Math.abs(shadowOffsetY)) + 8), win.dpr) : 0
|
readonly property real shadowRenderPadding: shadowsAllowed ? Theme.snap(Math.max(16, shadowBlurPx + Math.max(Math.abs(shadowOffsetX), Math.abs(shadowOffsetY)) + 8), win.dpr) : 0
|
||||||
|
|||||||
@@ -1049,50 +1049,20 @@ Item {
|
|||||||
SettingsCard {
|
SettingsCard {
|
||||||
id: shadowCard
|
id: shadowCard
|
||||||
iconName: "layers"
|
iconName: "layers"
|
||||||
title: I18n.tr("Shadow Override", "bar shadow settings card")
|
title: I18n.tr("Shadow", "bar shadow settings card")
|
||||||
settingKey: "barShadow"
|
settingKey: "barShadow"
|
||||||
collapsible: true
|
collapsible: true
|
||||||
expanded: true
|
expanded: false
|
||||||
visible: selectedBarConfig?.enabled
|
visible: selectedBarConfig?.enabled
|
||||||
|
|
||||||
readonly property bool shadowActive: (selectedBarConfig?.shadowIntensity ?? 0) > 0
|
readonly property bool shadowActive: (selectedBarConfig?.shadowIntensity ?? 0) > 0
|
||||||
readonly property bool isCustomColor: (selectedBarConfig?.shadowColorMode ?? "default") === "custom"
|
readonly property bool isCustomColor: (selectedBarConfig?.shadowColorMode ?? "text") === "custom"
|
||||||
readonly property string directionSource: selectedBarConfig?.shadowDirectionMode ?? "inherit"
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
width: parent.width
|
|
||||||
text: I18n.tr("Enable a custom override below to set per-bar shadow intensity, opacity, and color.")
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
horizontalAlignment: Text.AlignLeft
|
|
||||||
}
|
|
||||||
|
|
||||||
SettingsToggleRow {
|
|
||||||
text: I18n.tr("Custom Shadow Override")
|
|
||||||
description: I18n.tr("Override the global shadow with per-bar settings")
|
|
||||||
checked: shadowCard.shadowActive
|
|
||||||
onToggled: checked => {
|
|
||||||
if (checked) {
|
|
||||||
SettingsData.updateBarConfig(selectedBarId, {
|
|
||||||
shadowIntensity: 12,
|
|
||||||
shadowOpacity: 60
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
SettingsData.updateBarConfig(selectedBarId, {
|
|
||||||
shadowIntensity: 0
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SettingsSliderRow {
|
SettingsSliderRow {
|
||||||
visible: shadowCard.shadowActive
|
|
||||||
text: I18n.tr("Intensity", "shadow intensity slider")
|
text: I18n.tr("Intensity", "shadow intensity slider")
|
||||||
minimum: 0
|
minimum: 0
|
||||||
maximum: 100
|
maximum: 100
|
||||||
unit: "px"
|
unit: "%"
|
||||||
defaultValue: 12
|
|
||||||
value: selectedBarConfig?.shadowIntensity ?? 0
|
value: selectedBarConfig?.shadowIntensity ?? 0
|
||||||
onSliderValueChanged: newValue => SettingsData.updateBarConfig(selectedBarId, {
|
onSliderValueChanged: newValue => SettingsData.updateBarConfig(selectedBarId, {
|
||||||
shadowIntensity: newValue
|
shadowIntensity: newValue
|
||||||
@@ -1112,78 +1082,6 @@ Item {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsDropdownRow {
|
|
||||||
visible: shadowCard.shadowActive
|
|
||||||
text: I18n.tr("Direction Source", "bar shadow direction source")
|
|
||||||
description: I18n.tr("Choose how this bar resolves shadow direction")
|
|
||||||
settingKey: "barShadowDirectionSource"
|
|
||||||
options: [I18n.tr("Inherit Global (Default)", "bar shadow direction source option"), I18n.tr("Auto (Bar-aware)", "bar shadow direction source option"), I18n.tr("Manual", "bar shadow direction source option")]
|
|
||||||
currentValue: {
|
|
||||||
switch (shadowCard.directionSource) {
|
|
||||||
case "autoBar":
|
|
||||||
return I18n.tr("Auto (Bar-aware)", "bar shadow direction source option");
|
|
||||||
case "manual":
|
|
||||||
return I18n.tr("Manual", "bar shadow direction source option");
|
|
||||||
default:
|
|
||||||
return I18n.tr("Inherit Global (Default)", "bar shadow direction source option");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onValueChanged: value => {
|
|
||||||
if (value === I18n.tr("Auto (Bar-aware)", "bar shadow direction source option")) {
|
|
||||||
SettingsData.updateBarConfig(selectedBarId, {
|
|
||||||
shadowDirectionMode: "autoBar"
|
|
||||||
});
|
|
||||||
} else if (value === I18n.tr("Manual", "bar shadow direction source option")) {
|
|
||||||
SettingsData.updateBarConfig(selectedBarId, {
|
|
||||||
shadowDirectionMode: "manual"
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
SettingsData.updateBarConfig(selectedBarId, {
|
|
||||||
shadowDirectionMode: "inherit"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SettingsDropdownRow {
|
|
||||||
visible: shadowCard.shadowActive && shadowCard.directionSource === "manual"
|
|
||||||
text: I18n.tr("Manual Direction", "bar manual shadow direction")
|
|
||||||
description: I18n.tr("Use a fixed shadow direction for this bar")
|
|
||||||
settingKey: "barShadowDirectionManual"
|
|
||||||
options: [I18n.tr("Top", "shadow direction option"), I18n.tr("Top Left", "shadow direction option"), I18n.tr("Top Right", "shadow direction option"), I18n.tr("Bottom", "shadow direction option")]
|
|
||||||
currentValue: {
|
|
||||||
switch (selectedBarConfig?.shadowDirection) {
|
|
||||||
case "topLeft":
|
|
||||||
return I18n.tr("Top Left", "shadow direction option");
|
|
||||||
case "topRight":
|
|
||||||
return I18n.tr("Top Right", "shadow direction option");
|
|
||||||
case "bottom":
|
|
||||||
return I18n.tr("Bottom", "shadow direction option");
|
|
||||||
default:
|
|
||||||
return I18n.tr("Top", "shadow direction option");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onValueChanged: value => {
|
|
||||||
if (value === I18n.tr("Top Left", "shadow direction option")) {
|
|
||||||
SettingsData.updateBarConfig(selectedBarId, {
|
|
||||||
shadowDirection: "topLeft"
|
|
||||||
});
|
|
||||||
} else if (value === I18n.tr("Top Right", "shadow direction option")) {
|
|
||||||
SettingsData.updateBarConfig(selectedBarId, {
|
|
||||||
shadowDirection: "topRight"
|
|
||||||
});
|
|
||||||
} else if (value === I18n.tr("Bottom", "shadow direction option")) {
|
|
||||||
SettingsData.updateBarConfig(selectedBarId, {
|
|
||||||
shadowDirection: "bottom"
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
SettingsData.updateBarConfig(selectedBarId, {
|
|
||||||
shadowDirection: "top"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
visible: shadowCard.shadowActive
|
visible: shadowCard.shadowActive
|
||||||
width: parent.width
|
width: parent.width
|
||||||
@@ -1208,10 +1106,10 @@ Item {
|
|||||||
buttonPadding: parent.width < 420 ? Theme.spacingXS : Theme.spacingS
|
buttonPadding: parent.width < 420 ? Theme.spacingXS : Theme.spacingS
|
||||||
minButtonWidth: parent.width < 420 ? 36 : 56
|
minButtonWidth: parent.width < 420 ? 36 : 56
|
||||||
textSize: parent.width < 420 ? Theme.fontSizeSmall : Theme.fontSizeMedium
|
textSize: parent.width < 420 ? Theme.fontSizeSmall : Theme.fontSizeMedium
|
||||||
model: [I18n.tr("Default (Black)"), I18n.tr("Surface", "shadow color option"), I18n.tr("Primary"), I18n.tr("Secondary"), I18n.tr("Custom")]
|
model: [I18n.tr("Text", "shadow color option"), I18n.tr("Surface", "shadow color option"), I18n.tr("Primary"), I18n.tr("Secondary"), I18n.tr("Custom")]
|
||||||
selectionMode: "single"
|
selectionMode: "single"
|
||||||
currentIndex: {
|
currentIndex: {
|
||||||
switch (selectedBarConfig?.shadowColorMode || "default") {
|
switch (selectedBarConfig?.shadowColorMode || "text") {
|
||||||
case "surface":
|
case "surface":
|
||||||
return 1;
|
return 1;
|
||||||
case "primary":
|
case "primary":
|
||||||
@@ -1227,7 +1125,7 @@ Item {
|
|||||||
onSelectionChanged: (index, selected) => {
|
onSelectionChanged: (index, selected) => {
|
||||||
if (!selected)
|
if (!selected)
|
||||||
return;
|
return;
|
||||||
let mode = "default";
|
let mode = "text";
|
||||||
switch (index) {
|
switch (index) {
|
||||||
case 1:
|
case 1:
|
||||||
mode = "surface";
|
mode = "surface";
|
||||||
|
|||||||
@@ -1640,6 +1640,7 @@ Item {
|
|||||||
description: I18n.tr("Material inspired shadows and elevation on modals, popouts, and dialogs")
|
description: I18n.tr("Material inspired shadows and elevation on modals, popouts, and dialogs")
|
||||||
checked: SettingsData.m3ElevationEnabled ?? true
|
checked: SettingsData.m3ElevationEnabled ?? true
|
||||||
onToggled: checked => SettingsData.set("m3ElevationEnabled", checked)
|
onToggled: checked => SettingsData.set("m3ElevationEnabled", checked)
|
||||||
|
visible: false
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsSliderRow {
|
SettingsSliderRow {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ Singleton {
|
|||||||
id: root
|
id: root
|
||||||
|
|
||||||
readonly property string currentVersion: "1.4"
|
readonly property string currentVersion: "1.4"
|
||||||
readonly property bool changelogEnabled: false
|
readonly property bool changelogEnabled: true
|
||||||
|
|
||||||
readonly property string configDir: Paths.strip(StandardPaths.writableLocation(StandardPaths.ConfigLocation)) + "/DankMaterialShell"
|
readonly property string configDir: Paths.strip(StandardPaths.writableLocation(StandardPaths.ConfigLocation)) + "/DankMaterialShell"
|
||||||
readonly property string changelogMarkerPath: configDir + "/.changelog-" + currentVersion
|
readonly property string changelogMarkerPath: configDir + "/.changelog-" + currentVersion
|
||||||
|
|||||||
@@ -260,28 +260,6 @@ Singleton {
|
|||||||
saveMetadata()
|
saveMetadata()
|
||||||
}
|
}
|
||||||
|
|
||||||
function reorderTab(fromIndex, toIndex) {
|
|
||||||
if (fromIndex < 0 || fromIndex >= tabs.length || toIndex < 0 || toIndex >= tabs.length)
|
|
||||||
return
|
|
||||||
if (fromIndex === toIndex)
|
|
||||||
return
|
|
||||||
|
|
||||||
var newTabs = tabs.slice()
|
|
||||||
var moved = newTabs.splice(fromIndex, 1)[0]
|
|
||||||
newTabs.splice(toIndex, 0, moved)
|
|
||||||
tabs = newTabs
|
|
||||||
|
|
||||||
if (currentTabIndex === fromIndex) {
|
|
||||||
currentTabIndex = toIndex
|
|
||||||
} else if (fromIndex < currentTabIndex && toIndex >= currentTabIndex) {
|
|
||||||
currentTabIndex--
|
|
||||||
} else if (fromIndex > currentTabIndex && toIndex <= currentTabIndex) {
|
|
||||||
currentTabIndex++
|
|
||||||
}
|
|
||||||
|
|
||||||
saveMetadata()
|
|
||||||
}
|
|
||||||
|
|
||||||
function saveTabAs(tabIndex, userPath) {
|
function saveTabAs(tabIndex, userPath) {
|
||||||
if (tabIndex < 0 || tabIndex >= tabs.length) return
|
if (tabIndex < 0 || tabIndex >= tabs.length) return
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
v1.5-beta
|
v1.4.0
|
||||||
|
|||||||
Reference in New Issue
Block a user