name property for category buttons

This commit is contained in:
piotr
2021-06-29 17:24:48 +02:00
parent cd6e544adc
commit f54be1c13a
3 changed files with 3 additions and 1 deletions

Binary file not shown.

View File

@@ -19,7 +19,7 @@ import (
"github.com/gotk3/gotk3/gtk" "github.com/gotk3/gotk3/gtk"
) )
const version = "0.1.2" const version = "0.1.3"
var ( var (
appDirs []string appDirs []string

View File

@@ -113,6 +113,7 @@ func setUpCategoriesButtonBox() *gtk.EventBox {
hBox, _ := gtk.BoxNew(gtk.ORIENTATION_HORIZONTAL, 0) hBox, _ := gtk.BoxNew(gtk.ORIENTATION_HORIZONTAL, 0)
eventBox.Add(hBox) eventBox.Add(hBox)
button, _ := gtk.ButtonNewWithLabel("All") button, _ := gtk.ButtonNewWithLabel("All")
button.SetProperty("name", "category-button")
button.Connect("clicked", func(item *gtk.Button) { button.Connect("clicked", func(item *gtk.Button) {
searchEntry.SetText("") searchEntry.SetText("")
appFlowBox = setUpAppsFlowBox(nil, "") appFlowBox = setUpAppsFlowBox(nil, "")
@@ -126,6 +127,7 @@ func setUpCategoriesButtonBox() *gtk.EventBox {
for _, cat := range categories { for _, cat := range categories {
if isSupposedToShowUp(cat.Name) { if isSupposedToShowUp(cat.Name) {
button, _ = gtk.ButtonNewFromIconName(cat.Icon, gtk.ICON_SIZE_MENU) button, _ = gtk.ButtonNewFromIconName(cat.Icon, gtk.ICON_SIZE_MENU)
button.SetProperty("name", "category-button")
catButtons = append(catButtons, button) catButtons = append(catButtons, button)
button.SetLabel(cat.DisplayName) button.SetLabel(cat.DisplayName)
hBox.PackStart(button, false, false, 0) hBox.PackStart(button, false, false, 0)