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

Rewrite Tab class #42

Closed
3 tasks done
texus opened this issue Nov 7, 2015 · 0 comments
Closed
3 tasks done

Rewrite Tab class #42

texus opened this issue Nov 7, 2015 · 0 comments
Labels

Comments

@texus
Copy link
Owner

texus commented Nov 7, 2015

There are a lot of things that the Tab class is missing, at least some of these should be added. The fixed tab width will definitely be added to v0.7 v0.8 while an tab with images is very likely to be added as well.

  • Fixed tab width
    The width of the tab currently depends on its contents. A consequence of this implementation was that the setSize function is empty and Tab cannot be scaled like other widgets. Adding a fixed tab width will solve this problem. The setSize function will set the total width and the tab height, the individual tab width becomes total width / nr of tabs. But setting a specific tab width might be wanted as well in which case the total width still has to be variable like it is now.
  • Hover state
    It might be a nice addition to also have a different color on hover like ListBox has for its items.
  • Minimum tab width
    Right now you can set a maximum tab width but not a minimum. The minimum is actually set to 2 * distance to side, but it should be more flexible and thus the user should be able to specify this value himself.

Edit: The following features are not be part of the rewrite. They could still be added in the future, but this issue will not remain open until then.

  • Images in tabs
    Every tab currently contains a Label, but it should be possible to store a Picture in it. Since both versions behave very similar but they are hard to combine, they should probably be split in two classes which inherit from a base tab class which does most of the work. The question then becomes if it is possible to have a Tab class that contains an image with text next to it.
  • Enlare selected tab
    It should be possible to enlarge the currently selected tab, especially when there is a fixed tab size. When no tabs are selected then then selecting a tab might increase the total width or decrease the individual tab widths, but in most cases one tab will already be selected and thus changing tab does not changes the total size. Making it larger vertically should also be possible but then the question becomes in which direction it should expand. Should changing the bottom or top of the individual tab impact the reported top or height of the widget? First thought is no, but when inside a HorizontalLayout it might be needed to fully display.
  • New tab
    An extra tab on the right could be optionally added to create a new tab. The user should have some way to set what the text of this tab is. Since he will probably want to do something when the tab opens it could perhaps be set in the callback that the user gets instead of having to add another setter.
  • Close button
    Adding an optional close button to each tab might be wanted in some cases.
  • Dragging
    The should be an option to allow reordering tabs by dragging them.
@texus texus added the feature label Nov 7, 2015
@texus texus added this to the v0.7 milestone Nov 7, 2015
@texus texus removed this from the v0.7 milestone Apr 4, 2016
@texus texus added this to the 0.8 milestone Feb 19, 2017
@texus texus closed this as completed in 0a54bca Jul 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant