KivyMD
KivyMD copied to clipboard
MDFloatingActionButtonSpeedDial does not work with MDNavigationRail
So i am trying to add a MDFloatingActionButtonSpeedDial
into a screen navigated through the MDNavigationRail
items but it doesn't even show up.
When i try removing the MDNavigationRail
part, the FAB shows up which i find weird, this may be a bug, or i am doing something wrong i am not sure. Here's my coede:
main.py:
from kivymd.app import MDApp
from kivy.uix.screenmanager import ScreenManager, Screen
class CfgScreen(Screen):
data = {
"Add user": "account-plus-outline"
}
def __init__(self, **kwargs):
super(CfgScreen, self).__init__(**kwargs)
class MainApp(MDApp):
def build(self):
self.theme_cls.primary_palette = "Teal"
sm = ScreenManager()
sm.add_widget(CfgScreen(name="cfg"))
return sm
if __name__=="__main__":
MainApp().run()
main.kv
CfgScreen:
<CfgScreen>:
name: "cfg"
BoxLayout:
orientation: "horizontal"
MDNavigationRail:
md_bg_color: app.theme_cls.primary_color
MDNavigationRailItem:
id: navigation_rail
icon: "account-details-outline"
ScreenManager:
id: sm_cfg
Screen:
name: "cfg_user_account"
MDFloatingActionButtonSpeedDial:
data: root.data
root_button_anim: True
Screenshots
With MDNavigationRail
:
Without the MDNavigationRail
part:
Versions
- OS: Windows 10
- Python: 3.10.6
- Kivy: 2.1.0
- KivyMD: 1.0.2
@blurryrox Please change your code so that there is nothing in it that does not relate to reproducing the error.
@blurryrox Please change your code so that there is nothing in it that does not relate to reproducing the error.
edited
@HeaTTheatR After a few experimenting, i suspect that MDNavigationRail
push the next box out of the screen, as it slides to the next screen, i can see it shows up for a little bit of sliding between the current and next screen.
And after adjusting the buttons position more to the left in kivymd/uix/buttons/buttons.py
, it shows up perfectly.
@blurryrox OK, I'll check it out.