mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-10-15 07:44:01 -04:00
island: follow island opacity in every state and drop covered widget blur
This commit is contained in:
@@ -1010,6 +1010,7 @@ Singleton {
|
||||
property int dankIslandHoverCloseDelay: 150
|
||||
property string dankIslandPalette: "default"
|
||||
property real dankIslandTransparency: 1
|
||||
property int dankIslandCornerRadius: 34
|
||||
property bool dankIslandHighContrast: false
|
||||
property bool dankIslandMediaClockVisible: true
|
||||
property bool dankIslandNotificationBadgeClearOnOpen: false
|
||||
|
||||
@@ -546,6 +546,7 @@ var SPEC = {
|
||||
dankIslandHoverCloseDelay: { def: 150 },
|
||||
dankIslandPalette: { def: "default" },
|
||||
dankIslandTransparency: { def: 1 },
|
||||
dankIslandCornerRadius: { def: 34 },
|
||||
dankIslandHighContrast: { def: false },
|
||||
dankIslandMediaClockVisible: { def: true },
|
||||
dankIslandNotificationBadgeClearOnOpen: { def: false },
|
||||
|
||||
@@ -38,14 +38,8 @@ Item {
|
||||
return Theme.surfaceContainerHigh;
|
||||
}
|
||||
readonly property bool popupStyled: root.controller.expanded
|
||||
readonly property real compactOpacity: Math.max(0, Math.min(1, SettingsData.dankIslandTransparency))
|
||||
readonly property color effectiveSurfaceColor: {
|
||||
if (root.highContrast)
|
||||
return Theme.surfaceContainerHighest;
|
||||
if (root.popupStyled)
|
||||
return Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency);
|
||||
return Theme.withAlpha(root.surfaceColor, root.compactOpacity);
|
||||
}
|
||||
readonly property real islandOpacity: Math.max(0, Math.min(1, SettingsData.dankIslandTransparency))
|
||||
readonly property color effectiveSurfaceColor: root.highContrast ? Theme.surfaceContainerHighest : Theme.withAlpha(root.surfaceColor, root.islandOpacity)
|
||||
readonly property real surfaceOpacity: root.effectiveSurfaceColor.a
|
||||
readonly property real currentSurfaceRadius: Math.max(0, motion.currentTopLeftRadius, motion.currentBottomLeftRadius)
|
||||
readonly property color notificationAccentColor: {
|
||||
|
||||
@@ -32,8 +32,10 @@ QtObject {
|
||||
property real horizontalOffset: 0
|
||||
property real outerGap: 8
|
||||
readonly property bool bottomEdge: SettingsData.dankIslandEdge === "bottom"
|
||||
readonly property real anchoredRadius: bottomEdge ? 34 : 26
|
||||
readonly property real freeRadius: bottomEdge ? 26 : 34
|
||||
readonly property real cornerRadius: Math.max(0, Math.min(64, SettingsData.dankIslandCornerRadius))
|
||||
readonly property real edgeCornerRadius: Math.round(cornerRadius * 0.75)
|
||||
readonly property real topCornerRadius: bottomEdge ? cornerRadius : edgeCornerRadius
|
||||
readonly property real bottomCornerRadius: bottomEdge ? edgeCornerRadius : cornerRadius
|
||||
property real compactHeight: 38
|
||||
property int transientTimeout: 2200
|
||||
property int notificationTimeout: 5000
|
||||
@@ -290,7 +292,7 @@ QtObject {
|
||||
readonly property real mediaCompactWidth: Math.ceil(Math.max(1, mediaContentWidth))
|
||||
|
||||
function pillTarget(width, height) {
|
||||
const radius = height / 2;
|
||||
const radius = Math.min(height / 2, root.cornerRadius);
|
||||
return {
|
||||
"width": width,
|
||||
"height": height,
|
||||
@@ -309,10 +311,10 @@ QtObject {
|
||||
"height": height,
|
||||
"offsetX": root.horizontalOffset,
|
||||
"offsetY": root.outerGap,
|
||||
"topLeftRadius": root.anchoredRadius,
|
||||
"topRightRadius": root.anchoredRadius,
|
||||
"bottomLeftRadius": root.freeRadius,
|
||||
"bottomRightRadius": root.freeRadius
|
||||
"topLeftRadius": root.topCornerRadius,
|
||||
"topRightRadius": root.topCornerRadius,
|
||||
"bottomLeftRadius": root.bottomCornerRadius,
|
||||
"bottomRightRadius": root.bottomCornerRadius
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -72,6 +72,7 @@ Item {
|
||||
}
|
||||
readonly property color chromeColor: Theme.withAlpha(root.chromeBase, root.chromeOpacity)
|
||||
readonly property bool chromeTranslucent: root.backgroundEnabled && root.chromeOpacity > 0 && root.chromeOpacity < 1
|
||||
readonly property bool chromeCoversWidgets: root.backgroundEnabled && root.chromeOpacity > 0
|
||||
readonly property real islandOpacity: root.islandSurface?.surfaceOpacity ?? 1
|
||||
readonly property bool islandTranslucent: root.islandOpacity > 0 && root.islandOpacity < 1
|
||||
readonly property bool tracksIsland: !root.edgeAligned && root.visible
|
||||
@@ -190,7 +191,7 @@ Item {
|
||||
}
|
||||
if (!BlurService.enabled)
|
||||
return;
|
||||
const widgets = root._blurWidgetItems.filter(w => w && w.visible && w.width > 0 && w.height > 0);
|
||||
const widgets = root.chromeCoversWidgets ? [] : root._blurWidgetItems.filter(w => w && w.visible && w.width > 0 && w.height > 0);
|
||||
const chromes = [leftChrome, rightChrome].filter(c => root.chromeTranslucent && c.visible);
|
||||
if (chromes.length === 0 && widgets.length === 0 && !root.islandTranslucent)
|
||||
return;
|
||||
@@ -233,6 +234,7 @@ Item {
|
||||
}
|
||||
|
||||
onChromeTranslucentChanged: blurRebuildTimer.restart()
|
||||
onChromeCoversWidgetsChanged: blurRebuildTimer.restart()
|
||||
onEdgeAlignedChanged: {
|
||||
blurRebuildTimer.restart();
|
||||
blurTrailTimer.restart();
|
||||
|
||||
@@ -301,6 +301,19 @@ Item {
|
||||
onSliderValueChanged: value => SettingsData.set("dankIslandTransparency", value / 100)
|
||||
}
|
||||
|
||||
SettingsSliderRow {
|
||||
settingKey: "dankIslandCornerRadius"
|
||||
tags: ["island", "appearance", "corner", "radius", "rounding", "pill", "expanded"]
|
||||
text: I18n.tr("Corner Radius", "island settings: island corner radius slider")
|
||||
unit: "px"
|
||||
minimum: 0
|
||||
maximum: 64
|
||||
step: 1
|
||||
defaultValue: 34
|
||||
value: SettingsData.dankIslandCornerRadius
|
||||
onSliderValueChanged: value => SettingsData.set("dankIslandCornerRadius", value)
|
||||
}
|
||||
|
||||
SettingsToggleRow {
|
||||
settingKey: "dankIslandHighContrast"
|
||||
tags: ["island", "appearance", "contrast", "accessibility", "outline"]
|
||||
@@ -402,7 +415,7 @@ Item {
|
||||
SettingsSliderRow {
|
||||
settingKey: "dankIslandSatelliteSwoopRadius"
|
||||
tags: ["island", "satellite", "goth", "corners", "radius", "sweep", "size"]
|
||||
text: I18n.tr("Corner Radius", "island settings: satellite goth corner radius slider")
|
||||
text: I18n.tr("Goth Corner Radius", "island settings: satellite goth corner radius slider")
|
||||
unit: "px"
|
||||
minimum: 4
|
||||
maximum: 64
|
||||
|
||||
@@ -12501,21 +12501,21 @@
|
||||
"conditionKey": "islandEnabled"
|
||||
},
|
||||
{
|
||||
"section": "dankIslandSatelliteSwoopRadius",
|
||||
"section": "dankIslandCornerRadius",
|
||||
"label": "Corner Radius",
|
||||
"tabIndex": 46,
|
||||
"category": "Island",
|
||||
"keywords": [
|
||||
"appearance",
|
||||
"corner",
|
||||
"corners",
|
||||
"goth",
|
||||
"expanded",
|
||||
"island",
|
||||
"pill",
|
||||
"radius",
|
||||
"round",
|
||||
"rounded",
|
||||
"satellite",
|
||||
"size",
|
||||
"sweep"
|
||||
"rounding"
|
||||
],
|
||||
"conditionKey": "islandEnabled"
|
||||
},
|
||||
@@ -12638,6 +12638,25 @@
|
||||
"description": "Floats above windows and other content",
|
||||
"conditionKey": "islandEnabled"
|
||||
},
|
||||
{
|
||||
"section": "dankIslandSatelliteSwoopRadius",
|
||||
"label": "Goth Corner Radius",
|
||||
"tabIndex": 46,
|
||||
"category": "Island",
|
||||
"keywords": [
|
||||
"corner",
|
||||
"corners",
|
||||
"goth",
|
||||
"island",
|
||||
"radius",
|
||||
"round",
|
||||
"rounded",
|
||||
"satellite",
|
||||
"size",
|
||||
"sweep"
|
||||
],
|
||||
"conditionKey": "islandEnabled"
|
||||
},
|
||||
{
|
||||
"section": "dankIslandSatelliteGothCorners",
|
||||
"label": "Goth Corners",
|
||||
|
||||
Reference in New Issue
Block a user