mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 09:55:40 +00:00
apps/gophers: delete unused fields and arguments
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -145,7 +145,7 @@ func newApp(w *app.Window) *App {
|
|||||||
fetch := func(u string) {
|
fetch := func(u string) {
|
||||||
a.fetchCommits(a.ctx, u)
|
a.fetchCommits(a.ctx, u)
|
||||||
}
|
}
|
||||||
a.ui = newUI(w.Invalidate, fetch)
|
a.ui = newUI(fetch)
|
||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,9 +17,8 @@ type queue struct{}
|
|||||||
type config struct{}
|
type config struct{}
|
||||||
|
|
||||||
func BenchmarkUI(b *testing.B) {
|
func BenchmarkUI(b *testing.B) {
|
||||||
invalidate := func() {}
|
|
||||||
fetch := func(_ string) {}
|
fetch := func(_ string) {}
|
||||||
u := newUI(invalidate, fetch)
|
u := newUI(fetch)
|
||||||
ops := new(ui.Ops)
|
ops := new(ui.Ops)
|
||||||
q := new(queue)
|
q := new(queue)
|
||||||
c := new(config)
|
c := new(config)
|
||||||
|
|||||||
+2
-6
@@ -24,11 +24,11 @@ import (
|
|||||||
"gioui.org/ui/key"
|
"gioui.org/ui/key"
|
||||||
"gioui.org/ui/layout"
|
"gioui.org/ui/layout"
|
||||||
"gioui.org/ui/measure"
|
"gioui.org/ui/measure"
|
||||||
|
"gioui.org/ui/paint"
|
||||||
"gioui.org/ui/pointer"
|
"gioui.org/ui/pointer"
|
||||||
"gioui.org/ui/system"
|
"gioui.org/ui/system"
|
||||||
"gioui.org/ui/text"
|
"gioui.org/ui/text"
|
||||||
"gioui.org/ui/widget"
|
"gioui.org/ui/widget"
|
||||||
"gioui.org/ui/paint"
|
|
||||||
"golang.org/x/exp/shiny/iconvg"
|
"golang.org/x/exp/shiny/iconvg"
|
||||||
|
|
||||||
"github.com/google/go-github/v24/github"
|
"github.com/google/go-github/v24/github"
|
||||||
@@ -49,7 +49,6 @@ type UI struct {
|
|||||||
userClicks []gesture.Click
|
userClicks []gesture.Click
|
||||||
selectedUser *userPage
|
selectedUser *userPage
|
||||||
edit, edit2 *text.Editor
|
edit, edit2 *text.Editor
|
||||||
invalidate func()
|
|
||||||
fetchCommits func(u string)
|
fetchCommits func(u string)
|
||||||
|
|
||||||
// Profiling.
|
// Profiling.
|
||||||
@@ -61,7 +60,6 @@ type UI struct {
|
|||||||
type userPage struct {
|
type userPage struct {
|
||||||
config ui.Config
|
config ui.Config
|
||||||
faces measure.Faces
|
faces measure.Faces
|
||||||
invalidate func()
|
|
||||||
user *user
|
user *user
|
||||||
commitsList *layout.List
|
commitsList *layout.List
|
||||||
commits []*github.Commit
|
commits []*github.Commit
|
||||||
@@ -124,9 +122,8 @@ func init() {
|
|||||||
theme.white = colorMaterial(&ops, rgb(0xffffff))
|
theme.white = colorMaterial(&ops, rgb(0xffffff))
|
||||||
}
|
}
|
||||||
|
|
||||||
func newUI(invalidate func(), fetchCommits func(string)) *UI {
|
func newUI(fetchCommits func(string)) *UI {
|
||||||
u := &UI{
|
u := &UI{
|
||||||
invalidate: invalidate,
|
|
||||||
fetchCommits: fetchCommits,
|
fetchCommits: fetchCommits,
|
||||||
}
|
}
|
||||||
u.usersList = &layout.List{
|
u.usersList = &layout.List{
|
||||||
@@ -223,7 +220,6 @@ func (u *UI) Layout(c ui.Config, q input.Queue, ops *ui.Ops, cs layout.Constrain
|
|||||||
func (u *UI) newUserPage(user *user) *userPage {
|
func (u *UI) newUserPage(user *user) *userPage {
|
||||||
up := &userPage{
|
up := &userPage{
|
||||||
faces: u.faces,
|
faces: u.faces,
|
||||||
invalidate: u.invalidate,
|
|
||||||
user: user,
|
user: user,
|
||||||
commitsList: &layout.List{Axis: layout.Vertical},
|
commitsList: &layout.List{Axis: layout.Vertical},
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user