(self)
| 77 | self.load() |
| 78 | |
| 79 | def load(self): |
| 80 | self._ = self.app.language_manager.language.get("sidebar") |
| 81 | self.rail = NavigationColumn(sidebar=self.sidebar, page=self.flet_page, app=self.app) |
| 82 | |
| 83 | if self.flet_page.theme_mode == ft.ThemeMode.DARK: |
| 84 | self.dark_light_text = ft.Text(self._["dark_theme"], color=ft.Colors.PRIMARY) |
| 85 | self.dark_light_icon = ft.IconButton( |
| 86 | icon=ft.Icons.BRIGHTNESS_HIGH_OUTLINED, |
| 87 | tooltip=self._["toggle_day_theme"], |
| 88 | on_click=self.theme_changed, |
| 89 | icon_color=ft.Colors.PRIMARY, |
| 90 | ) |
| 91 | else: |
| 92 | self.dark_light_text = ft.Text(self._["light_theme"], color=ft.Colors.PRIMARY) |
| 93 | self.dark_light_icon = ft.IconButton( |
| 94 | icon=ft.Icons.BRIGHTNESS_2_OUTLINED, |
| 95 | tooltip=self._["toggle_night_theme"], |
| 96 | on_click=self.theme_changed, |
| 97 | icon_color=ft.Colors.PRIMARY, |
| 98 | ) |
| 99 | |
| 100 | colors_list = [ |
| 101 | ("deeppurple", "Deep purple"), |
| 102 | ("purple", "Purple"), |
| 103 | ("indigo", "Indigo"), |
| 104 | ("blue", "Blue"), |
| 105 | ("teal", "Teal"), |
| 106 | ("deeporange", "Deep orange"), |
| 107 | ("orange", "Orange"), |
| 108 | ("pink", "Pink"), |
| 109 | ("brown", "Brown"), |
| 110 | ("bluegrey", "Blue Grey"), |
| 111 | ("green", "Green"), |
| 112 | ("cyan", "Cyan"), |
| 113 | ("lightblue", "Light Blue"), |
| 114 | ("", "Default"), |
| 115 | ] |
| 116 | |
| 117 | self.bottom_controls = ft.Column( |
| 118 | controls=[ |
| 119 | ft.Row( |
| 120 | controls=[ |
| 121 | self.dark_light_icon, |
| 122 | self.dark_light_text, |
| 123 | ], |
| 124 | alignment=ft.MainAxisAlignment.START, |
| 125 | ), |
| 126 | ft.Row( |
| 127 | controls=[ |
| 128 | ft.PopupMenuButton( |
| 129 | icon=ft.Icons.COLOR_LENS_OUTLINED, |
| 130 | icon_color=ft.Colors.PRIMARY, |
| 131 | tooltip=self._["colors"], |
| 132 | items=[PopupColorItem(color=color, name=name) for color, name in colors_list], |
| 133 | ), |
| 134 | ft.Text(self._["theme_color"], color=ft.Colors.PRIMARY), |
| 135 | ], |
| 136 | alignment=ft.MainAxisAlignment.START, |
no test coverage detected