1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-11 16:22:09 -04:00

window rules: default to fixed for width/height

part of #1774
This commit is contained in:
bbedward
2026-02-20 13:51:03 -05:00
parent babc8feb2b
commit b2bee699e0
2 changed files with 9 additions and 7 deletions

View File

@@ -864,10 +864,12 @@ func (p *NiriWritableProvider) formatRule(rule windowrules.WindowRule) string {
func formatSizeProperty(name, value string) string { func formatSizeProperty(name, value string) string {
parts := strings.SplitN(value, " ", 2) parts := strings.SplitN(value, " ", 2)
if len(parts) != 2 { if len(parts) == 2 {
return fmt.Sprintf(" %s { }", name) return fmt.Sprintf(" %s { %s %s; }", name, parts[0], parts[1])
} }
sizeType := parts[0] // Bare number without type prefix — default to "fixed"
sizeValue := parts[1] if _, err := strconv.Atoi(value); err == nil {
return fmt.Sprintf(" %s { %s %s; }", name, sizeType, sizeValue) return fmt.Sprintf(" %s { fixed %s; }", name, value)
}
return fmt.Sprintf(" %s { }", name)
} }

View File

@@ -631,7 +631,7 @@ FloatingWindow {
anchors.fill: parent anchors.fill: parent
font.pixelSize: Theme.fontSizeSmall font.pixelSize: Theme.fontSizeSmall
textColor: Theme.surfaceText textColor: Theme.surfaceText
placeholderText: "fixed 800" placeholderText: "800"
backgroundColor: "transparent" backgroundColor: "transparent"
enabled: root.visible enabled: root.visible
} }
@@ -658,7 +658,7 @@ FloatingWindow {
anchors.fill: parent anchors.fill: parent
font.pixelSize: Theme.fontSizeSmall font.pixelSize: Theme.fontSizeSmall
textColor: Theme.surfaceText textColor: Theme.surfaceText
placeholderText: "fixed 600" placeholderText: "600"
backgroundColor: "transparent" backgroundColor: "transparent"
enabled: root.visible enabled: root.visible
} }