mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 23:55:39 +00:00
example,cmd: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -13,7 +13,6 @@ import (
|
||||
"image/png"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"math"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
@@ -35,10 +34,6 @@ import (
|
||||
var screenshot = flag.String("screenshot", "", "save a screenshot to a file and exit")
|
||||
var disable = flag.Bool("disable", false, "disable all widgets")
|
||||
|
||||
type scaledConfig struct {
|
||||
Scale float32
|
||||
}
|
||||
|
||||
type iconAndTextButton struct {
|
||||
theme *material.Theme
|
||||
button *widget.Clickable
|
||||
@@ -87,8 +82,11 @@ func saveScreenshot(f string) error {
|
||||
return err
|
||||
}
|
||||
gtx := layout.Context{
|
||||
Ops: new(op.Ops),
|
||||
Config: &scaledConfig{scale},
|
||||
Ops: new(op.Ops),
|
||||
Metric: unit.Metric{
|
||||
PxPerDp: scale,
|
||||
PxPerSp: scale,
|
||||
},
|
||||
Constraints: layout.Exact(sz),
|
||||
Queue: new(router.Router),
|
||||
}
|
||||
@@ -304,14 +302,6 @@ func kitchen(gtx layout.Context, th *material.Theme) layout.Dimensions {
|
||||
})
|
||||
}
|
||||
|
||||
func (s *scaledConfig) Px(v unit.Value) int {
|
||||
scale := s.Scale
|
||||
if v.U == unit.UnitPx {
|
||||
scale = 1
|
||||
}
|
||||
return int(math.Round(float64(scale * v.V)))
|
||||
}
|
||||
|
||||
const longText = `1. I learned from my grandfather, Verus, to use good manners, and to
|
||||
put restraint on anger. 2. In the famous memory of my father I had a
|
||||
pattern of modesty and manliness. 3. Of my mother I learned to be
|
||||
|
||||
Reference in New Issue
Block a user