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

Panel doesn't listen to title changed #248

Closed
hbcarlos opened this issue Oct 14, 2021 · 4 comments
Closed

Panel doesn't listen to title changed #248

hbcarlos opened this issue Oct 14, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@hbcarlos
Copy link
Member

Description

Not sure if this is a bug, I would say it is.
MenuBar and TabBar listen to title changes on every inserted widget, but Panel doesn't.
MenuBar:

menu.title.changed.connect(this._onTitleChanged, this);

TabBar:
title.changed.connect(this._onTitleChanged, this);

The problem is that the AccordionPanel extends Panel and uses its children titles to separate the widgets and show/hide the respective child. See screenshot:
Screenshot from 2021-10-14 12-42-09

I'm trying to update the title, but it doesn't update the widget since the accordion panel is not listening for changes.

Is this a bug in the Panel widget? Should I open a PR to listen for title changes in the Panel widget, or should I overwrite the addWidget and insertWidget in the AccordionPanel to listen for changes?

Reproduce

Expected behavior

Context

@hbcarlos hbcarlos added the bug Something isn't working label Oct 14, 2021
@blink1073
Copy link
Contributor

I think that logic should go in AccordionPanel and not Panel if possible, since not every panel needs to concern itself with the titles of its children.

@hbcarlos
Copy link
Member Author

Okay. Thanks, @blink1073. I'll open a PR!

@fcollonval
Copy link
Member

Thanks for catching that one @hbcarlos
I agree with @blink1073 that this should be corrected only in the accordion panel.

@fcollonval
Copy link
Member

Closing as the fix #249 has been merged.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants