Positioning of MDTopAppBar elements #2
AHiXilTOr opened this issue · 7 comments
AHiXilTOr commented
Description of the Bug
pos_hint: {"center_x": .5} doesn't work
Code and Logs
from kivymd.app import MDApp
from kivy.lang import Builder
kv = """
MDScreen:
md_bg_color: self.theme_cls.secondaryContainerColor
MDTopAppBar:
type: "small"
size_hint_x: .8
pos_hint: {"center_x": .5, "center_y": .5}
MDTopAppBarLeadingButtonContainer:
MDActionTopAppBarButton:
icon: "menu"
MDTopAppBarTitle:
text: "AppBar small"
pos_hint: {"center_x": .5}
MDTopAppBarTrailingButtonContainer:
MDActionTopAppBarButton:
icon: "account-circle-outline"
"""
class App(MDApp):
def build(self):
return Builder.load_string(kv)
App().run()
"""
class MainApp(App):
def build(self):
self.root = Builder.load_string(kv)
if __name__ == '__main__':
MainApp().run()
Screenshots
Versions
- OS: Any
- Python: Any
- Kivy: Any
- KivyMD: dev
T-Dynamos commented
What is the use case of centering that icon?
It does not matches material design spec.
https://m3.material.io/components/top-app-bar/specs
(It does not declare anywhere to center icons)
AHiXilTOr commented
What is the use case of centering that icon?
It does not matches material design spec.
https://m3.material.io/comComponents/top-app-bar/specs
(It does not declare anywhere to center icons)
Not an icon, but a title.