Kivy: Fix MessageBox popups (#5193)

This commit is contained in:
Duck
2025-09-06 11:21:36 -06:00
committed by GitHub
parent c3c517a200
commit 8a091c9e02
2 changed files with 3 additions and 8 deletions

View File

@@ -220,6 +220,8 @@
<MessageBoxLabel>:
theme_text_color: "Custom"
text_color: 1, 1, 1, 1
<MessageBox>:
height: self.content.texture_size[1] + 80
<ScrollBox>:
layout: layout
bar_width: "12dp"
@@ -233,8 +235,3 @@
spacing: 10
size_hint_y: None
height: self.minimum_height
<MessageBoxLabel>:
valign: "middle"
halign: "center"
text_size: self.width, None
height: self.texture_size[1]

View File

@@ -720,13 +720,11 @@ class MessageBoxLabel(MDLabel):
class MessageBox(Popup):
def __init__(self, title, text, error=False, **kwargs):
label = MessageBoxLabel(text=text)
label = MessageBoxLabel(text=text, padding=("6dp", "0dp"))
separator_color = [217 / 255, 129 / 255, 122 / 255, 1.] if error else [47 / 255., 167 / 255., 212 / 255, 1.]
super().__init__(title=title, content=label, size_hint=(0.5, None), width=max(100, int(label.width) + 40),
separator_color=separator_color, **kwargs)
self.height += max(0, label.height - 18)
class MDNavigationItemBase(MDNavigationItem):