mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 15:45:38 +00:00
cmd: update to latest gioui.org/ui version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@ module gioui.org/apps
|
||||
go 1.12
|
||||
|
||||
require (
|
||||
gioui.org/ui v0.0.0-20190621151416-0b6dd4efd95e
|
||||
gioui.org/ui v0.0.0-20190622153657-4f94f1078a1e
|
||||
github.com/google/go-github/v24 v24.0.1
|
||||
golang.org/x/exp v0.0.0-20190321205749-f0864edee7f3
|
||||
golang.org/x/image v0.0.0-20190321063152-3fc05d484e9f
|
||||
|
||||
+17
-20
@@ -98,14 +98,12 @@ type icon struct {
|
||||
type redrawer func()
|
||||
|
||||
type ActionButton struct {
|
||||
config *ui.Config
|
||||
inputs input.Events
|
||||
face text.Face
|
||||
Open bool
|
||||
icons []*icon
|
||||
sendIco *icon
|
||||
btnClicker *gesture.Click
|
||||
btnsClicker *gesture.Click
|
||||
config *ui.Config
|
||||
inputs input.Events
|
||||
face text.Face
|
||||
Open bool
|
||||
icons []*icon
|
||||
sendIco *icon
|
||||
}
|
||||
|
||||
var (
|
||||
@@ -254,13 +252,11 @@ func newApp(w *app.Window) *App {
|
||||
Axis: layout.Vertical,
|
||||
}
|
||||
a.fab = &ActionButton{
|
||||
config: &a.cfg,
|
||||
inputs: a.inputs,
|
||||
face: a.face(fonts.regular, 9),
|
||||
sendIco: &icon{src: icons.ContentSend, size: ui.Dp(24)},
|
||||
icons: []*icon{},
|
||||
btnClicker: new(gesture.Click),
|
||||
btnsClicker: new(gesture.Click),
|
||||
config: &a.cfg,
|
||||
inputs: a.inputs,
|
||||
face: a.face(fonts.regular, 9),
|
||||
sendIco: &icon{src: icons.ContentSend, size: ui.Dp(24)},
|
||||
icons: []*icon{},
|
||||
}
|
||||
a.edit2 = &text.Editor{
|
||||
Config: &a.cfg,
|
||||
@@ -539,8 +535,6 @@ func (a *App) layoutUsers(ops *ui.Ops, cs layout.Constraints) layout.Dimens {
|
||||
}
|
||||
|
||||
func (a *ActionButton) Layout(ops *ui.Ops, cs layout.Constraints) layout.Dimens {
|
||||
a.btnsClicker.Update(a.inputs)
|
||||
a.btnClicker.Update(a.inputs)
|
||||
c := a.config
|
||||
fabCol := brandColor
|
||||
f := layout.Flex{Axis: layout.Vertical, MainAxisAlignment: layout.Start, CrossAxisAlignment: layout.End, MainAxisSize: layout.Min}
|
||||
@@ -550,7 +544,6 @@ func (a *ActionButton) Layout(ops *ui.Ops, cs layout.Constraints) layout.Dimens
|
||||
cs = in.Begin(ops, cs)
|
||||
dims := fab(ops, cs, a.sendIco.image(c), fabCol, c.Dp(56))
|
||||
pointer.AreaEllipse(dims.Size).Add(ops)
|
||||
a.btnClicker.Add(ops)
|
||||
dims = in.End(dims)
|
||||
return f.Layout(f.End(dims))
|
||||
}
|
||||
@@ -576,8 +569,12 @@ func (a *App) layoutContributors(ops *ui.Ops, cs layout.Constraints) layout.Dime
|
||||
func (a *App) user(ops *ui.Ops, cs layout.Constraints, c *ui.Config, index int) layout.Dimens {
|
||||
u := a.users[index]
|
||||
click := &a.userClicks[index]
|
||||
for _, r := range click.Update(a.inputs) {
|
||||
if r.Type == gesture.TypeClick {
|
||||
for {
|
||||
e, ok := click.Next(a.inputs)
|
||||
if !ok {
|
||||
break
|
||||
}
|
||||
if e.Type == gesture.TypeClick {
|
||||
a.selectedUser = a.newUserPage(u)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user