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

Layout of MDTopAppBar does not take effect (MDTopAppBarTrailingButtonContainer should locate to the far right but not work) #1708

Open
lijiabin0930 opened this issue Jun 8, 2024 · 3 comments
Labels
Type: Bug Bug report/Bug fix

Comments

@lijiabin0930
Copy link

Description of the Bug

Layout of MDTopAppBar does not take effect (MDTopAppBarTrailingButtonContainer should locate to the far right but not work)

Code and Logs

from kivymd.app import MDApp
from kivymd.uix.appbar import MDTopAppBar, MDTopAppBarLeadingButtonContainer, MDTopAppBarTitle, \
    MDTopAppBarTrailingButtonContainer, MDActionTopAppBarButton
from kivymd.uix.screen import MDScreen


class Example(MDApp):
    def build(self):
        title = MDTopAppBarTitle(
            text="Test",
        )
        # title.font_name = './SIMFANG.TTF'
        right = MDTopAppBarTrailingButtonContainer(
            MDActionTopAppBarButton(
                icon='calendar'
            ),
            MDActionTopAppBarButton(
                icon='attachment'
            ),
            MDActionTopAppBarButton(
                icon='dots-vertical'
            )

        )
        right.pos_hint = {
            'center_x': 1, 'center_y': 0.5
        }

        appbar = MDTopAppBar(
            MDTopAppBarLeadingButtonContainer(
                MDActionTopAppBarButton(
                    icon='menu'
                )
            ), title
            , right
        )
        appbar.pos_hint = {'x': 0, 'top': 1}
        appbar.type = 'small'
        appbar.size_hint = [1, 0.08]
        return MDScreen(
            appbar
        )


Example().run()

Screenshots

微信图片_20240608223805

Versions

  • OS:
  • Python: 3.10
  • Kivy:
  • KivyMD: 2.0.1dev
@lijiabin0930
Copy link
Author

i try to change the font size of the MDTopAppBarTitle.font_size but it didn't work too

@HeaTTheatR HeaTTheatR added the Type: Bug Bug report/Bug fix label Jun 8, 2024
@Dariosky-01
Copy link

I took a look and did some tests, even if I'm not an expert (and therefore for an objective working method it's always better to try and test what I publish even for you experts) I wasn't able to move the title, it always returns to the left, while the group of buttons on the right move to the right but not if they conflict with the text, and this happens if it is present at the same height, I noticed this when using appbar.type='large'. Changing this parameter brings it down and the buttons move to the right but not the title.

I did some tests because I'm making a summary of the problems I noticed in the various dependencies. I'll post something about it soon.

@theolaos
Copy link

theolaos commented Jul 17, 2024

Duplicate of #1700

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Bug report/Bug fix
Projects
None yet
Development

No branches or pull requests

4 participants