Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ShowLicense(MDLabel):
- def __init__(self, **kwargs):
- super(ShowLicense, self).__init__(**kwargs)
- self.id = 'license'
- self.font_style = 'Body1'
- self.theme_text_color = 'Secondary'
- self.text = license
- self.text_size = (self.width, None)
- self.size_hint_y = None
- self.valign = 'top'
- self.halign = 'left'
- self.height = self.texture_size[1]
- class DotsMenu(MDDropdownMenu):
- def __init__(self, **kwargs):
- super(DotsMenu, self).__init__(**kwargs)
- Clock.schedule_once(self.my_init)
- def my_init(self, dt):
- self.items = [
- {'viewclass': 'MDFlatButton',
- 'text': 'Legal'},
- {'viewclass': 'MDFlatButton',
- 'text': 'Licenses',
- 'on_release': lambda: self.show_licenses_dialog()},
- {'viewclass': 'MDFlatButton',
- 'text': 'Settings',
- 'on_release': lambda: app.open_settings()}
- ]
- self.hor_growth = 'left'
- self.ver_growth = 'down'
- self.width_mult = 3
- def show_licenses_dialog(self):
- content = ScrollView(id='test')
- content.add_widget(ShowLicense())
- #content.bind(size=content.setter('text_size'))
- self.dialog = MDDialog(title="License Information",
- theme_text_color='Custom',
- content=content,
- size_hint=(.8, .8),
- auto_dismiss=True)
- self.dialog.open()
Advertisement
Add Comment
Please, Sign In to add comment