fix(ui): resolve remaining GTK4 CSS warnings for margin-left:auto and progress sizing
- commit
- b3a3512c69ed0960817f25d0660a4d0b65fe25a1
- author
- bnema · · 2025-12-25 21:53 UTC
- parent
- 4cc9149
- signature
- GPG Unverified
2B82207D370127A0The key is unknown
2 files · +10 -5
M internal/ui/component/progress_bar.go +2 -1
| @@ -45,7 +45,8 @@ func NewProgressBar(factory layout.WidgetFactory) *ProgressBar { | |||
| 45 | 45 | ||
| 46 | 46 | // Set minimum size to prevent GTK warning about negative minimum width (-2) | |
| 47 | 47 | // The internal "progress" gizmo needs valid dimensions before realization | |
| 48 | - | progressBar.SetSizeRequest(-1, 4) | |
| 48 | + | // Using 0 for width (not -1) ensures GTK doesn't calculate negative sizes | |
| 49 | + | progressBar.SetSizeRequest(0, 4) | |
| 49 | 50 | ||
| 50 | 51 | // Don't intercept pointer events - let clicks pass through to WebView | |
| 51 | 52 | progressBar.SetCanTarget(false) | |
| @@ -45,7 +45,8 @@ func NewProgressBar(factory layout.WidgetFactory) *ProgressBar { | |||||
| 45 | 45 | ||||
| 46 | // Set minimum size to prevent GTK warning about negative minimum width (-2) | 46 | // Set minimum size to prevent GTK warning about negative minimum width (-2) | ||
| 47 | // The internal "progress" gizmo needs valid dimensions before realization | 47 | // The internal "progress" gizmo needs valid dimensions before realization | ||
| 48 | - | progressBar.SetSizeRequest(-1, 4) | 48 | + | // Using 0 for width (not -1) ensures GTK doesn't calculate negative sizes |
| 49 | + | progressBar.SetSizeRequest(0, 4) | |||
| 49 | 50 | ||||
| 50 | // Don't intercept pointer events - let clicks pass through to WebView | 51 | // Don't intercept pointer events - let clicks pass through to WebView | ||
| 51 | progressBar.SetCanTarget(false) | 52 | progressBar.SetCanTarget(false) | ||
M internal/ui/theme/css.go +8 -4
| @@ -352,7 +352,7 @@ entry.omnibox-entry > *:focus-visible { | |||
| 352 | 352 | padding: 0.125em 0.5em; | |
| 353 | 353 | font-size: 0.6875em; | |
| 354 | 354 | font-weight: 600; | |
| 355 | - | margin-left: auto; | |
| 355 | + | /* Note: margin-left: auto not supported in GTK4 CSS, use SetHalign(End) in code */ | |
| 356 | 356 | } | |
| 357 | 357 | ` | |
| 358 | 358 | } | |
| @@ -549,13 +549,17 @@ progressbar.osd { | |||
| 549 | 549 | ||
| 550 | 550 | progressbar.osd trough { | |
| 551 | 551 | min-height: 4px; | |
| 552 | - | min-width: 0px; | |
| 552 | + | min-width: 2px; | |
| 553 | + | margin: 0; | |
| 554 | + | padding: 0; | |
| 553 | 555 | background-color: alpha(var(--bg), 0.3); | |
| 554 | 556 | } | |
| 555 | 557 | ||
| 556 | 558 | progressbar.osd progress { | |
| 557 | 559 | min-height: 4px; | |
| 558 | - | min-width: 0px; | |
| 560 | + | min-width: 2px; | |
| 561 | + | margin: 0; | |
| 562 | + | padding: 0; | |
| 559 | 563 | background-color: var(--accent); | |
| 560 | 564 | } | |
| 561 | 565 | ` | |
| @@ -689,7 +693,7 @@ row:selected .session-manager-row { | |||
| 689 | 693 | .session-time { | |
| 690 | 694 | font-size: 0.75em; | |
| 691 | 695 | color: var(--muted); | |
| 692 | - | margin-left: auto; | |
| 696 | + | /* Note: margin-left: auto not supported in GTK4 CSS, use SetHalign(End) in code */ | |
| 693 | 697 | } | |
| 694 | 698 | ||
| 695 | 699 | /* Section divider for EXITED sessions */ | |
| @@ -352,7 +352,7 @@ entry.omnibox-entry > *:focus-visible { | |||||
| 352 | padding: 0.125em 0.5em; | 352 | padding: 0.125em 0.5em; | ||
| 353 | font-size: 0.6875em; | 353 | font-size: 0.6875em; | ||
| 354 | font-weight: 600; | 354 | font-weight: 600; | ||
| 355 | - | margin-left: auto; | 355 | + | /* Note: margin-left: auto not supported in GTK4 CSS, use SetHalign(End) in code */ |
| 356 | } | 356 | } | ||
| 357 | ` | 357 | ` | ||
| 358 | } | 358 | } | ||
| @@ -549,13 +549,17 @@ progressbar.osd { | |||||
| 549 | 549 | ||||
| 550 | progressbar.osd trough { | 550 | progressbar.osd trough { | ||
| 551 | min-height: 4px; | 551 | min-height: 4px; | ||
| 552 | - | min-width: 0px; | 552 | + | min-width: 2px; |
| 553 | + | margin: 0; | |||
| 554 | + | padding: 0; | |||
| 553 | background-color: alpha(var(--bg), 0.3); | 555 | background-color: alpha(var(--bg), 0.3); | ||
| 554 | } | 556 | } | ||
| 555 | 557 | ||||
| 556 | progressbar.osd progress { | 558 | progressbar.osd progress { | ||
| 557 | min-height: 4px; | 559 | min-height: 4px; | ||
| 558 | - | min-width: 0px; | 560 | + | min-width: 2px; |
| 561 | + | margin: 0; | |||
| 562 | + | padding: 0; | |||
| 559 | background-color: var(--accent); | 563 | background-color: var(--accent); | ||
| 560 | } | 564 | } | ||
| 561 | ` | 565 | ` | ||
| @@ -689,7 +693,7 @@ row:selected .session-manager-row { | |||||
| 689 | .session-time { | 693 | .session-time { | ||
| 690 | font-size: 0.75em; | 694 | font-size: 0.75em; | ||
| 691 | color: var(--muted); | 695 | color: var(--muted); | ||
| 692 | - | margin-left: auto; | 696 | + | /* Note: margin-left: auto not supported in GTK4 CSS, use SetHalign(End) in code */ |
| 693 | } | 697 | } | ||
| 694 | 698 | ||||
| 695 | /* Section divider for EXITED sessions */ | 699 | /* Section divider for EXITED sessions */ | ||