1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-05 21:15:38 -05:00

make show on overview top bar independent

This commit is contained in:
bbedward
2025-09-08 19:52:27 -04:00
parent e2945a6a2a
commit 47b6b365a1
3 changed files with 74 additions and 66 deletions

View File

@@ -89,7 +89,7 @@ Singleton {
property real cornerRadius: 12
property bool notificationOverlayEnabled: false
property bool topBarAutoHide: false
property bool topBarOpenOnOverview: false
property bool topBarOpenOnOverview: true
property bool topBarVisible: true
property real topBarSpacing: 4
property real topBarBottomGap: 0
@@ -253,7 +253,7 @@ Singleton {
cornerRadius = settings.cornerRadius !== undefined ? settings.cornerRadius : 12
notificationOverlayEnabled = settings.notificationOverlayEnabled !== undefined ? settings.notificationOverlayEnabled : false
topBarAutoHide = settings.topBarAutoHide !== undefined ? settings.topBarAutoHide : false
topBarOpenOnOverview = settings.topBarOpenOnOverview !== undefined ? settings.topBarOpenOnOverview : false
topBarOpenOnOverview = settings.topBarOpenOnOverview !== undefined ? settings.topBarOpenOnOverview : true
topBarVisible = settings.topBarVisible !== undefined ? settings.topBarVisible : true
notificationTimeoutLow = settings.notificationTimeoutLow !== undefined ? settings.notificationTimeoutLow : 5000
notificationTimeoutNormal = settings.notificationTimeoutNormal !== undefined ? settings.notificationTimeoutNormal : 5000

View File

@@ -578,71 +578,12 @@ Item {
}
}
Row {
Rectangle {
width: parent.width
spacing: Theme.spacingM
visible: SettingsData.topBarAutoHide && CompositorService.isNiri
DankIcon {
name: "fullscreen"
size: Theme.iconSize
color: Theme.primary
anchors.verticalCenter: parent.verticalCenter
}
Column {
width: parent.width - Theme.iconSize - Theme.spacingM
- overviewToggle.width - Theme.spacingM
spacing: Theme.spacingXS
anchors.verticalCenter: parent.verticalCenter
StyledText {
text: "Open on Overview"
font.pixelSize: Theme.fontSizeLarge
font.weight: Font.Medium
color: Theme.surfaceText
}
StyledText {
text: "Always show the top bar when niri's overview is open"
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
wrapMode: Text.WordWrap
width: parent.width
}
}
DankToggle {
id: overviewToggle
anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.topBarOpenOnOverview
onToggled: toggled => {
return SettingsData.setTopBarOpenOnOverview(
toggled)
}
}
height: 1
color: Theme.outline
opacity: 0.2
}
}
}
// Manual Visibility Toggle
StyledRect {
width: parent.width
height: topBarVisibilitySection.implicitHeight + Theme.spacingL * 2
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
Column {
id: topBarVisibilitySection
anchors.fill: parent
anchors.margins: Theme.spacingL
spacing: Theme.spacingM
Row {
width: parent.width
@@ -688,9 +629,64 @@ Item {
}
}
}
Rectangle {
width: parent.width
height: 1
color: Theme.outline
opacity: 0.2
visible: CompositorService.isNiri
}
Row {
width: parent.width
spacing: Theme.spacingM
visible: CompositorService.isNiri
DankIcon {
name: "fullscreen"
size: Theme.iconSize
color: Theme.primary
anchors.verticalCenter: parent.verticalCenter
}
Column {
width: parent.width - Theme.iconSize - Theme.spacingM
- overviewToggle.width - Theme.spacingM
spacing: Theme.spacingXS
anchors.verticalCenter: parent.verticalCenter
StyledText {
text: "Show on Overview"
font.pixelSize: Theme.fontSizeLarge
font.weight: Font.Medium
color: Theme.surfaceText
}
StyledText {
text: "Always show the top bar when niri's overview is open"
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
wrapMode: Text.WordWrap
width: parent.width
}
}
DankToggle {
id: overviewToggle
anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.topBarOpenOnOverview
onToggled: toggled => {
return SettingsData.setTopBarOpenOnOverview(
toggled)
}
}
}
}
}
// Spacing
StyledRect {
width: parent.width

View File

@@ -139,7 +139,19 @@ PanelWindow {
property real backgroundTransparency: SettingsData.topBarTransparency
property bool autoHide: SettingsData.topBarAutoHide
property bool reveal: SettingsData.topBarVisible && (!autoHide || topBarMouseArea.containsMouse || hasActivePopout || (SettingsData.topBarOpenOnOverview && CompositorService.isNiri && NiriService.inOverview))
property bool reveal: {
// Handle Niri overview state first
if (CompositorService.isNiri && NiriService.inOverview) {
// If Show on Overview is enabled, show the bar
if (SettingsData.topBarOpenOnOverview) {
return true
}
// If Show on Overview is disabled, hide the bar
return false
}
// Normal visibility logic when not in overview
return SettingsData.topBarVisible && (!autoHide || topBarMouseArea.containsMouse || hasActivePopout)
}
property var notepadInstance: null
property bool notepadInstanceVisible: notepadInstance?.notepadVisible ?? false