@@ -40,9 +40,6 @@ def build_ui(self):
4040 self ._appbar = ft .AppBar (
4141 leading = ft .IconButton (
4242 icon = ft .Icons .ARROW_BACK ,
43- style = ft .ButtonStyle (
44- shape = ft .RoundedRectangleBorder (radius = 8 ),
45- ),
4643 on_click = self .go_index ,
4744 tooltip = "На головну" ,
4845 ),
@@ -51,17 +48,13 @@ def build_ui(self):
5148 width = 64 ,
5249 height = 64 ,
5350 icon = ft .Icons .LOGOUT ,
54- style = ft .ButtonStyle (
55- shape = ft .RoundedRectangleBorder (radius = 8 ),
56- ),
5751 on_click = self .open_alert ,
5852 tooltip = "Вийти з аккаунта" ,
5953 ),
6054 ],
6155 title = ft .Text ("Профіль" , size = 20 ),
6256 leading_width = 64 ,
63- center_title = False ,
64- shape = ft .RoundedRectangleBorder (radius = 8 ),
57+ center_title = False ,
6558 bgcolor = ft .Colors .SURFACE_CONTAINER_HIGHEST ,
6659 )
6760
@@ -71,6 +64,7 @@ def build_ui(self):
7164 width = 64 ,
7265 height = 64 ,
7366 fit = ft .ImageFit .CONTAIN ,
67+ filter_quality = ft .FilterQuality .NONE ,
7468 ),
7569 title = ft .TextField (
7670 # account.user["user"]["players"][0]["name"],
@@ -89,14 +83,10 @@ def build_ui(self):
8983 size = 10 ,
9084 selectable = True ,
9185 ),
92- trailing = ft .FloatingActionButton (
86+ trailing = ft .IconButton (
9387 icon = ft .Icons .EDIT ,
9488 tooltip = "Редагувати" ,
95- mini = True ,
96- width = 32 ,
97- height = 32 ,
9889 on_click = self ._edit_nickname ,
99- shape = ft .RoundedRectangleBorder (radius = 8 ),
10090 ),
10191 title_alignment = ft .ListTileTitleAlignment .TITLE_HEIGHT ,
10292 content_padding = ft .Padding (8 , 2 , 8 , 2 ),
@@ -124,55 +114,41 @@ def build_ui(self):
124114 vertical_alignment = ft .CrossAxisAlignment .CENTER ,
125115 alignment = ft .MainAxisAlignment .CENTER ,
126116 controls = [
127- ft .FilledTonalButton (
117+ ft .OutlinedButton (
128118 "Завантажити скін" ,
129119 icon = ft .Icons .FACE ,
130120 expand = True ,
131121 on_click = lambda e : self ._skin_file_picker .pick_files (
132122 dialog_title = "Виберіть файл скіна" ,
133123 allowed_extensions = ["png" ],
134124 ),
135- style = ft .ButtonStyle (
136- shape = ft .RoundedRectangleBorder (radius = 8 ),
137- padding = ft .Padding (0 , 0 , 0 , 0 ),
138- ),
139125 ),
140- ft .FloatingActionButton (
126+ ft .IconButton (
141127 icon = ft .Icons .DELETE ,
142- scale = 0.8 ,
143- mini = True ,
144- bgcolor = ft .Colors .RED_400 ,
128+ icon_color = ft .Colors .ERROR ,
145129 tooltip = "Видалити скін" ,
146130 on_click = self .on_delete_skin ,
147- shape = ft .RoundedRectangleBorder (radius = 8 ),
148131 ),
149132 ],
150133 )
151134 self ._cape_settings = ft .Row (
152135 vertical_alignment = ft .CrossAxisAlignment .CENTER ,
153136 alignment = ft .MainAxisAlignment .CENTER ,
154137 controls = [
155- ft .FilledTonalButton (
138+ ft .OutlinedButton (
156139 "Завантажити плащ" ,
157140 icon = ft .Icons .BOOKMARK ,
158141 expand = True ,
159142 on_click = lambda e : self ._cape_file_picker .pick_files (
160143 dialog_title = "Виберіть файл плаща" ,
161144 allowed_extensions = ["png" ],
162145 ),
163- style = ft .ButtonStyle (
164- shape = ft .RoundedRectangleBorder (radius = 8 ),
165- padding = ft .Padding (0 , 0 , 0 , 0 ),
166- ),
167146 ),
168- ft .FloatingActionButton (
147+ ft .IconButton (
169148 icon = ft .Icons .DELETE ,
170- scale = 0.8 ,
171- mini = True ,
172- bgcolor = ft .Colors .RED_400 ,
149+ icon_color = ft .Colors .ERROR ,
173150 tooltip = "Видалити плащ" ,
174151 on_click = self .on_delete_cape ,
175- shape = ft .RoundedRectangleBorder (radius = 8 ),
176152 ),
177153 ],
178154 )
@@ -198,22 +174,19 @@ def build_ui(self):
198174 vertical_alignment = ft .CrossAxisAlignment .CENTER ,
199175 alignment = ft .MainAxisAlignment .CENTER ,
200176 controls = [
201- ft .FilledTonalButton (
177+ ft .OutlinedButton (
202178 "Змінити пароль" ,
203179 icon = ft .Icons .LOCK ,
204180 expand = True ,
205181 on_click = self .on_change_password ,
206- style = ft .ButtonStyle (
207- shape = ft .RoundedRectangleBorder (radius = 8 ),
208- padding = ft .Padding (0 , 0 , 0 , 0 ),
209- ),
210182 ),
211183 ],
212184 ),
213185 ],
214186 )
215187 self ._card = ft .Card (
216188 expand = True ,
189+ margin = ft .Margin (0 , 4 , 0 , 0 ),
217190 content = ft .Container (
218191 padding = ft .Padding (8 , 0 , 8 , 0 ),
219192 content = ft .Column (
@@ -242,41 +215,45 @@ def build_ui(self):
242215 src = None ,
243216 width = 216 ,
244217 height = 392 ,
218+ filter_quality = ft .FilterQuality .NONE ,
245219 )
246220 self ._skin_back_image = ft .Image (
247221 # src=f"{SKINS_CACHE_FOLDER}/{account.skin_hash}-back.png",
248222 src = None ,
249223 width = 216 ,
250224 height = 392 ,
225+ filter_quality = ft .FilterQuality .NONE ,
251226 )
252227
228+ self ._skin_card = ft .Card (
229+ margin = ft .Margin (0 , 4 , 0 , 0 ),
230+
231+ content = ft .Row (
232+ width = 500 ,
233+ controls = [
234+ ft .Container (
235+ padding = ft .Padding (16 , 0 , 16 , 0 ),
236+ content = self ._skin_image ,
237+ expand = True ,
238+ ),
239+ ft .VerticalDivider (),
240+ ft .Container (
241+ padding = ft .Padding (16 , 0 , 16 , 0 ),
242+ content = self ._skin_back_image ,
243+ expand = True ,
244+ ),
245+ ],
246+ )
247+ )
253248 self .pagelet = ft .Pagelet (
254249 expand = True ,
255250 appbar = self ._appbar ,
256251 content = ft .Row (
257252 expand = True ,
253+ spacing = 4 ,
258254 controls = [
259255 self ._card ,
260- ft .Card (
261- content = ft .Row (
262- width = 500 ,
263- controls = [
264- ft .Container (
265- padding = ft .Padding (16 , 0 , 16 , 0 ),
266- content = self ._skin_image ,
267- expand = True ,
268- ),
269- ft .VerticalDivider (),
270- ft .Container (
271- padding = ft .Padding (16 , 0 , 16 , 0 ),
272- content = self ._skin_back_image ,
273- expand = True ,
274- ),
275- ],
276- ),
277- ),
278- # ft.VerticalDivider(),
279- # self._skin_back_image,
256+ self ._skin_card ,
280257 ],
281258 ),
282259 # height=200,
0 commit comments