~eliasnaur/gio-patches

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
2 2

[PATCH gio] layout: reorder fields in Inset to match system.Insets

Details
Message ID
<164301415920.12200.14795136758992607034-0@git.sr.ht>
DKIM signature
missing
Download raw message
Patch: +5 -4
From: Pierre Curto <pierre.curto@gmail.com>

This makes it simple to convert from one into the other.

Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
---
 app/os_android.go | 2 +-
 app/os_ios.go     | 2 +-
 app/os_js.go      | 3 ++-
 layout/layout.go  | 2 +-
 4 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/app/os_android.go b/app/os_android.go
index ab7f1ada..f835cbdb 100644
--- a/app/os_android.go
+++ b/app/os_android.go
@@ -587,9 +587,9 @@ func Java_org_gioui_GioView_onWindowInsets(env *C.JNIEnv, class C.jclass, view C
	w := views[view]
	w.insets = system.Insets{
		Top:    unit.Px(float32(top)),
		Right:  unit.Px(float32(right)),
		Bottom: unit.Px(float32(bottom)),
		Left:   unit.Px(float32(left)),
		Right:  unit.Px(float32(right)),
	}
	if w.stage >= system.StageRunning {
		w.draw(env, true)
diff --git a/app/os_ios.go b/app/os_ios.go
index df45fde9..3e8c3ba1 100644
--- a/app/os_ios.go
+++ b/app/os_ios.go
@@ -157,9 +157,9 @@ func (w *window) draw(sync bool) {
			},
			Insets: system.Insets{
				Top:    unit.Px(float32(params.top)),
				Right:  unit.Px(float32(params.right)),
				Bottom: unit.Px(float32(params.bottom)),
				Left:   unit.Px(float32(params.left)),
				Right:  unit.Px(float32(params.right)),
			},
			Metric: unit.Metric{
				PxPerDp: float32(params.dpi) * inchPrDp,
diff --git a/app/os_js.go b/app/os_js.go
index 55ec2694..23e49a99 100644
--- a/app/os_js.go
+++ b/app/os_js.go
@@ -609,7 +609,8 @@ func (w *window) draw(sync bool) {
}

func (w *window) getConfig() (image.Point, system.Insets, unit.Metric) {
	return image.Pt(w.config.Size.X, w.config.Size.Y), system.Insets{
	return image.Pt(w.config.Size.X, w.config.Size.Y),
		system.Insets{
			Bottom: unit.Px(w.inset.Y),
			Right:  unit.Px(w.inset.X),
		}, unit.Metric{
diff --git a/layout/layout.go b/layout/layout.go
index 2318c222..37876d16 100644
--- a/layout/layout.go
+++ b/layout/layout.go
@@ -113,7 +113,7 @@ func (c Constraints) Constrain(size image.Point) image.Point {
// constraints. The minimum constraints will be adjusted to ensure
// they do not exceed the maximum.
type Inset struct {
	Top, Right, Bottom, Left unit.Value
	Top, Bottom, Left, Right unit.Value
}

// Layout a widget.
-- 
2.32.0

[gio/patches] build failed

builds.sr.ht <builds@sr.ht>
Details
Message ID
<CHDSCUX69D2T.QR3KX9UAVJTP@cirno>
In-Reply-To
<164301415920.12200.14795136758992607034-0@git.sr.ht> (view parent)
DKIM signature
missing
Download raw message
gio/patches: FAILED in 20m56s

[layout: reorder fields in Inset to match system.Insets][0] from [~pierrec][1]

[0]: https://lists.sr.ht/~eliasnaur/gio-patches/patches/28660
[1]: pierre.curto@gmail.com

✓ #679749 SUCCESS gio/patches/openbsd.yml https://builds.sr.ht/~eliasnaur/job/679749
✓ #679746 SUCCESS gio/patches/apple.yml   https://builds.sr.ht/~eliasnaur/job/679746
✗ #679747 FAILED  gio/patches/freebsd.yml https://builds.sr.ht/~eliasnaur/job/679747
✓ #679748 SUCCESS gio/patches/linux.yml   https://builds.sr.ht/~eliasnaur/job/679748
Details
Message ID
<CHEMNSVIDL7C.JFTUCZF2MXNI@themachine>
In-Reply-To
<164301415920.12200.14795136758992607034-0@git.sr.ht> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
Thanks, merged. Still think system.Inset should go, but perhaps that
introduces an import cycle?

Elias
Reply to thread Export thread (mbox)