def _create_popup(self, instance): content = MDThemePicker() popup_width = min(0.95 * Window.width, dp(500)) popup = Popup(content=content, title=self.title, size_hint=(None, None), size=(popup_width, '400dp')) popup.open()
def show_theme_picker(self): theme_dialog = MDThemePicker() # todo: remove accent tab before drawing theme_tab = theme_dialog.children[0] theme_tab_bar = theme_tab.children[0] theme_tab_box = theme_tab_bar.children[0].children[0] accent_picker = theme_tab_box.children[1] theme_tab_box.remove_widget(accent_picker) theme_dialog.open() theme_dialog.bind(on_dismiss=self.save_theme)
def create_dialogs(self): recycle = CustomRecycle() recycle.size_hint_y = None recycle.height = 800 for i in range(1990, 2071): islamic = i - 579 item = { "viewclass": "YearItem", "text": f"{str(i)}/{str(islamic)}", } recycle.data.append(item) self.yearcontent = YearContent(size_hint_y=None, height=800).create() self.viewdialog = MDDialog(title="Change Calendar View:", type="confirmation", items=[ ItemConfirm(text="Default"), ]) self.theme_dialog = MDThemePicker(on_dismiss=self.on_save) self.license = License(size_hint_y=None, height=800) self.moreinfo = MoreInfo(size_hint_y=None, height=800) self.licensedialog = MDDialog(title="License:", type="custom", content_cls=self.license) self.infodialog = MDDialog(title="More Info:", type="custom", content_cls=self.moreinfo) self.yeardialog = MDDialog(title=f"Choose Year:", type="custom", content_cls=recycle) self.yeardialog.size_hint_x = .9 self.licensedialog.size_hint_x = .9 self.infodialog.size_hint_x = .9
def __init__(self): # Объявление переменных, отвечающих за работу КЛАССА self.algoritmus_data = {} self.algoritmus_header = "" self.snacks = [] # Маин виджет потом будет задан из тела MainLayout self.main_widget = None # Theme Manager, куда же без него! self.theme_cls = ThemeManager() # Loading theme from file try: self.theme_cls.accent_palette = theme["accent"] self.theme_cls.primary_palette = theme["primary"] self.theme_cls.theme_style = theme["style"] except: self.theme_cls.theme_style = "Light" # Список всех кнопок self.nav_buttons = [] # today`s weekday self.now = datetime.now() tz = pytz.timezone("Etc/GMT+4") tz.localize(self.now) self.title = "9В - ДЗ" # Данные домашки self.data = data # Инит в суперклассе, иначе кинет ошибку super().__init__() # ThemePicker - то самое окошко, где выбирают цвета темы self.md_theme_picker = MDThemePicker()
def show_theme_picker(self): theme_dialog = MDThemePicker() theme_dialog.open()
def theme_picker_open(self): MDThemePicker().open()
def theme(self): them = MDThemePicker() them.open()
def theme_picker_open(self): if not self.md_theme_picker: from kivymd.uix.picker import MDThemePicker self.md_theme_picker = MDThemePicker() self.md_theme_picker.open()
def open_theme_picker(self): picker = MDThemePicker() picker.open()
def build(self): tp = MDTimePicker() thp = MDThemePicker()
def __init__(self, **kwargs): Builder.load_file('templates/theming.kv') super().__init__(**kwargs) self.md_theme_picker = MDThemePicker()
def show_themepicker(self): MDThemePicker().open()
def show_themepicker(self, *args): picker = MDThemePicker() picker.open() picker.bind(on_dismiss=self.themepicker_dismiss)
def show_theme_picker(self): theme_dialog = MDThemePicker() theme_dialog.open() print(self.theme_cls.primary_palette) print(self.theme_cls.theme_style)
def show_themepicker(self): picker = MDThemePicker() picker.open()
def theme(self): theme_dialog = MDThemePicker() theme_dialog.open()
def __init__(self, **kwargs): super().__init__(**kwargs) self.theme_dialog = MDThemePicker()