refactor(browser): migrate stacked_panes.go to gotk4 API
Replace all direct widget method calls with webkit helper functions: - Replace container.SetHExpand/SetVExpand() with webkit.WidgetSetHExpand/SetVExpand() - Replace container.Realize() with webkit.WidgetRealize() - Replace container.SetVisible() with webkit.WidgetSetVisible() - Replace container.Parent() with webkit.WidgetGetParent() - Replace container.Unparent() with webkit.WidgetUnparent() - Replace widget.Show/GrabFocus() with webkit.WidgetShow/WidgetGrabFocus() - Replace widget.QueueAllocate() with webkit.WidgetQueueAllocate() - Replace widget.AddCSSClass() with webkit.WidgetAddCSSClass() Fix type comparisons: - Change titleBar != 0 to titleBar != nil (gtk.Widgetter is interface) All 33 compilation errors in stacked_panes.go now resolved. Only deprecation hints remain (non-blocking).
- commit
- 4643f94f6d7e1619b336cc41359804c6d56266da
- author
- bamen · · 2025-10-08 19:23 UTC
- committer
- bamen · · 2025-10-08 17:00 UTC
- parent
- ca280a9
- signature
- unsigned
1 file · +35 -35
M internal/app/browser/stacked_panes.go +35 -35
| @@ -88,9 +88,9 @@ func (spm *StackedPaneManager) prepareNewStackedPane() (*paneNode, error) { | |||
| 88 | 88 | if newContainer == nil { | |
| 89 | 89 | return nil, errors.New("new pane missing container") | |
| 90 | 90 | } | |
| 91 | - | newContainer.SetHExpand(true) | |
| 92 | - | newContainer.SetVExpand(true) | |
| 93 | - | newContainer.Realize() | |
| 91 | + | webkit.WidgetSetHExpand(newContainer, true) | |
| 92 | + | webkit.WidgetSetVExpand(newContainer, true) | |
| 93 | + | webkit.WidgetRealize(newContainer) | |
| 94 | 94 | ||
| 95 | 95 | // Create the new leaf node | |
| 96 | 96 | newLeaf := &paneNode{ | |
| @@ -105,9 +105,9 @@ func (spm *StackedPaneManager) prepareNewStackedPane() (*paneNode, error) { | |||
| 105 | 105 | spm.wm.setTitleBar(newLeaf, newTitleBar) | |
| 106 | 106 | ||
| 107 | 107 | // Keep new container hidden initially - will be shown after transition | |
| 108 | - | newContainer.SetVisible(false) | |
| 108 | + | webkit.WidgetSetVisible(newContainer, false) | |
| 109 | 109 | if newTitleBar != nil { | |
| 110 | - | newTitleBar.SetVisible(false) | |
| 110 | + | webkit.WidgetSetVisible(newTitleBar, false) | |
| 111 | 111 | } | |
| 112 | 112 | ||
| 113 | 113 | return newLeaf, nil | |
| @@ -145,8 +145,8 @@ func (spm *StackedPaneManager) addPaneToExistingStack(target, newLeaf *paneNode) | |||
| 145 | 145 | ||
| 146 | 146 | // Unparent the new container before adding it to the stack (only if it has a parent) | |
| 147 | 147 | if newLeaf.container != nil { | |
| 148 | - | if newLeaf.container.Parent() != nil { | |
| 149 | - | newLeaf.container.Unparent() | |
| 148 | + | if webkit.WidgetGetParent(newLeaf.container) != nil { | |
| 149 | + | webkit.WidgetUnparent(newLeaf.container) | |
| 150 | 150 | } | |
| 151 | 151 | } | |
| 152 | 152 | ||
| @@ -223,7 +223,7 @@ func (spm *StackedPaneManager) convertToStackedContainer(target, newLeaf *paneNo | |||
| 223 | 223 | ||
| 224 | 224 | // Keep existing container visible during transition to prevent rendering glitch | |
| 225 | 225 | if titleBar != nil { | |
| 226 | - | titleBar.SetVisible(false) | |
| 226 | + | webkit.WidgetSetVisible(titleBar, false) | |
| 227 | 227 | } | |
| 228 | 228 | ||
| 229 | 229 | // Detach existing container from its current parent first | |
| @@ -283,12 +283,12 @@ func (spm *StackedPaneManager) convertToStackedContainer(target, newLeaf *paneNo | |||
| 283 | 283 | // Unparent the new container before adding it to the stack | |
| 284 | 284 | // This is critical: even freshly created WebViews might have internal parent refs | |
| 285 | 285 | if newLeaf.container != nil { | |
| 286 | - | parentWidget := newLeaf.container.Parent() | |
| 286 | + | parentWidget := webkit.WidgetGetParent(newLeaf.container) | |
| 287 | 287 | if parentWidget != nil { | |
| 288 | 288 | log.Printf("[workspace] unparenting new pane container %p from parent %p before stack append", newLeaf.container, parentWidget) | |
| 289 | - | newLeaf.container.Unparent() | |
| 289 | + | webkit.WidgetUnparent(newLeaf.container) | |
| 290 | 290 | // Verify unparent succeeded | |
| 291 | - | if finalParent := newLeaf.container.Parent(); finalParent != nil { | |
| 291 | + | if finalParent := webkit.WidgetGetParent(newLeaf.container); finalParent != nil { | |
| 292 | 292 | log.Printf("[workspace] WARNING: container %p still has parent %p after unparent", newLeaf.container, finalParent) | |
| 293 | 293 | } | |
| 294 | 294 | } | |
| @@ -314,8 +314,8 @@ func (spm *StackedPaneManager) detachFromParent(target *paneNode, parent *paneNo | |||
| 314 | 314 | } | |
| 315 | 315 | // Unparent if it has a GTK parent | |
| 316 | 316 | if target.container != nil { | |
| 317 | - | if target.container.Parent() != nil { | |
| 318 | - | target.container.Unparent() | |
| 317 | + | if webkit.WidgetGetParent(target.container) != nil { | |
| 318 | + | webkit.WidgetUnparent(target.container) | |
| 319 | 319 | } | |
| 320 | 320 | } | |
| 321 | 321 | } else if paned, ok := parent.container.(*gtk.Paned); ok && paned != nil { | |
| @@ -360,7 +360,7 @@ func (spm *StackedPaneManager) finalizeStackCreation(stackNode, newLeaf *paneNod | |||
| 360 | 360 | currentActiveIndex := stackNode.activeStackIndex | |
| 361 | 361 | if currentActiveIndex >= 0 && currentActiveIndex < len(stackNode.stackedPanes) && currentActiveIndex != insertIndex { | |
| 362 | 362 | currentlyActivePane := stackNode.stackedPanes[currentActiveIndex] | |
| 363 | - | if currentlyActivePane.pane != nil && currentlyActivePane.pane.webView != nil && currentlyActivePane.titleBar != 0 { | |
| 363 | + | if currentlyActivePane.pane != nil && currentlyActivePane.pane.webView != nil && currentlyActivePane.titleBar != nil { | |
| 364 | 364 | currentTitle := currentlyActivePane.pane.webView.GetTitle() | |
| 365 | 365 | if currentTitle != "" { | |
| 366 | 366 | spm.updateTitleBarLabel(currentlyActivePane, currentTitle) | |
| @@ -414,19 +414,19 @@ func (spm *StackedPaneManager) UpdateStackVisibility(stackNode *paneNode) { | |||
| 414 | 414 | if i == activeIndex { | |
| 415 | 415 | // Active pane: show container, NEVER show title bar | |
| 416 | 416 | if pane.container != nil { | |
| 417 | - | pane.container.SetVisible(true) | |
| 417 | + | webkit.WidgetSetVisible(pane.container, true) | |
| 418 | 418 | } | |
| 419 | 419 | if pane.titleBar != nil { | |
| 420 | - | pane.titleBar.SetVisible(false) // ABSOLUTE RULE: never visible for active pane | |
| 420 | + | webkit.WidgetSetVisible(pane.titleBar, false) // ABSOLUTE RULE: never visible for active pane | |
| 421 | 421 | } | |
| 422 | 422 | log.Printf("[workspace] active pane %d: container=visible, titleBar=HIDDEN", i) | |
| 423 | 423 | } else { | |
| 424 | 424 | // Inactive panes: hide container, show title bar | |
| 425 | 425 | if pane.container != nil { | |
| 426 | - | pane.container.SetVisible(false) | |
| 426 | + | webkit.WidgetSetVisible(pane.container, false) | |
| 427 | 427 | } | |
| 428 | 428 | if pane.titleBar != nil { | |
| 429 | - | pane.titleBar.SetVisible(true) | |
| 429 | + | webkit.WidgetSetVisible(pane.titleBar, true) | |
| 430 | 430 | ||
| 431 | 431 | // Refresh title bar to pick up any newly downloaded favicons | |
| 432 | 432 | if pane.pane != nil && pane.pane.webView != nil { | |
| @@ -498,7 +498,7 @@ func (spm *StackedPaneManager) NavigateStack(direction string) bool { | |||
| 498 | 498 | // Update title bar for the pane transitioning from ACTIVE to INACTIVE | |
| 499 | 499 | // This ensures the collapsed pane shows its current page title (Zellij-style layout) | |
| 500 | 500 | currentActivePane := stackNode.stackedPanes[currentIndex] | |
| 501 | - | if currentActivePane.pane != nil && currentActivePane.pane.webView != nil && currentActivePane.titleBar != 0 { | |
| 501 | + | if currentActivePane.pane != nil && currentActivePane.pane.webView != nil && currentActivePane.titleBar != nil { | |
| 502 | 502 | currentTitle := currentActivePane.pane.webView.GetTitle() | |
| 503 | 503 | if currentTitle != "" { | |
| 504 | 504 | spm.updateTitleBarLabel(currentActivePane, currentTitle) | |
| @@ -630,7 +630,7 @@ func (spm *StackedPaneManager) updateTitleBarLabel(node *paneNode, title string) | |||
| 630 | 630 | ||
| 631 | 631 | // Remove old title bar | |
| 632 | 632 | if node.titleBar != nil { | |
| 633 | - | node.titleBar.Unparent() | |
| 633 | + | webkit.WidgetUnparent(node.titleBar) | |
| 634 | 634 | } | |
| 635 | 635 | ||
| 636 | 636 | // Update the node's title bar reference | |
| @@ -705,7 +705,7 @@ func (spm *StackedPaneManager) createTitleBarWithTitle(title string, pageURL str | |||
| 705 | 705 | if img, ok := faviconImg.(*gtk.Image); ok { | |
| 706 | 706 | img.SetPixelSize(16) | |
| 707 | 707 | } | |
| 708 | - | faviconImg.AddCSSClass("stacked-pane-favicon") | |
| 708 | + | webkit.WidgetAddCSSClass(faviconImg, "stacked-pane-favicon") | |
| 709 | 709 | log.Printf("[favicon] Successfully created favicon image widget") | |
| 710 | 710 | } else { | |
| 711 | 711 | debugReason = "image widget creation failed" | |
| @@ -724,7 +724,7 @@ func (spm *StackedPaneManager) createTitleBarWithTitle(title string, pageURL str | |||
| 724 | 724 | // Add favicon or placeholder | |
| 725 | 725 | if faviconImg != nil { | |
| 726 | 726 | titleBox.Append(faviconImg) | |
| 727 | - | faviconImg.Show() | |
| 727 | + | webkit.WidgetShow(faviconImg) | |
| 728 | 728 | } else { | |
| 729 | 729 | // DEBUG: Add visible placeholder label to show code is running | |
| 730 | 730 | placeholderLabel := gtk.NewLabel(faviconPlaceholder) | |
| @@ -808,8 +808,8 @@ func (spm *StackedPaneManager) CloseStackedPane(node *paneNode) error { | |||
| 808 | 808 | if parent == nil { | |
| 809 | 809 | // Stack was the root of the workspace — closing this pane exits the app. | |
| 810 | 810 | if stackNode.container != nil { | |
| 811 | - | if stackNode.container.Parent() != nil { | |
| 812 | - | stackNode.container.Unparent() | |
| 811 | + | if webkit.WidgetGetParent(stackNode.container) != nil { | |
| 812 | + | webkit.WidgetUnparent(stackNode.container) | |
| 813 | 813 | } | |
| 814 | 814 | } | |
| 815 | 815 | if spm.wm.window != nil { | |
| @@ -826,11 +826,11 @@ func (spm *StackedPaneManager) CloseStackedPane(node *paneNode) error { | |||
| 826 | 826 | } else if parent.right == stackNode { | |
| 827 | 827 | paned.SetEndChild(nil) | |
| 828 | 828 | } | |
| 829 | - | paned.QueueAllocate() | |
| 829 | + | webkit.WidgetQueueAllocate(paned) | |
| 830 | 830 | } | |
| 831 | 831 | if stackNode.container != nil { | |
| 832 | - | if stackNode.container.Parent() != nil { | |
| 833 | - | stackNode.container.Unparent() | |
| 832 | + | if webkit.WidgetGetParent(stackNode.container) != nil { | |
| 833 | + | webkit.WidgetUnparent(stackNode.container) | |
| 834 | 834 | } | |
| 835 | 835 | } | |
| 836 | 836 | ||
| @@ -870,8 +870,8 @@ func (spm *StackedPaneManager) CloseStackedPane(node *paneNode) error { | |||
| 870 | 870 | box.Remove(lastPaneContainer) | |
| 871 | 871 | } | |
| 872 | 872 | if stackNode.container != nil { | |
| 873 | - | if stackNode.container.Parent() != nil { | |
| 874 | - | stackNode.container.Unparent() | |
| 873 | + | if webkit.WidgetGetParent(stackNode.container) != nil { | |
| 874 | + | webkit.WidgetUnparent(stackNode.container) | |
| 875 | 875 | } | |
| 876 | 876 | } | |
| 877 | 877 | ||
| @@ -880,8 +880,8 @@ func (spm *StackedPaneManager) CloseStackedPane(node *paneNode) error { | |||
| 880 | 880 | lastPane.parent = nil | |
| 881 | 881 | if spm.wm.window != nil && lastPaneContainer != nil { | |
| 882 | 882 | spm.wm.window.SetChild(lastPaneContainer) | |
| 883 | - | lastPaneContainer.QueueAllocate() | |
| 884 | - | lastPaneContainer.Show() | |
| 883 | + | webkit.WidgetQueueAllocate(lastPaneContainer) | |
| 884 | + | webkit.WidgetShow(lastPaneContainer) | |
| 885 | 885 | } | |
| 886 | 886 | } else { | |
| 887 | 887 | if parent.left == stackNode { | |
| @@ -896,10 +896,10 @@ func (spm *StackedPaneManager) CloseStackedPane(node *paneNode) error { | |||
| 896 | 896 | } else { | |
| 897 | 897 | paned.SetEndChild(lastPaneContainer) | |
| 898 | 898 | } | |
| 899 | - | paned.QueueAllocate() | |
| 899 | + | webkit.WidgetQueueAllocate(paned) | |
| 900 | 900 | } | |
| 901 | 901 | if lastPaneContainer != nil { | |
| 902 | - | lastPaneContainer.SetVisible(true) | |
| 902 | + | webkit.WidgetSetVisible(lastPaneContainer, true) | |
| 903 | 903 | } | |
| 904 | 904 | } | |
| 905 | 905 | ||
| @@ -913,8 +913,8 @@ func (spm *StackedPaneManager) CloseStackedPane(node *paneNode) error { | |||
| 913 | 913 | ||
| 914 | 914 | spm.wm.SetActivePane(lastPane, SourceClose) | |
| 915 | 915 | if lastPaneWidget := lastPane.pane.webView.Widget(); lastPaneWidget != nil { | |
| 916 | - | lastPaneWidget.Show() | |
| 917 | - | lastPaneWidget.GrabFocus() | |
| 916 | + | webkit.WidgetShow(lastPaneWidget) | |
| 917 | + | webkit.WidgetGrabFocus(lastPaneWidget) | |
| 918 | 918 | } | |
| 919 | 919 | ||
| 920 | 920 | stackNode.parent = nil | |
| @@ -88,9 +88,9 @@ func (spm *StackedPaneManager) prepareNewStackedPane() (*paneNode, error) { | |||||
| 88 | if newContainer == nil { | 88 | if newContainer == nil { | ||
| 89 | return nil, errors.New("new pane missing container") | 89 | return nil, errors.New("new pane missing container") | ||
| 90 | } | 90 | } | ||
| 91 | - | newContainer.SetHExpand(true) | 91 | + | webkit.WidgetSetHExpand(newContainer, true) |
| 92 | - | newContainer.SetVExpand(true) | 92 | + | webkit.WidgetSetVExpand(newContainer, true) |
| 93 | - | newContainer.Realize() | 93 | + | webkit.WidgetRealize(newContainer) |
| 94 | 94 | ||||
| 95 | // Create the new leaf node | 95 | // Create the new leaf node | ||
| 96 | newLeaf := &paneNode{ | 96 | newLeaf := &paneNode{ | ||
| @@ -105,9 +105,9 @@ func (spm *StackedPaneManager) prepareNewStackedPane() (*paneNode, error) { | |||||
| 105 | spm.wm.setTitleBar(newLeaf, newTitleBar) | 105 | spm.wm.setTitleBar(newLeaf, newTitleBar) | ||
| 106 | 106 | ||||
| 107 | // Keep new container hidden initially - will be shown after transition | 107 | // Keep new container hidden initially - will be shown after transition | ||
| 108 | - | newContainer.SetVisible(false) | 108 | + | webkit.WidgetSetVisible(newContainer, false) |
| 109 | if newTitleBar != nil { | 109 | if newTitleBar != nil { | ||
| 110 | - | newTitleBar.SetVisible(false) | 110 | + | webkit.WidgetSetVisible(newTitleBar, false) |
| 111 | } | 111 | } | ||
| 112 | 112 | ||||
| 113 | return newLeaf, nil | 113 | return newLeaf, nil | ||
| @@ -145,8 +145,8 @@ func (spm *StackedPaneManager) addPaneToExistingStack(target, newLeaf *paneNode) | |||||
| 145 | 145 | ||||
| 146 | // Unparent the new container before adding it to the stack (only if it has a parent) | 146 | // Unparent the new container before adding it to the stack (only if it has a parent) | ||
| 147 | if newLeaf.container != nil { | 147 | if newLeaf.container != nil { | ||
| 148 | - | if newLeaf.container.Parent() != nil { | 148 | + | if webkit.WidgetGetParent(newLeaf.container) != nil { |
| 149 | - | newLeaf.container.Unparent() | 149 | + | webkit.WidgetUnparent(newLeaf.container) |
| 150 | } | 150 | } | ||
| 151 | } | 151 | } | ||
| 152 | 152 | ||||
| @@ -223,7 +223,7 @@ func (spm *StackedPaneManager) convertToStackedContainer(target, newLeaf *paneNo | |||||
| 223 | 223 | ||||
| 224 | // Keep existing container visible during transition to prevent rendering glitch | 224 | // Keep existing container visible during transition to prevent rendering glitch | ||
| 225 | if titleBar != nil { | 225 | if titleBar != nil { | ||
| 226 | - | titleBar.SetVisible(false) | 226 | + | webkit.WidgetSetVisible(titleBar, false) |
| 227 | } | 227 | } | ||
| 228 | 228 | ||||
| 229 | // Detach existing container from its current parent first | 229 | // Detach existing container from its current parent first | ||
| @@ -283,12 +283,12 @@ func (spm *StackedPaneManager) convertToStackedContainer(target, newLeaf *paneNo | |||||
| 283 | // Unparent the new container before adding it to the stack | 283 | // Unparent the new container before adding it to the stack | ||
| 284 | // This is critical: even freshly created WebViews might have internal parent refs | 284 | // This is critical: even freshly created WebViews might have internal parent refs | ||
| 285 | if newLeaf.container != nil { | 285 | if newLeaf.container != nil { | ||
| 286 | - | parentWidget := newLeaf.container.Parent() | 286 | + | parentWidget := webkit.WidgetGetParent(newLeaf.container) |
| 287 | if parentWidget != nil { | 287 | if parentWidget != nil { | ||
| 288 | log.Printf("[workspace] unparenting new pane container %p from parent %p before stack append", newLeaf.container, parentWidget) | 288 | log.Printf("[workspace] unparenting new pane container %p from parent %p before stack append", newLeaf.container, parentWidget) | ||
| 289 | - | newLeaf.container.Unparent() | 289 | + | webkit.WidgetUnparent(newLeaf.container) |
| 290 | // Verify unparent succeeded | 290 | // Verify unparent succeeded | ||
| 291 | - | if finalParent := newLeaf.container.Parent(); finalParent != nil { | 291 | + | if finalParent := webkit.WidgetGetParent(newLeaf.container); finalParent != nil { |
| 292 | log.Printf("[workspace] WARNING: container %p still has parent %p after unparent", newLeaf.container, finalParent) | 292 | log.Printf("[workspace] WARNING: container %p still has parent %p after unparent", newLeaf.container, finalParent) | ||
| 293 | } | 293 | } | ||
| 294 | } | 294 | } | ||
| @@ -314,8 +314,8 @@ func (spm *StackedPaneManager) detachFromParent(target *paneNode, parent *paneNo | |||||
| 314 | } | 314 | } | ||
| 315 | // Unparent if it has a GTK parent | 315 | // Unparent if it has a GTK parent | ||
| 316 | if target.container != nil { | 316 | if target.container != nil { | ||
| 317 | - | if target.container.Parent() != nil { | 317 | + | if webkit.WidgetGetParent(target.container) != nil { |
| 318 | - | target.container.Unparent() | 318 | + | webkit.WidgetUnparent(target.container) |
| 319 | } | 319 | } | ||
| 320 | } | 320 | } | ||
| 321 | } else if paned, ok := parent.container.(*gtk.Paned); ok && paned != nil { | 321 | } else if paned, ok := parent.container.(*gtk.Paned); ok && paned != nil { | ||
| @@ -360,7 +360,7 @@ func (spm *StackedPaneManager) finalizeStackCreation(stackNode, newLeaf *paneNod | |||||
| 360 | currentActiveIndex := stackNode.activeStackIndex | 360 | currentActiveIndex := stackNode.activeStackIndex | ||
| 361 | if currentActiveIndex >= 0 && currentActiveIndex < len(stackNode.stackedPanes) && currentActiveIndex != insertIndex { | 361 | if currentActiveIndex >= 0 && currentActiveIndex < len(stackNode.stackedPanes) && currentActiveIndex != insertIndex { | ||
| 362 | currentlyActivePane := stackNode.stackedPanes[currentActiveIndex] | 362 | currentlyActivePane := stackNode.stackedPanes[currentActiveIndex] | ||
| 363 | - | if currentlyActivePane.pane != nil && currentlyActivePane.pane.webView != nil && currentlyActivePane.titleBar != 0 { | 363 | + | if currentlyActivePane.pane != nil && currentlyActivePane.pane.webView != nil && currentlyActivePane.titleBar != nil { |
| 364 | currentTitle := currentlyActivePane.pane.webView.GetTitle() | 364 | currentTitle := currentlyActivePane.pane.webView.GetTitle() | ||
| 365 | if currentTitle != "" { | 365 | if currentTitle != "" { | ||
| 366 | spm.updateTitleBarLabel(currentlyActivePane, currentTitle) | 366 | spm.updateTitleBarLabel(currentlyActivePane, currentTitle) | ||
| @@ -414,19 +414,19 @@ func (spm *StackedPaneManager) UpdateStackVisibility(stackNode *paneNode) { | |||||
| 414 | if i == activeIndex { | 414 | if i == activeIndex { | ||
| 415 | // Active pane: show container, NEVER show title bar | 415 | // Active pane: show container, NEVER show title bar | ||
| 416 | if pane.container != nil { | 416 | if pane.container != nil { | ||
| 417 | - | pane.container.SetVisible(true) | 417 | + | webkit.WidgetSetVisible(pane.container, true) |
| 418 | } | 418 | } | ||
| 419 | if pane.titleBar != nil { | 419 | if pane.titleBar != nil { | ||
| 420 | - | pane.titleBar.SetVisible(false) // ABSOLUTE RULE: never visible for active pane | 420 | + | webkit.WidgetSetVisible(pane.titleBar, false) // ABSOLUTE RULE: never visible for active pane |
| 421 | } | 421 | } | ||
| 422 | log.Printf("[workspace] active pane %d: container=visible, titleBar=HIDDEN", i) | 422 | log.Printf("[workspace] active pane %d: container=visible, titleBar=HIDDEN", i) | ||
| 423 | } else { | 423 | } else { | ||
| 424 | // Inactive panes: hide container, show title bar | 424 | // Inactive panes: hide container, show title bar | ||
| 425 | if pane.container != nil { | 425 | if pane.container != nil { | ||
| 426 | - | pane.container.SetVisible(false) | 426 | + | webkit.WidgetSetVisible(pane.container, false) |
| 427 | } | 427 | } | ||
| 428 | if pane.titleBar != nil { | 428 | if pane.titleBar != nil { | ||
| 429 | - | pane.titleBar.SetVisible(true) | 429 | + | webkit.WidgetSetVisible(pane.titleBar, true) |
| 430 | 430 | ||||
| 431 | // Refresh title bar to pick up any newly downloaded favicons | 431 | // Refresh title bar to pick up any newly downloaded favicons | ||
| 432 | if pane.pane != nil && pane.pane.webView != nil { | 432 | if pane.pane != nil && pane.pane.webView != nil { | ||
| @@ -498,7 +498,7 @@ func (spm *StackedPaneManager) NavigateStack(direction string) bool { | |||||
| 498 | // Update title bar for the pane transitioning from ACTIVE to INACTIVE | 498 | // Update title bar for the pane transitioning from ACTIVE to INACTIVE | ||
| 499 | // This ensures the collapsed pane shows its current page title (Zellij-style layout) | 499 | // This ensures the collapsed pane shows its current page title (Zellij-style layout) | ||
| 500 | currentActivePane := stackNode.stackedPanes[currentIndex] | 500 | currentActivePane := stackNode.stackedPanes[currentIndex] | ||
| 501 | - | if currentActivePane.pane != nil && currentActivePane.pane.webView != nil && currentActivePane.titleBar != 0 { | 501 | + | if currentActivePane.pane != nil && currentActivePane.pane.webView != nil && currentActivePane.titleBar != nil { |
| 502 | currentTitle := currentActivePane.pane.webView.GetTitle() | 502 | currentTitle := currentActivePane.pane.webView.GetTitle() | ||
| 503 | if currentTitle != "" { | 503 | if currentTitle != "" { | ||
| 504 | spm.updateTitleBarLabel(currentActivePane, currentTitle) | 504 | spm.updateTitleBarLabel(currentActivePane, currentTitle) | ||
| @@ -630,7 +630,7 @@ func (spm *StackedPaneManager) updateTitleBarLabel(node *paneNode, title string) | |||||
| 630 | 630 | ||||
| 631 | // Remove old title bar | 631 | // Remove old title bar | ||
| 632 | if node.titleBar != nil { | 632 | if node.titleBar != nil { | ||
| 633 | - | node.titleBar.Unparent() | 633 | + | webkit.WidgetUnparent(node.titleBar) |
| 634 | } | 634 | } | ||
| 635 | 635 | ||||
| 636 | // Update the node's title bar reference | 636 | // Update the node's title bar reference | ||
| @@ -705,7 +705,7 @@ func (spm *StackedPaneManager) createTitleBarWithTitle(title string, pageURL str | |||||
| 705 | if img, ok := faviconImg.(*gtk.Image); ok { | 705 | if img, ok := faviconImg.(*gtk.Image); ok { | ||
| 706 | img.SetPixelSize(16) | 706 | img.SetPixelSize(16) | ||
| 707 | } | 707 | } | ||
| 708 | - | faviconImg.AddCSSClass("stacked-pane-favicon") | 708 | + | webkit.WidgetAddCSSClass(faviconImg, "stacked-pane-favicon") |
| 709 | log.Printf("[favicon] Successfully created favicon image widget") | 709 | log.Printf("[favicon] Successfully created favicon image widget") | ||
| 710 | } else { | 710 | } else { | ||
| 711 | debugReason = "image widget creation failed" | 711 | debugReason = "image widget creation failed" | ||
| @@ -724,7 +724,7 @@ func (spm *StackedPaneManager) createTitleBarWithTitle(title string, pageURL str | |||||
| 724 | // Add favicon or placeholder | 724 | // Add favicon or placeholder | ||
| 725 | if faviconImg != nil { | 725 | if faviconImg != nil { | ||
| 726 | titleBox.Append(faviconImg) | 726 | titleBox.Append(faviconImg) | ||
| 727 | - | faviconImg.Show() | 727 | + | webkit.WidgetShow(faviconImg) |
| 728 | } else { | 728 | } else { | ||
| 729 | // DEBUG: Add visible placeholder label to show code is running | 729 | // DEBUG: Add visible placeholder label to show code is running | ||
| 730 | placeholderLabel := gtk.NewLabel(faviconPlaceholder) | 730 | placeholderLabel := gtk.NewLabel(faviconPlaceholder) | ||
| @@ -808,8 +808,8 @@ func (spm *StackedPaneManager) CloseStackedPane(node *paneNode) error { | |||||
| 808 | if parent == nil { | 808 | if parent == nil { | ||
| 809 | // Stack was the root of the workspace — closing this pane exits the app. | 809 | // Stack was the root of the workspace — closing this pane exits the app. | ||
| 810 | if stackNode.container != nil { | 810 | if stackNode.container != nil { | ||
| 811 | - | if stackNode.container.Parent() != nil { | 811 | + | if webkit.WidgetGetParent(stackNode.container) != nil { |
| 812 | - | stackNode.container.Unparent() | 812 | + | webkit.WidgetUnparent(stackNode.container) |
| 813 | } | 813 | } | ||
| 814 | } | 814 | } | ||
| 815 | if spm.wm.window != nil { | 815 | if spm.wm.window != nil { | ||
| @@ -826,11 +826,11 @@ func (spm *StackedPaneManager) CloseStackedPane(node *paneNode) error { | |||||
| 826 | } else if parent.right == stackNode { | 826 | } else if parent.right == stackNode { | ||
| 827 | paned.SetEndChild(nil) | 827 | paned.SetEndChild(nil) | ||
| 828 | } | 828 | } | ||
| 829 | - | paned.QueueAllocate() | 829 | + | webkit.WidgetQueueAllocate(paned) |
| 830 | } | 830 | } | ||
| 831 | if stackNode.container != nil { | 831 | if stackNode.container != nil { | ||
| 832 | - | if stackNode.container.Parent() != nil { | 832 | + | if webkit.WidgetGetParent(stackNode.container) != nil { |
| 833 | - | stackNode.container.Unparent() | 833 | + | webkit.WidgetUnparent(stackNode.container) |
| 834 | } | 834 | } | ||
| 835 | } | 835 | } | ||
| 836 | 836 | ||||
| @@ -870,8 +870,8 @@ func (spm *StackedPaneManager) CloseStackedPane(node *paneNode) error { | |||||
| 870 | box.Remove(lastPaneContainer) | 870 | box.Remove(lastPaneContainer) | ||
| 871 | } | 871 | } | ||
| 872 | if stackNode.container != nil { | 872 | if stackNode.container != nil { | ||
| 873 | - | if stackNode.container.Parent() != nil { | 873 | + | if webkit.WidgetGetParent(stackNode.container) != nil { |
| 874 | - | stackNode.container.Unparent() | 874 | + | webkit.WidgetUnparent(stackNode.container) |
| 875 | } | 875 | } | ||
| 876 | } | 876 | } | ||
| 877 | 877 | ||||
| @@ -880,8 +880,8 @@ func (spm *StackedPaneManager) CloseStackedPane(node *paneNode) error { | |||||
| 880 | lastPane.parent = nil | 880 | lastPane.parent = nil | ||
| 881 | if spm.wm.window != nil && lastPaneContainer != nil { | 881 | if spm.wm.window != nil && lastPaneContainer != nil { | ||
| 882 | spm.wm.window.SetChild(lastPaneContainer) | 882 | spm.wm.window.SetChild(lastPaneContainer) | ||
| 883 | - | lastPaneContainer.QueueAllocate() | 883 | + | webkit.WidgetQueueAllocate(lastPaneContainer) |
| 884 | - | lastPaneContainer.Show() | 884 | + | webkit.WidgetShow(lastPaneContainer) |
| 885 | } | 885 | } | ||
| 886 | } else { | 886 | } else { | ||
| 887 | if parent.left == stackNode { | 887 | if parent.left == stackNode { | ||
| @@ -896,10 +896,10 @@ func (spm *StackedPaneManager) CloseStackedPane(node *paneNode) error { | |||||
| 896 | } else { | 896 | } else { | ||
| 897 | paned.SetEndChild(lastPaneContainer) | 897 | paned.SetEndChild(lastPaneContainer) | ||
| 898 | } | 898 | } | ||
| 899 | - | paned.QueueAllocate() | 899 | + | webkit.WidgetQueueAllocate(paned) |
| 900 | } | 900 | } | ||
| 901 | if lastPaneContainer != nil { | 901 | if lastPaneContainer != nil { | ||
| 902 | - | lastPaneContainer.SetVisible(true) | 902 | + | webkit.WidgetSetVisible(lastPaneContainer, true) |
| 903 | } | 903 | } | ||
| 904 | } | 904 | } | ||
| 905 | 905 | ||||
| @@ -913,8 +913,8 @@ func (spm *StackedPaneManager) CloseStackedPane(node *paneNode) error { | |||||
| 913 | 913 | ||||
| 914 | spm.wm.SetActivePane(lastPane, SourceClose) | 914 | spm.wm.SetActivePane(lastPane, SourceClose) | ||
| 915 | if lastPaneWidget := lastPane.pane.webView.Widget(); lastPaneWidget != nil { | 915 | if lastPaneWidget := lastPane.pane.webView.Widget(); lastPaneWidget != nil { | ||
| 916 | - | lastPaneWidget.Show() | 916 | + | webkit.WidgetShow(lastPaneWidget) |
| 917 | - | lastPaneWidget.GrabFocus() | 917 | + | webkit.WidgetGrabFocus(lastPaneWidget) |
| 918 | } | 918 | } | ||
| 919 | 919 | ||||
| 920 | stackNode.parent = nil | 920 | stackNode.parent = nil | ||