mirror of
https://github.com/diamondburned/cchat-gtk.git
synced 2024-12-24 13:16:50 +00:00
28 lines
436 B
Go
28 lines
436 B
Go
|
package loading
|
||
|
|
||
|
import (
|
||
|
"github.com/diamondburned/cchat-gtk/internal/ui/primitives"
|
||
|
"github.com/gotk3/gotk3/gtk"
|
||
|
)
|
||
|
|
||
|
type Button struct {
|
||
|
gtk.Button
|
||
|
Spinner gtk.Spinner
|
||
|
}
|
||
|
|
||
|
func NewButton() *Button {
|
||
|
s, _ := gtk.SpinnerNew()
|
||
|
s.SetHAlign(gtk.ALIGN_CENTER)
|
||
|
s.Start()
|
||
|
s.Show()
|
||
|
|
||
|
b, _ := gtk.ButtonNew()
|
||
|
b.Add(s)
|
||
|
b.SetSensitive(false) // unclickable
|
||
|
b.Show()
|
||
|
|
||
|
primitives.AddClass(b, "loading-button")
|
||
|
|
||
|
return &Button{*b, *s}
|
||
|
}
|