-
-
Notifications
You must be signed in to change notification settings - Fork 381
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 stack
widget bugfix
#1119
Conversation
Hi, (defvar stack-index 0)
(stack
:selected stack-index
(child-widget1)
(child-widget2)
) This would be extremely useful because you could update the variable from |
@fabolous005 Yeah, absolutely you can can do that! (defvar stack-index 0)
(eventbox
:onhover "${EWW_CMD} update stack-index=${(stack-index + 1) % 3}"
(stack
:selected stack-index
(label :text "first")
(label :text "second")
(label :text "third")
)
) It's just a You can update variables using For |
Yeah, i tried that, but whatever i try i get the error |
Well, it is what it is for now, this pr solves this exact issue. Right now it essentially defaults to the |
Ohh! Sorry should've noticed that... Thank you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can probably just apply this from the web interface
apart from this minor nitpick lgtm
Co-authored-by: Wölfchen <w-lfchen@posteo.net>
i introduced this in elkowar#1119, whoops
i introduced this in elkowar#1119, whoops
* 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>
Description
The
:selected
property had initially no effect and resulted in a warning stating that a child with the given name wasn't found. This exact issue has already been described here -> #1116.Take a look at the following screenshot showing minimal configuration:
As you can see, there's a warning and instead of the expected "1st", it shows "0th".
Although, if you update the variable, it will work, since all the children are already there:
The problem is here:
eww/crates/eww/src/widgets/widget_definitions.rs
Lines 980 to 1011 in e95d3af
gtk_widget.set_visible_child_name(&selected.to_string())
gets called before any children are actually added.Fixes #1116
Usage
N/A
Showcase
Here is that same minimal configuration from before, but this time using the fixed version:
No warnings and it shows "1st", just as expected!
Additional Notes
N/A
Checklist
Please make sure you can check all the boxes that apply to this PR.
docs/content/main
directory has been adjusted to reflect my changes.cargo fmt
to automatically format all code before committing