Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: the gtk expander widget bugfix #1132

Merged
merged 2 commits into from
Aug 24, 2024

Conversation

ovalkonia
Copy link
Contributor

Description

As it was mentioned in this issue -> #1085, if the name property was set for the expander widget, then child elements didn't show up. Essentially it was a choice between a labeled but child-free expander or labeless but with children expander.

This behavior came from the build_builtin_gtk_widget() function. To be more precise, this function adds child elements only if there aren't any children that have been already added with the widget_use_to_gtk_widget() function. The problem with that in this case is that expander's label is actually considered to be a child element itself:
1720052331

So now the build_gtk_expander() function handles the child element explicitly (see diff).

Fixes #1085

Usage

N/A

Showcase

Here's the minimal configuration used below:

(defwindow example
    :monitor "0"
    :geometry (geometry
        :x "0"
        :y "0"
        :width "100%"
        :height "35px"
        :anchor "top center"
    )
    :exclusive "true"
    (expander
        :name "foo"
        :halign "start"
        (label :text "expanded child")
    )
)

The result:
1720105295
Works as expected

Additional Notes

Now the expander widget is also required to have exactly one child. If no children were provided, there would be an error. I just thought it would be nice, but it can be removed without any problems if necessary.

Checklist

Please make sure you can check all the boxes that apply to this PR.

  • All widgets I've added are correctly documented.
  • I added my changes to CHANGELOG.md, if appropriate.
  • The documentation in the docs/content/main directory has been adjusted to reflect my changes.
  • I used cargo fmt to automatically format all code before committing

@elkowar elkowar merged commit f01396f into elkowar:master Aug 24, 2024
1 check passed
@elkowar
Copy link
Owner

elkowar commented Aug 24, 2024

Thanks for your work! Merged!

@ovalkonia
Copy link
Contributor Author

@elkowar, whoops, I think I accidentally put the changelog entry under the wrong version. Should be under unreleased, my bad. Must have been sleepy when I did this. Can you fix that, please? Another pr would probably be too much

w-lfchen added a commit to w-lfchen/eww that referenced this pull request Aug 24, 2024
@w-lfchen
Copy link
Contributor

w-lfchen commented Aug 24, 2024

i've added this to #1155, that pr contains some general fixes by now anyways

@ovalkonia
Copy link
Contributor Author

Thank you!

elkowar pushed a commit to w-lfchen/eww that referenced this pull request Aug 25, 2024
elkowar pushed a commit that referenced this pull request Aug 25, 2024
* fix!: eliminate some dead code

* fix: fix lints

Combined diff of a7a09ea and bfc5cb9

Co-authored-by: Johan Geluk <johan@geluk.io>

* fix: remove unnecessary allow; fix capitalization

* chore: automatically update a few dependencies

* fix: fix lint

i introduced this in #1119, whoops

* docs: move #1132's changelog entry

---------

Co-authored-by: Johan Geluk <johan@geluk.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Expander widget does not expand if name is specified
3 participants