-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
132 changed files
with
66,498 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,6 +63,8 @@ node_modules/** | |
!*.service | ||
!*.benc | ||
!*.png | ||
!*.ttf | ||
!*.sfd | ||
|
||
# ...even if they are in subdirectories | ||
!*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,4 @@ | ||
package main | ||
|
||
import ( | ||
"gioui.org/text" | ||
"image/color" | ||
"gioui.org/widget/material" | ||
"gioui.org/app" | ||
"gioui.org/op" | ||
"gioui.org/font/gofont" | ||
"os" | ||
"log" | ||
) | ||
|
||
func main() { | ||
go func() { | ||
w := new(app.Window) | ||
if err := loop(w); err != nil { | ||
log.Fatal(err) | ||
} | ||
os.Exit(0) | ||
}() | ||
app.Main() | ||
} | ||
|
||
func loop(w *app.Window) error { | ||
th := material.NewTheme() | ||
th.Shaper = text.NewShaper(text.WithCollection(gofont.Collection())) | ||
var ops op.Ops | ||
for { | ||
switch e := w.Event().(type) { | ||
case app.DestroyEvent: | ||
return e.Err | ||
case app.FrameEvent: | ||
gtx := app.NewContext(&ops, e) | ||
l := material.H1(th, "Hello, Gio") | ||
maroon := color.NRGBA{R: 127, G: 0, B: 0, A: 255} | ||
l.Color = maroon | ||
l.Alignment = text.Middle | ||
l.Layout(gtx) | ||
e.Frame(gtx.Ops) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package main | ||
|
||
import ( | ||
"bytes" | ||
|
||
"realy.lol/context" | ||
"realy.lol/lol" | ||
) | ||
|
||
type ( | ||
bo = bool | ||
by = []byte | ||
st = string | ||
er = error | ||
no = int | ||
cx = context.T | ||
) | ||
|
||
var ( | ||
log, chk, errorf = lol.Main.Log, lol.Main.Check, lol.Main.Errorf | ||
equals = bytes.Equal | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# gel | ||
|
||
Gio elements | ||
|
||
This is a widget toolkit based on the basic set of material widgets built with Gio. | ||
|
||
So far, the following additional widgets have been created - scrollbar for the scrolling list, a column and basic table, | ||
and a top-bar side-bar status-bar multi-page application framework, and a background process runner to minimise | ||
interruptions to the rendering of the interfaces. | ||
|
||
There is also a state-widget pool generated with the stuff in `poolgen/` that you initialize before starting the render | ||
loop that can then be used anywhere to add new clickables, bools, inputs and so on, without having to double up with a | ||
pre-specification, they allocate first run and then cache thereafter, maintaining their state. | ||
|
||
Gel uses fluent programming techniques to simplify and denoise the visual structure of Gio widget definitions. To take | ||
maximum advantage of it, make use of the fact that Go allows breaking lines after dot operators between the chained | ||
methods such that each movable section can be pulled up and moved into another position without dealing with a screenful | ||
of red underlines in your IDE caused by unpaired brackets. | ||
|
||
Future plans include creating a serialization format for events and render op queues and accompanying socket transports | ||
to enable remote display and control of user interfaces. |
Oops, something went wrong.