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

MDTabsSecondary does not allow custom height #1685

Open
cdavidson-project-canary opened this issue Apr 18, 2024 · 0 comments
Open

MDTabsSecondary does not allow custom height #1685

cdavidson-project-canary opened this issue Apr 18, 2024 · 0 comments
Labels
Type: Enhancement Feature request/Feature implementation

Comments

@cdavidson-project-canary
Copy link

cdavidson-project-canary commented Apr 18, 2024

Description of the Bug

The MDTabsSecondary component does not allow a custom height to be defined. I attempted to explicitly set the height of the MDTabsSecondary instance, MDTabsItemSecondary instances, and MDTabsItemText instances at initialization. None of these had any impact on the overall height of the tab bar.

My workaround is to define a function executed by Clock.schedule_once() to dynamically resize all the tab bar components post initialization:

    def __init__(self):

        self.tab_bar = MDTabsSecondary(...)
        self.tab_bar.add_widget(...)
        self.tab_bar.add_widget(...)

        Clock.schedule_once(lambda x: self.update_tab_bar_height())
    #

    def update_tab_bar_height(self):

        TAB_BAR_HEIGHT = 55

        self.tab_bar.height = TAB_BAR_HEIGHT
        self.tab_bar.ids.tab_scroll.height = TAB_BAR_HEIGHT

        tab_list = self.tab_bar.get_tabs_list()

        for tab_item in tab_list:

            tab_item.height = TAB_BAR_HEIGHT
            tab_item.tab_item_text.height = TAB_BAR_HEIGHT
        #
    #

Versions

OS: Windows 11 Enterprise
Python: 3.10.11
Kivy: 2.3.0
KivyMD: 2.0.1.dev0

@HeaTTheatR HeaTTheatR added the Type: Enhancement Feature request/Feature implementation label Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Feature request/Feature implementation
Projects
None yet
Development

No branches or pull requests

2 participants