~inkeliz


#119 gogio doesn't work anymore 3 months ago

Comment by ~inkeliz on ~eliasnaur/gio

It's works. :D I don't understand go module too much, but there's no way to force use the lastest gio version? Instead of need to manually change everytime. :S

#119 gogio doesn't work anymore 3 months ago

Ticket created by ~inkeliz on ~eliasnaur/gio

When I run run gioui.org/cmd/gogio it returns:

go: gioui.org/cmd@v0.0.0-20200521183411-67382bec3949 requires
        gioui.org@v0.0.0-20200521085341-2118fed8b4b0: invalid version: unknown revision 2118fed8b4b0

There's any change or way to update it?

#115 Support for Min/Max Width/Height 4 months ago

Ticket created by ~inkeliz on ~eliasnaur/gio

Currently, it's possible to set the width/height using app.NewWindow() with app.Size().

As an feature request, I wish to suggesting adding:

  • app.MinSize()
  • app.MaxSize()

It prevents the window to be smaller then the MinSize(), or larger then the MaxSize(). For Windows seems that it can use the WM_GETMINMAXINFO at windowProc(). I didn't tried it yet. If I make it works, I post here.

#112 Don't including jar files 4 months ago

Ticket created by ~inkeliz on ~eliasnaur/gio

I think that is issue is for Windows only, however there's an problem on androidbuild.go (https://git.sr.ht/~eliasnaur/gio/tree/master/cmd/gogio/androidbuild.go#L126), which don't find jar files.

It's using path.Dir(p.GoFiles[0]) instead of filepath.Dir(p.GoFiles[0]). Using the path.Dir() returns empty, which makes impossible to include jars. Replacing it for filepath fixes the problem. (:

I don't know how I can publish an PR, but it's an easy fix. :)

#110 How set an "Z-Index" using lists? 4 months ago

Comment by ~inkeliz on ~eliasnaur/gio

Sorry for use the wrong place for question, ~eliasnaur. But thank you for quick reply. (:

#109 Support gradient/drop-shadow 4 months ago

Comment by ~inkeliz on ~eliasnaur/gio

Thank you, ~eliasnaur. I'll take an look on the code to see if I can re-use that. (:

#110 How set an "Z-Index" using lists? 4 months ago

Ticket created by ~inkeliz on ~eliasnaur/gio

Looking all examples, which uses lists, the list can be just one single element. How can two (or more) elements in the "same space"?

I think about an alternative to fix https://todo.sr.ht/~eliasnaur/gio/109, which is not good, but works. That solution is to create one transparent-image with the shadows, then put it on top of the element (and another content above the shadow).

Maybe can be done using the constraints and dimensions but how? How I can create an element and others elements on top of that? It's possible to single set an "position" which you want the content to be? Relative of some parent element.

#109 Support gradient/drop-shadow 4 months ago

Ticket created by ~inkeliz on ~eliasnaur/gio

Currently all buttons and elements have an solid color, would be nice if we have gradient colors. Also, support for shadows (like CSS equivalent of box-shadow: 0px 8px 14px 2px rgba(0,0,0,0.19);).

There's any plans to support that or any alternative to do that currently?

#108 Scroll doesn't work on list 4 months ago

Comment by ~inkeliz on ~eliasnaur/gio

The issue is because of the new layout.List{} each frame, which makes impossible to track the scroll. It's fixed if we set the list outside:

func init() {
    for i := 1; i <= 100; i++ {
        tabs.tabs = append(tabs.tabs,
            Tab{Title: fmt.Sprintf("Tab %d", i)},
        )
    }
    tabs.list = layout.List{
		Axis:        layout.Vertical,
		ScrollToEnd: false,
    }
}

That is the reason why Tabs have the list on it, instead of creating an new one everytime.

REPORTED RESOLVED NOT_OUR_BUG

#108 Scroll doesn't work on list 4 months ago

Ticket created by ~inkeliz on ~eliasnaur/gio

I'm playing arround the examples, it's seems very complicated to do basic stuff, at least far I'm testing it. But, the main issue: I can't scroll one list, by inlcuding the list:

package main

import (
	"fmt"
	"gioui.org/unit"
	"log"

	"gioui.org/app"
	"gioui.org/io/system"
	"gioui.org/layout"
	"gioui.org/widget"
	"gioui.org/widget/material"

	"gioui.org/font/gofont"
)

func main() {
	go func() {
		w := app.NewWindow()
		if err := loop(w); err != nil {
			log.Fatal(err)
		}
	}()
	app.Main()
}

func loop(w *app.Window) error {
	gofont.Register()
	th := material.NewTheme()
	gtx := new(layout.Context)
	for {
		e := <-w.Events()
		switch e := e.(type) {
		case system.DestroyEvent:
			return e.Err
		case system.FrameEvent:
			gtx.Reset(e.Queue, e.Config, e.Size)
			drawTabs(gtx, th)
			e.Frame(gtx.Ops)
		}
	}
}

var tabs Tabs

type Tabs struct {
	list     layout.List
	tabs     []Tab
	selected int
}

type Tab struct {
	btn   widget.Button
	Title string
}

func init() {
	for i := 1; i <= 100; i++ {
		tabs.tabs = append(tabs.tabs,
			Tab{Title: fmt.Sprintf("Tab %d", i)},
		)
	}
}

func drawTabs(gtx *layout.Context, th *material.Theme) {
	layout.Flex{Axis: layout.Vertical}.Layout(gtx,
		layout.Flexed(1, func() {
			l := layout.List{
				Axis:        layout.Vertical,
				ScrollToEnd: false,
			}
			l.Layout(gtx, len(tabs.tabs), func(tabIdx int) {
				t := &tabs.tabs[tabIdx]
				if t.btn.Clicked(gtx) {
					tabs.selected = tabIdx
				}

				layout.Flex{}.Layout(gtx,
					layout.Rigid(func() {
						tabBtn := material.Button(th, t.Title)
						tabBtn.TextSize = unit.Sp(20)
						tabBtn.Layout(gtx, &t.btn)
					}))

			})
		}),
		layout.Flexed(2, func() {
			layout.Center.Layout(gtx, func() {
				material.H1(th, fmt.Sprintf("Tab content #%d", tabs.selected)).Layout(gtx)
			})
		}),
	)
}

That is the full code, it's just an modification of the example/tabs. The behavior that I expected is similar to the overflow: scroll from CSS, which just scroll all the buttons.