~pierrec


#185 Support nested scrollables 5 days ago

Comment by ~pierrec on ~eliasnaur/gio

Adding Elias' response to a first round patch. It does clarify a few things.

My suggestion for ranges were not meant as extensions to the existing AreaOps, which already bound the InputOps in the (absolute) x,y dimensions.

Rather, the vertical and horizontal ranges bound the handlers in the (relative) scroll dimensions. For example, a vertical List will report HorizontalRange (Min:0, Max:0) because it can't be scrolled horizontally. If it is scrolled to the top, VerticalRange min will be 0, and its max the total height of the children not yet scrolled into view (or MaxInt if List doesn't know the total height).

With that information, the pointer router can precisely decide where to deliver scroll events. It can even split up a scroll event between multiple handlers if their ranges are lower than the scrolled amount.

#198 layout Rigid with cross constraint 6 days ago

Comment by ~pierrec on ~eliasnaur/gio

This is what I currently use. Not perfect esp. since it cannot work with Flex children. Any better option welcome!

// Flex wraps a layout.Flex to support cross constraint rigids.
type Flex struct {
	layout.Flex
	cross int
}

func (f *Flex) Rigid(w layout.Widget) layout.FlexChild {
	return layout.Rigid(func(gtx layout.Context) layout.Dimensions {
		dims := w(gtx)
		f.cross = max(f.cross, f.Flex.Axis.Convert(dims.Size).Y)
		return dims
	})
}

// RigidCross returns a Rigid which cross axis constraint is set to the
// largest one from other non RigidCross.
func (f *Flex) RigidCross(w layout.Widget) layout.FlexChild {
	// Use a Flexed so that they are run after Rigids have been evaluated.
	return layout.Flexed(1, func(gtx layout.Context) layout.Dimensions {
		if f.Flex.Axis == layout.Horizontal {
			gtx.Constraints.Max.Y = f.cross
		} else {
			gtx.Constraints.Max.X = f.cross
		}
		return w(gtx)
	})
}

#198 layout Rigid with cross constraint 7 days ago

Ticket created by ~pierrec on ~eliasnaur/gio

I have run into a case where I need to display Flex items with a separator running between them. The separator cross size should match the longest cross size of all Rigids. Although doable with the existing FlexChilds, would it make sense to introduce a new RigidCross which would have its cross constraint set by all Rigids and Flexes and be displayed last?

#185 Support nested scrollables 12 days ago

Comment by ~pierrec on ~eliasnaur/gio

How would the scroll ranges be determined? Currently, using the InputOp area seems fine.

What happens when overlapping widgets need to process scroll events but according to some state?

i.e. a list of editors where you want to scroll the text if the editor is in focus and scroll the list otherwise

#196 widget.Editor and scrolling 12 days ago

Ticket created by ~pierrec on ~eliasnaur/gio

While working on an app displaying editors with a list, I found that the list cannot be scrolled as the editors gobble up the scroll events. Wouldnt it make sense for Editors to only listen for scroll events if they are in focus?

#81 Table and file opener widgets 2 months ago

Comment by ~pierrec on ~eliasnaur/gio

I have sketched a file opener for an app I am working on. It is opiniated and needs work but will revisit it soon and share it.

#181 gesture.Scroll: horizontal scrolling not working 3 months ago

Ticket created by ~pierrec on ~eliasnaur/gio

A vertically displayed list can be scrolled with touch gestures, but when displayed horizontally, it does not work on at least the following platforms: Windows and Linux. It does work on MacOS.

#40 wayland: wl_display_connect failed - Cannot get this to run! 3 months ago

Comment by ~pierrec on ~eliasnaur/gio

I have seen that doc and was confused as well when testing on Ubuntu. I have since rebooted/logged off, and the issue has vanished: the WAYLAND_DISPLAY file is now properly created in the XDG_RUNTIME_DIR as expected.

#40 wayland: wl_display_connect failed - Cannot get this to run! 3 months ago

Comment by ~pierrec on ~eliasnaur/gio

I am seeing the same issue, and it has to do with the wayland display file name not being set in gio (app/internal/window/os_wayland.go:L1486).

Hacking it for now to move forward with:

dpyName := filepath.Join(
		os.Getenv("XDG_RUNTIME_DIR"),
		"..", //TODO only valid on ubuntu (skip the snap dir)?
		os.Getenv("WAYLAND_DISPLAY"),
	)
	cdpyName := C.CString(dpyName)
	defer C.free(unsafe.Pointer(cdpyName))
	d.disp, err = C.wl_display_connect(cdpyName)

#101 gesture: add support for double click 10 months ago

Ticket created by ~pierrec on ~eliasnaur/gio

Hello,

To help with some work I have started, I would need double click to be supported, ideally natively to avoid reinventing the wheel. I have a small patch to gesture/gesture.go that provides that.

Would you consider it?

Thanks for this fantastic work!