fix(ui): resolve GTK4 CSS warnings and progress bar sizing
- commit
- 4cc9149df8b361e88342027d9719fa7558335238
- author
- bnema · · 2025-12-25 21:49 UTC
- parent
- 69a228f
- signature
- GPG Unverified
2B82207D370127A0The key is unknown
2 files · +9 -6
M internal/ui/component/progress_bar.go +5 -2
| @@ -43,12 +43,15 @@ func NewProgressBar(factory layout.WidgetFactory) *ProgressBar { | |||
| 43 | 43 | progressBar.SetHalign(gtk.AlignFillValue) | |
| 44 | 44 | progressBar.SetHexpand(true) | |
| 45 | 45 | ||
| 46 | + | // Set minimum size to prevent GTK warning about negative minimum width (-2) | |
| 47 | + | // The internal "progress" gizmo needs valid dimensions before realization | |
| 48 | + | progressBar.SetSizeRequest(-1, 4) | |
| 49 | + | ||
| 46 | 50 | // Don't intercept pointer events - let clicks pass through to WebView | |
| 47 | 51 | progressBar.SetCanTarget(false) | |
| 48 | 52 | progressBar.SetCanFocus(false) | |
| 49 | 53 | ||
| 50 | - | // Initialize fraction to 0 to force proper sizing of internal progress gizmo | |
| 51 | - | // This prevents GTK warning about negative minimum width | |
| 54 | + | // Initialize fraction to 0 | |
| 52 | 55 | progressBar.SetFraction(0) | |
| 53 | 56 | ||
| 54 | 57 | // Hidden by default | |
| @@ -43,12 +43,15 @@ func NewProgressBar(factory layout.WidgetFactory) *ProgressBar { | |||||
| 43 | progressBar.SetHalign(gtk.AlignFillValue) | 43 | progressBar.SetHalign(gtk.AlignFillValue) | ||
| 44 | progressBar.SetHexpand(true) | 44 | progressBar.SetHexpand(true) | ||
| 45 | 45 | ||||
| 46 | + | // Set minimum size to prevent GTK warning about negative minimum width (-2) | |||
| 47 | + | // The internal "progress" gizmo needs valid dimensions before realization | |||
| 48 | + | progressBar.SetSizeRequest(-1, 4) | |||
| 49 | + | ||||
| 46 | // Don't intercept pointer events - let clicks pass through to WebView | 50 | // Don't intercept pointer events - let clicks pass through to WebView | ||
| 47 | progressBar.SetCanTarget(false) | 51 | progressBar.SetCanTarget(false) | ||
| 48 | progressBar.SetCanFocus(false) | 52 | progressBar.SetCanFocus(false) | ||
| 49 | 53 | ||||
| 50 | - | // Initialize fraction to 0 to force proper sizing of internal progress gizmo | 54 | + | // Initialize fraction to 0 |
| 51 | - | // This prevents GTK warning about negative minimum width | |||
| 52 | progressBar.SetFraction(0) | 55 | progressBar.SetFraction(0) | ||
| 53 | 56 | ||||
| 54 | // Hidden by default | 57 | // Hidden by default | ||
M internal/ui/theme/css.go +4 -4
| @@ -240,7 +240,7 @@ entry.omnibox-entry:focus-visible { | |||
| 240 | 240 | border-color: var(--accent); | |
| 241 | 241 | background-color: shade(var(--bg), 1.05); | |
| 242 | 242 | outline-style: none; | |
| 243 | - | outline-width: 0; | |
| 243 | + | outline-width: 0px; | |
| 244 | 244 | outline-color: transparent; | |
| 245 | 245 | } | |
| 246 | 246 | ||
| @@ -393,7 +393,7 @@ entry.find-bar-entry:focus-within, | |||
| 393 | 393 | entry.find-bar-entry:focus-visible { | |
| 394 | 394 | border-color: var(--accent); | |
| 395 | 395 | outline-style: none; | |
| 396 | - | outline-width: 0; | |
| 396 | + | outline-width: 0px; | |
| 397 | 397 | outline-color: transparent; | |
| 398 | 398 | } | |
| 399 | 399 | ||
| @@ -578,7 +578,7 @@ func generateSessionManagerCSS(p Palette) string { | |||
| 578 | 578 | border-radius: 0.1875em; | |
| 579 | 579 | padding: 0; | |
| 580 | 580 | min-width: 28em; | |
| 581 | - | max-width: 40em; | |
| 581 | + | /* Note: max-width not supported in GTK4 CSS, rely on container constraints */ | |
| 582 | 582 | } | |
| 583 | 583 | ||
| 584 | 584 | /* Header with title */ | |
| @@ -778,7 +778,7 @@ func generateLinkStatusCSS(p Palette) string { | |||
| 778 | 778 | padding: 0.25em 0.5em; | |
| 779 | 779 | margin: 0; | |
| 780 | 780 | font-size: 0.75em; | |
| 781 | - | max-width: 50em; | |
| 781 | + | /* Note: max-width not supported in GTK4 CSS, use label SetMaxWidthChars instead */ | |
| 782 | 782 | box-shadow: 0 -1px 4px alpha(black, 0.15); | |
| 783 | 783 | ||
| 784 | 784 | /* Fade transition - hidden by default */ | |
| @@ -240,7 +240,7 @@ entry.omnibox-entry:focus-visible { | |||||
| 240 | border-color: var(--accent); | 240 | border-color: var(--accent); | ||
| 241 | background-color: shade(var(--bg), 1.05); | 241 | background-color: shade(var(--bg), 1.05); | ||
| 242 | outline-style: none; | 242 | outline-style: none; | ||
| 243 | - | outline-width: 0; | 243 | + | outline-width: 0px; |
| 244 | outline-color: transparent; | 244 | outline-color: transparent; | ||
| 245 | } | 245 | } | ||
| 246 | 246 | ||||
| @@ -393,7 +393,7 @@ entry.find-bar-entry:focus-within, | |||||
| 393 | entry.find-bar-entry:focus-visible { | 393 | entry.find-bar-entry:focus-visible { | ||
| 394 | border-color: var(--accent); | 394 | border-color: var(--accent); | ||
| 395 | outline-style: none; | 395 | outline-style: none; | ||
| 396 | - | outline-width: 0; | 396 | + | outline-width: 0px; |
| 397 | outline-color: transparent; | 397 | outline-color: transparent; | ||
| 398 | } | 398 | } | ||
| 399 | 399 | ||||
| @@ -578,7 +578,7 @@ func generateSessionManagerCSS(p Palette) string { | |||||
| 578 | border-radius: 0.1875em; | 578 | border-radius: 0.1875em; | ||
| 579 | padding: 0; | 579 | padding: 0; | ||
| 580 | min-width: 28em; | 580 | min-width: 28em; | ||
| 581 | - | max-width: 40em; | 581 | + | /* Note: max-width not supported in GTK4 CSS, rely on container constraints */ |
| 582 | } | 582 | } | ||
| 583 | 583 | ||||
| 584 | /* Header with title */ | 584 | /* Header with title */ | ||
| @@ -778,7 +778,7 @@ func generateLinkStatusCSS(p Palette) string { | |||||
| 778 | padding: 0.25em 0.5em; | 778 | padding: 0.25em 0.5em; | ||
| 779 | margin: 0; | 779 | margin: 0; | ||
| 780 | font-size: 0.75em; | 780 | font-size: 0.75em; | ||
| 781 | - | max-width: 50em; | 781 | + | /* Note: max-width not supported in GTK4 CSS, use label SetMaxWidthChars instead */ |
| 782 | box-shadow: 0 -1px 4px alpha(black, 0.15); | 782 | box-shadow: 0 -1px 4px alpha(black, 0.15); | ||
| 783 | 783 | ||||
| 784 | /* Fade transition - hidden by default */ | 784 | /* Fade transition - hidden by default */ | ||