Skip to content

Commit

Permalink
feat: set button tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
jgillich committed Mar 2, 2024
1 parent 171636f commit 962140e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions internal/ui/list_header.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ func NewListHeader(ctx context.Context, b *behavior.ListBehavior, breakpoint *ad
sidebarButton.SetIconName("sidebar-show-symbolic")
sidebarButton.SetVisible(false)
sidebarButton.ConnectClicked(showSidebar)
sidebarButton.SetTooltipText("Show Sidebar")
header.PackStart(sidebarButton)
breakpoint.AddSetter(sidebarButton, "visible", true)

createButton := gtk.NewButton()
createButton.SetIconName("document-new-symbolic")
createButton.SetTooltipText("New Resource")
createButton.ConnectClicked(func() {
w, err := NewEditorWindow(ctx, b.SelectedResource.Value(), nil)
if err != nil {
Expand Down Expand Up @@ -87,10 +89,10 @@ func NewListHeader(ctx context.Context, b *behavior.ListBehavior, breakpoint *ad
}
})

button := gtk.NewMenuButton()
button.SetIconName("funnel-symbolic")
box.Append(button)

filterButton := gtk.NewMenuButton()
filterButton.SetIconName("funnel-symbolic")
filterButton.SetTooltipText("Filter")
box.Append(filterButton)
namespace := gio.NewMenu()
onChange(ctx, b.Namespaces, func(ns []*corev1.Namespace) {
namespace.RemoveAll()
Expand All @@ -101,7 +103,7 @@ func NewListHeader(ctx context.Context, b *behavior.ListBehavior, breakpoint *ad
model := gio.NewMenu()
model.AppendSection("Namespace", namespace)
popover := gtk.NewPopoverMenuFromModel(model)
button.SetPopover(popover)
filterButton.SetPopover(popover)

entry.ConnectSearchChanged(func() {
b.SearchFilter.Update(behavior.NewSearchFilter(entry.Text()))
Expand Down

0 comments on commit 962140e

Please sign in to comment.