Few questions about AdwAlertDialog customization

Can’t find in docs how to implement following features:

  1. Sort order for buttons - for example, Quit added with add_response as the last one in code, but it’s going first in list yet
  2. Set vertical only orientation, if that’s possible - found only set_prefer_wide_layout option
  3. Colors for buttons - accent, warning, etc
  4. Can I remove (cleanup) all responses, not one-by-one with remove_response?

image

upd. found some answers:

#2 surprised that sort order works but in reverse:

gobject.add_response("quit", "Quit"); // 2 in list
gobject.add_response("create", "Create new profile"); // 1 in list

maybe the bug or just some vector implementation in rust wrapper…
it’s libadwaita v1.6 here

#3 set_response_appearance

If you’re customizing the dialog, then would AdwDialog be a better choice ?

1 Like
  1. That’s on purpose - you’re supposed to put cancel-like buttons on the left, and they will appear last when vertical

  2. That’s not possible because depending on yoru window size it just won’t fit

  3. adw_dialog_set_response_appearance()

  4. No. If you want that, you probably want to create a new dialog instead anyway

1 Like

Thanks for replies,

about #4 - just created local keys registry, and clean up one by one before init new preset, here is implementation in Rust.

No, I mean that usually indicates you’re using dialogs wrong. Why do you need to remove responses in the first place, let alone all of them?

I’ve created welcome dialog, where user must select profile to continue. I won’t write additional checkbox features in children widget, because implementation with buttons simpler for me as for dev and simpler for user who select option by one click (not radio box + one more click)

Here is how does it looks like

image

In other words, I remove some custom (generated) options and keep default controls in one set

Yes, you absolutely don’t want that. Have a list in your dialog or something similar. This will be an absolute disaster when the window is short, likely will just overflow.

2 Likes

Agreed, just options above not expected at this moment, later will create separated window for profiles management and maybe skip these options. But for now I want to have visible options if exist (mostly to remind myself I forgot something to cleanup)

anyway, scrollable container would be useful feature for AdwDialog in vertical presentation :wink:

It is scrollable. The title + subtitle + extra child box, that is. Button aren’t, because you’re misusing the dialog right now.

Thanks for advice!

Finally I’ve disabled this feature as really strange solution even /tmp. Seems I need additional time for multi-profile implementation, including UI part.