~eliasnaur/gio

3 2

ModalNavDrawer width not configurable

Details
Message ID
<CC51PWIOS81E.LDDDZCB0I5KJ@len>
DKIM signature
missing
Download raw message
Hi,

I'm trying out Gio to maybe build a small mobile app, currently testing
the different components to see how they work.

It seems to be impossible to change the width of a ModalNavDrawer if
using the provided API / constructors, as it is hardcoded in the
ModalSheet, which is private within the ModalNavDrawer. [0]

Is this an oversight? or rather a conscious decision?
possibly I'm also not using it as intended, I'd be glad to get some
pointers.


On an unrelated note: do you by any chance also have an IRC or XMPP
presence that could be used without having to get a Slack account? I
couldn't find any official mention of this but would love to be able to
ask short questions in a more ephemeral way ;)

Thanks,

j


[0]:
https://git.sr.ht/~whereswaldon/gio-x/tree/main/component/nav_drawer.go#L294
Details
Message ID
<CAFcc3FTE8pTdqjTmzJo8MpXe=zzFrQsXt4xgB6oJw2iFnOdM+A@mail.gmail.com>
In-Reply-To
<CC51PWIOS81E.LDDDZCB0I5KJ@len> (view parent)
DKIM signature
pass
Download raw message
Hi Jonathan,

Thanks for reaching out!

> I'm trying out Gio to maybe build a small mobile app, currently testing
> the different components to see how they work.

Excellent!

> It seems to be impossible to change the width of a ModalNavDrawer if
> using the provided API / constructors, as it is hardcoded in the
> ModalSheet, which is private within the ModalNavDrawer. [0]

This is currently true.

> Is this an oversight? or rather a conscious decision?
> possibly I'm also not using it as intended, I'd be glad to get some
> pointers.

It's mostly an oversight. I agree that it should be configurable, and
I'd welcome a patch to change that if you are so inclined. I built
that component a while ago, and I've been meaning to go back and
update it with some of the lessons I've learned about Gio design since
then. I don't expect to get to that in the next few weeks though.

> On an unrelated note: do you by any chance also have an IRC or XMPP
> presence that could be used without having to get a Slack account? I
> couldn't find any official mention of this but would love to be able to
> ask short questions in a more ephemeral way ;)

Not certain if this is addressed to me, Elias, or other community
members, but you can reach me in these ways:

- You can use my chat system, Arbor, to reach me. Connect Sprig [0]
(you can download pre-compiled releases at [1]) to arbor.chat:7117 and
join arbor-dev#57ea. I'm @whereswaldon in there. Arbor isn't
ephemeral, but it is a chat with a decentralized identity service and
a Gio front-end (if that meets what you're looking for).
- You already know about our slack (but for the benefit of the list)
you can find us at #gioui on gophers.slack.com (I'm @whereswaldon
there too).
- You can reach me via email either here, on my public inbox [2], or
by digging my actual email address out of my git commits (or off of
this mail).

Cheers,
Chris

[0] https://git.sr.ht/~whereswaldon/sprig
[1] https://git.sr.ht/~whereswaldon/sprig/refs/v0.0.18-rc4
[2] https://lists.sr.ht/~whereswaldon/public-inbox
Details
Message ID
<CC53GGGZIKCA.1VALYP7PO6DU4@len>
In-Reply-To
<CAFcc3FTE8pTdqjTmzJo8MpXe=zzFrQsXt4xgB6oJw2iFnOdM+A@mail.gmail.com> (view parent)
DKIM signature
missing
Download raw message
> I'd welcome a patch to change that if you are so inclined. I built
> that component a while ago, and I've been meaning to go back and
> update it with some of the lessons I've learned about Gio design since
> then. I don't expect to get to that in the next few weeks though.

what are some of those lessons? -- I'm sure I could manage creating a
patch that makes ModalSheet public within ModalNavDrawer, I'd expect you
have more lessons in mind though.

I'm in no particular hurry. If you tell me how you want things changed I
can try my best, otherwise I'll be patient.

> > On an unrelated note: do you by any chance also have an IRC or XMPP
> > presence that could be used without having to get a Slack account?
>
> Not certain if this is addressed to me, Elias, or other community
> members

It was addressed to the community in general, or pretty much anyone who
would feel inclined/able to answer questions about Gio ;)

> - You can use my chat system, Arbor, to reach me.

Sounds interesting! I'll check it out.


Thanks,

j
Details
Message ID
<CAFcc3FQ53nd5O8ExLZFV=jcPEaUUbzOFNahXh-g0Bsf9PuBPXw@mail.gmail.com>
In-Reply-To
<CC53GGGZIKCA.1VALYP7PO6DU4@len> (view parent)
DKIM signature
pass
Download raw message
> > I'd welcome a patch to change that if you are so inclined. I built
> > that component a while ago, and I've been meaning to go back and
> > update it with some of the lessons I've learned about Gio design since
> > then. I don't expect to get to that in the next few weeks though.
>
> what are some of those lessons? -- I'm sure I could manage creating a
> patch that makes ModalSheet public within ModalNavDrawer, I'd expect you
> have more lessons in mind though.

Jack Mordaunt and I talked about them during the last communit call,
and you can see a re-enactment of those presentations here:

https://www.youtube.com/watch?v=grLXZiTNBm8

I believe Jack (CCed) may have these thoughts in a blog post form
somewhere as well, but I don't have the link handy.

Essentially, the nav drawer as it stands right now mixes core widget
state with state about how it is presented to the user. It also makes
many presentation decisions during layout. This makes it harder to
use, more memory-hungry than it needs to be, and makes it less
flexible to developer needs (as you are now experiencing).

The simplest change would be to promote the width calculation to a
field that is set to a default value by the constructor but can be
adjusted by the user prior to layout. I'd take a patch for just that.

Longer-term though, we should really separate the idea of the state of
a navigation control from the presentation of a navigation control.
That's a bigger and more nebulous goal. If you're interested in
exploring that, I'm happy to go into more depth.

Cheers,
Chris
Reply to thread Export thread (mbox)