-
Notifications
You must be signed in to change notification settings - Fork 815
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
tabs widget #2020
tabs widget #2020
Conversation
del tabs[active_index] | ||
try: | ||
return tabs[active_index] | ||
except IndexError: | ||
try: | ||
return tabs[active_index - 1] | ||
except IndexError: | ||
pass | ||
return None |
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.
There is something I don't get. Can't we just do this by inspecting the length of tabs
with respect to the active_index
?
Why do we have to del tabs[active_index]
and whatnot?
Does del tabs[active_index]
do anything other than deleting that specific entry from the list tabs
?
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.
I'm sure there is a more elegant solution. But we want to get the next active tab, which is normally the one to the right. Unless we're at the end, then its the one to the left.
Co-authored-by: Rodrigo Girão Serrão <[email protected]>
Co-authored-by: Rodrigo Girão Serrão <[email protected]>
Co-authored-by: Rodrigo Girão Serrão <[email protected]>
Co-authored-by: Rodrigo Girão Serrão <[email protected]>
Co-authored-by: Rodrigo Girão Serrão <[email protected]>
Co-authored-by: Rodrigo Girão Serrão <[email protected]>
Co-authored-by: Rodrigo Girão Serrão <[email protected]>
Adds a Tabs widget.
This will form part of a larger
TabbedContent
widget, but could be used independently.Screen.Recording.2023-03-13.at.11.21.32.mov