mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-15 02:02:08 -04:00
about page: update for mango and sway
This commit is contained in:
@@ -9,6 +9,46 @@ Item {
|
|||||||
id: aboutTab
|
id: aboutTab
|
||||||
|
|
||||||
property bool isHyprland: CompositorService.isHyprland
|
property bool isHyprland: CompositorService.isHyprland
|
||||||
|
property bool isNiri: CompositorService.isNiri
|
||||||
|
property bool isSway: CompositorService.isSway
|
||||||
|
property bool isDwl: CompositorService.isDwl
|
||||||
|
|
||||||
|
property string compositorName: {
|
||||||
|
if (isHyprland) return "hyprland"
|
||||||
|
if (isSway) return "sway"
|
||||||
|
if (isDwl) return "mangowc"
|
||||||
|
return "niri"
|
||||||
|
}
|
||||||
|
|
||||||
|
property string compositorLogo: {
|
||||||
|
if (isHyprland) return "/assets/hyprland.svg"
|
||||||
|
if (isSway) return "/assets/sway.svg"
|
||||||
|
if (isDwl) return "/assets/mango.png"
|
||||||
|
return "/assets/niri.svg"
|
||||||
|
}
|
||||||
|
|
||||||
|
property string compositorUrl: {
|
||||||
|
if (isHyprland) return "https://hypr.land"
|
||||||
|
if (isSway) return "https://swaywm.org"
|
||||||
|
if (isDwl) return "https://github.com/DreamMaoMao/mangowc"
|
||||||
|
return "https://github.com/YaLTeR/niri"
|
||||||
|
}
|
||||||
|
|
||||||
|
property string compositorTooltip: {
|
||||||
|
if (isHyprland) return "Hyprland Website"
|
||||||
|
if (isSway) return "Sway Website"
|
||||||
|
if (isDwl) return "mangowc GitHub"
|
||||||
|
return "niri GitHub"
|
||||||
|
}
|
||||||
|
|
||||||
|
property string discordUrl: "https://discord.gg/vT8Sfjy7sx"
|
||||||
|
property string discordTooltip: "niri/dms Discord"
|
||||||
|
|
||||||
|
property string redditUrl: "https://reddit.com/r/niri"
|
||||||
|
property string redditTooltip: "r/niri Subreddit"
|
||||||
|
|
||||||
|
property bool showMatrix: isNiri && !isHyprland && !isSway && !isDwl
|
||||||
|
property bool showReddit: isNiri && !isHyprland && !isSway && !isDwl
|
||||||
|
|
||||||
DankFlickable {
|
DankFlickable {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
@@ -69,14 +109,16 @@ Item {
|
|||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
height: 24
|
height: 24
|
||||||
width: {
|
width: {
|
||||||
if (isHyprland) {
|
let baseWidth = compositorButton.width + discordButton.width + Theme.spacingM
|
||||||
return compositorButton.width + discordButton.width + Theme.spacingM + redditButton.width + Theme.spacingM
|
if (showMatrix) {
|
||||||
} else {
|
baseWidth += matrixButton.width + 4
|
||||||
return compositorButton.width + matrixButton.width + 4 + discordButton.width + Theme.spacingM + redditButton.width + Theme.spacingM
|
|
||||||
}
|
}
|
||||||
|
if (showReddit) {
|
||||||
|
baseWidth += redditButton.width + Theme.spacingM
|
||||||
|
}
|
||||||
|
return baseWidth
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compositor logo (Niri or Hyprland)
|
|
||||||
Item {
|
Item {
|
||||||
id: compositorButton
|
id: compositorButton
|
||||||
width: 24
|
width: 24
|
||||||
@@ -86,14 +128,14 @@ Item {
|
|||||||
x: 0
|
x: 0
|
||||||
|
|
||||||
property bool hovered: false
|
property bool hovered: false
|
||||||
property string tooltipText: isHyprland ? "Hyprland Website" : "niri GitHub"
|
property string tooltipText: compositorTooltip
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
source: Qt.resolvedUrl(".").toString().replace(
|
source: Qt.resolvedUrl(".").toString().replace(
|
||||||
"file://", "").replace(
|
"file://", "").replace(
|
||||||
"/Modules/Settings/",
|
"/Modules/Settings/",
|
||||||
"") + (isHyprland ? "/assets/hyprland.svg" : "/assets/niri.svg")
|
"") + compositorLogo
|
||||||
sourceSize: Qt.size(24, 24)
|
sourceSize: Qt.size(24, 24)
|
||||||
smooth: true
|
smooth: true
|
||||||
fillMode: Image.PreserveAspectFit
|
fillMode: Image.PreserveAspectFit
|
||||||
@@ -105,18 +147,16 @@ Item {
|
|||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
onEntered: parent.hovered = true
|
onEntered: parent.hovered = true
|
||||||
onExited: parent.hovered = false
|
onExited: parent.hovered = false
|
||||||
onClicked: Qt.openUrlExternally(
|
onClicked: Qt.openUrlExternally(compositorUrl)
|
||||||
isHyprland ? "https://hypr.land" : "https://github.com/YaLTeR/niri")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Matrix button (only for Niri)
|
|
||||||
Item {
|
Item {
|
||||||
id: matrixButton
|
id: matrixButton
|
||||||
width: 30
|
width: 30
|
||||||
height: 24
|
height: 24
|
||||||
x: compositorButton.x + compositorButton.width + 4
|
x: compositorButton.x + compositorButton.width + 4
|
||||||
visible: !isHyprland
|
visible: showMatrix
|
||||||
|
|
||||||
property bool hovered: false
|
property bool hovered: false
|
||||||
property string tooltipText: "niri Matrix Chat"
|
property string tooltipText: "niri Matrix Chat"
|
||||||
@@ -149,16 +189,15 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Discord button
|
|
||||||
Item {
|
Item {
|
||||||
id: discordButton
|
id: discordButton
|
||||||
width: 20
|
width: 20
|
||||||
height: 20
|
height: 20
|
||||||
x: isHyprland ? compositorButton.x + compositorButton.width + Theme.spacingM : matrixButton.x + matrixButton.width + Theme.spacingM
|
x: showMatrix ? matrixButton.x + matrixButton.width + Theme.spacingM : compositorButton.x + compositorButton.width + Theme.spacingM
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
property bool hovered: false
|
property bool hovered: false
|
||||||
property string tooltipText: isHyprland ? "Hyprland Discord Server" : "niri Discord Server"
|
property string tooltipText: discordTooltip
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
@@ -177,21 +216,20 @@ Item {
|
|||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
onEntered: parent.hovered = true
|
onEntered: parent.hovered = true
|
||||||
onExited: parent.hovered = false
|
onExited: parent.hovered = false
|
||||||
onClicked: Qt.openUrlExternally(
|
onClicked: Qt.openUrlExternally(discordUrl)
|
||||||
isHyprland ? "https://discord.com/invite/hQ9XvMUjjr" : "https://discord.gg/vT8Sfjy7sx")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reddit button
|
|
||||||
Item {
|
Item {
|
||||||
id: redditButton
|
id: redditButton
|
||||||
width: 20
|
width: 20
|
||||||
height: 20
|
height: 20
|
||||||
x: discordButton.x + discordButton.width + Theme.spacingM
|
x: discordButton.x + discordButton.width + Theme.spacingM
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
visible: showReddit
|
||||||
|
|
||||||
property bool hovered: false
|
property bool hovered: false
|
||||||
property string tooltipText: isHyprland ? "r/hyprland Subreddit" : "r/niri Subreddit"
|
property string tooltipText: redditTooltip
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
@@ -210,8 +248,7 @@ Item {
|
|||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
onEntered: parent.hovered = true
|
onEntered: parent.hovered = true
|
||||||
onExited: parent.hovered = false
|
onExited: parent.hovered = false
|
||||||
onClicked: Qt.openUrlExternally(
|
onClicked: Qt.openUrlExternally(redditUrl)
|
||||||
isHyprland ? "https://reddit.com/r/hyprland" : "https://reddit.com/r/niri")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -507,7 +544,7 @@ Item {
|
|||||||
if (compositorButton.hovered) return compositorButton
|
if (compositorButton.hovered) return compositorButton
|
||||||
if (matrixButton.visible && matrixButton.hovered) return matrixButton
|
if (matrixButton.visible && matrixButton.hovered) return matrixButton
|
||||||
if (discordButton.hovered) return discordButton
|
if (discordButton.hovered) return discordButton
|
||||||
if (redditButton.hovered) return redditButton
|
if (redditButton.visible && redditButton.hovered) return redditButton
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user