1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-03 20:32:07 -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 {
parts := strings.SplitN(value, " ", 2)
if len(parts) != 2 {
return fmt.Sprintf(" %s { }", name)
if len(parts) == 2 {
return fmt.Sprintf(" %s { %s %s; }", name, parts[0], parts[1])
}
sizeType := parts[0]
sizeValue := parts[1]
return fmt.Sprintf(" %s { %s %s; }", name, sizeType, sizeValue)
// Bare number without type prefix — default to "fixed"
if _, err := strconv.Atoi(value); err == nil {
return fmt.Sprintf(" %s { fixed %s; }", name, value)
}
return fmt.Sprintf(" %s { }", name)
}

View File

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