-
-
Notifications
You must be signed in to change notification settings - Fork 127
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
Implement plus button on TabBar #108
Implement plus button on TabBar #108
Conversation
Woah! I have been talking to folks about this recently. Would be spectacular to see this happen. I will dive into this and begin to review soon. |
In the meantime, can you post a screenshot? |
fa80fc0
to
da0840b
Compare
@ellisonbg @jasongrout @afshin It should be ready to review now. I've also updated the dock panel example to expose an additional context menu item when you right-click on the dock panel to toggle the plus button. |
I'm happy to look as well. |
@ellisonbg @afshin Any thoughts on this? |
9955f1d
to
8eb7a06
Compare
Rebased onto master and force pushed |
Pinging @ellisonbg @jasongrout @afshin again. Any interest in this? |
Sorry for leaving you hanging with this PR @nmichaud! I'll commit to reviewing this PR this week! Sorry again for such a long wait! |
@afshin Sure no problem, just wanted to make sure this was still of interest. |
@nmichaud thank you so much for your patience! I am 👍 on this broadly, I left some API surface area suggestions above. Could you please push your example updates as well? |
Thanks for the review @afshin. I've updated with the API changes you proposed. The dockpanel example has already been updated - right click on the DockPanel to bring up the context menu, and then select the last menu option ('Toggle add button') to see it in action. |
Oops, I got confused by the screenshot 😂 |
Yeah, apologies I didn't make it obvious in the beginning. |
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.
Thanks for this feature and for the patience!
This PR implements a plus button on the TabBar (similar to google chrome) that will trigger an event when clicked. I've wired up this event for the TabPanel to emit a AddWidgetRequested event, which can be handled by the end user to create the appropriate widget and add it to the panel. A similar approach can also be implemented for the DockPanel if desired.
The CSS is a bit tricky - currently the plus button floats to the end of the TabBar instead of following the tabs.