How to define theme for an MDDialog in KivyMD?

99 views
Skip to first unread message

Felipe Viera

unread,
Apr 10, 2020, 9:36:01 AM4/10/20
to Kivy users support
Hello!

My app is themed "Dark":

from kivymd.app import MDApp
from kivy.lang import Builder
from kivymd.uix.dialog import MDDialog


KV = """
Button
on_release:
app.popup();
"""


class MainActivity(MDApp):
def build(self):
self.theme_cls.theme_style = "Dark" # <-----------------
return Builder.load_string(KV)

def popup(self):
dialog = MDDialog(
text="Hello",
size_hint=(0.4, 0.4)
)
dialog.open()

MainActivity().run()

Screenshot from 2020-04-10 10-21-53.png

But my Popup is running with a "Dark" theme, how do I make my Popup color normal?

Robert Flatt

unread,
Apr 10, 2020, 7:52:47 PM4/10/20
to Kivy users support
A great demonstration of the issue, thanks.
To me this looks like an issue because the dialog is "Dark" but its button appears "Light".
Consider submitting an issue https://github.com/HeaTTheatR/KivyMD/issues

However MD is a set of design rules, and what makes the result look good is enforcing the rules.
Maybe this how it is supposed to be? I don't know.
Reply all
Reply to author
Forward
0 new messages