mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 21:42:51 -05:00
top bar manual show/hide
This commit is contained in:
@@ -554,6 +554,71 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
// 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
|
||||
spacing: Theme.spacingM
|
||||
|
||||
DankIcon {
|
||||
name: "visibility"
|
||||
size: Theme.iconSize
|
||||
color: Theme.primary
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
Column {
|
||||
width: parent.width - Theme.iconSize - Theme.spacingM
|
||||
- visibilityToggle.width - Theme.spacingM
|
||||
spacing: Theme.spacingXS
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
StyledText {
|
||||
text: "Manual Show/Hide"
|
||||
font.pixelSize: Theme.fontSizeLarge
|
||||
font.weight: Font.Medium
|
||||
color: Theme.surfaceText
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: "Toggle top bar visibility manually (can be controlled via IPC)"
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceVariantText
|
||||
wrapMode: Text.WordWrap
|
||||
width: parent.width
|
||||
}
|
||||
}
|
||||
|
||||
DankToggle {
|
||||
id: visibilityToggle
|
||||
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
checked: SettingsData.topBarVisible
|
||||
onToggled: toggled => {
|
||||
return SettingsData.setTopBarVisible(
|
||||
toggled)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Spacing
|
||||
StyledRect {
|
||||
width: parent.width
|
||||
|
||||
@@ -22,7 +22,7 @@ PanelWindow {
|
||||
property real backgroundTransparency: SettingsData.topBarTransparency
|
||||
readonly property int notificationCount: NotificationService.notifications.length
|
||||
property bool autoHide: SettingsData.topBarAutoHide
|
||||
property bool reveal: !autoHide || topBarMouseArea.containsMouse
|
||||
property bool reveal: SettingsData.topBarVisible && (!autoHide || topBarMouseArea.containsMouse)
|
||||
readonly property real effectiveBarHeight: Math.max(root.widgetHeight + SettingsData.topBarInnerPadding + 4, Theme.barHeight - 4 - (8 - SettingsData.topBarInnerPadding))
|
||||
readonly property real widgetHeight: Math.max(20, 26 + SettingsData.topBarInnerPadding * 0.6)
|
||||
|
||||
@@ -155,7 +155,7 @@ PanelWindow {
|
||||
right: true
|
||||
}
|
||||
|
||||
exclusiveZone: autoHide ? -1 : root.effectiveBarHeight + SettingsData.topBarSpacing - 2
|
||||
exclusiveZone: !SettingsData.topBarVisible || autoHide ? -1 : root.effectiveBarHeight + SettingsData.topBarSpacing - 2
|
||||
|
||||
mask: Region {
|
||||
item: topBarMouseArea
|
||||
|
||||
Reference in New Issue
Block a user