|
7 | 7 | from ttkbootstrap import dialogs |
8 | 8 | from ttkbootstrap import constants as ttkc |
9 | 9 | from ttkbootstrap.icons import Icon |
10 | | -from ttkbootstrap_icons import BootstrapIcon as Icons |
| 10 | +from ttkbootstrap_icons_mat import MatIcon as Icons |
11 | 11 |
|
12 | 12 | from typing import Callable, Any |
13 | 13 |
|
|
62 | 62 | RESET_B_ICON32 = b"iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfpAQ0NFhg1ua9VAAAGWUlEQVRYw6WXTWxcVxXHf+feN288kxnbcWO7dpxYSWNEKpRCk0Vat6F2EEhVU6WtoKgLNmzYFSQkJGrDonZgB2IFGxZsiiiFhFiIopZ+kKKAQtOmrVqSysUNcRM7rT8mnvG8efceFm889ozHtQ1HeqOR3nnnnvs///MlbFFGJo4TGUPoHIqCgiCoKAIoAEJZAkJ1nDrx4pbsymYKoxNDiFV8bBCveCMBqhkgLYhVFBGcomUwJaMaewQHGODUw3/53xx46uwQznkCa/DOYqzvRTmCcFThkCj9QFvVwgLoFMglhfMoF6zotFMwgaJOGDvx0tYdGDk9lLy0Bo92CzwGPA58AchvAloBuIjqr1X0Oe/sjLXJMWMnXtjcgZGzw6CKRGp8KPeJyFPAF4H0loK6KmWUlxHGhfA1T8WDMn6iPiR1DoycHgIRTIDxjq8ijAEHtnlwo7yv6A+85TfGGSdIHRI1B0YmhsEpVNSQlq+B/AS4/f88fEVuKDxpSD2rOO9xnKpywtQ8sYp6gbQZBHl65XBVj1e37tmmdAuMeY0GjSjO+XoERieGUAVFugV+BXwZQETYlesj39KB6qo15ytcm7+M8/F2HXle8d8AmRFnGDv5IsHK7V05wFj/GAnhSG4PLakcn+87Tlu2i6TcCKWowJk3fkbJL9IskVQ9ItLs3QOoeVT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wBrJiJ1gjGCEP5NYRS4vt5G0g2djynHSxSjeYrRPOV4CefjjWYAgOsoo5rR15x4jF0lZu3fytyuxF6RZ1G+DVxhQ5GGZ0O5osp3LMFvzbLxAONrdoS6hv3qM5Pc/8Q+BFEjqXcVfxHoFdgDBGxPygovIPpdzeifcOpRGH+ofkFpvpic/VKCRqwQaBfKowJfR7ibrS0mrys8A/wOlVmCpByPP7h+O9p4NZsYTiblikDokMj2AocRjpLMDv2g7VUz8yTl9ZIq5xF/wfrwIycVpLqajW9nNatD4/RxqFhIxyAeJ1jjJYsQroRFVGKFSESLHu8Ewdkk1U499Mqn2t/UgRoiZ49jXBpvS4iCypqlXCWZlwVsnMHbZZ5+eGvr+X8B/Cjb/QoC9CkAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjUtMDEtMTNUMTE6NTA6NTArMDA6MDBHt/QOAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDI1LTAxLTEzVDEyOjUxOjI4KzAwOjAwXcgMPAAAACh0RVh0ZGF0ZTp0aW1lc3RhbXAAMjAyNS0wMS0xM1QxMzoyMjoyNCswMDowMNLnMJIAAAAASUVORK5CYII=" |
63 | 63 |
|
64 | 64 |
|
| 65 | +# colors for buttons |
| 66 | +BLACK = '#000000' |
| 67 | +DKGRAY = '#444444' |
| 68 | +MDGRAY = '#777777' |
| 69 | +LTGRAY = '#BBBBBB' |
| 70 | +WHITE = '#FFFFFF' |
| 71 | +RED = '#FF0000' |
| 72 | +DKRED = '#990000' |
| 73 | +GREEN = '#00FF00' |
| 74 | +DKGREEN = '#007500' |
| 75 | +BLUE = '#0000FF' |
| 76 | +DKBLUE = '#000099' |
| 77 | +YELLOW = '#FFFF00' |
| 78 | +DKYELLOW = '#997700' |
| 79 | +ORANGE = '#FF5500' |
| 80 | +CYAN = '#00FFFF' |
| 81 | +DKCYAN = '#007799' |
| 82 | +FUCHSIA = '#FF00FF' |
| 83 | +MAGENTA = '#990099' |
| 84 | +PURPLE = '#5500BB' |
| 85 | + |
| 86 | + |
65 | 87 | # default UI values |
66 | 88 | DIALOG_PADDING_MAIN = (8, 10) |
67 | 89 | DIALOG_PADDING_INNER = (4, 6) |
@@ -135,153 +157,167 @@ def enable(self, enabled=True): |
135 | 157 | # standard buttons |
136 | 158 | class BtnOK(_btn_Base): |
137 | 159 | def __init__(self, master, text=BTN_OK, command=None, enabled=True): |
| 160 | + icon = Icons("check", color=RED).image |
138 | 161 | super().__init__( |
139 | 162 | master, |
140 | 163 | text=text, |
141 | | - icon=Icons("check-circle").image, |
| 164 | + icon=icon, |
142 | 165 | command=command, |
143 | 166 | enabled=enabled, |
144 | 167 | ) |
145 | 168 |
|
146 | 169 |
|
147 | 170 | class BtnCancel(_btn_Base): |
148 | 171 | def __init__(self, master, text=BTN_CANCEL, command=None, enabled=True): |
| 172 | + icon = Icons("cancel", color=RED).image |
149 | 173 | super().__init__( |
150 | 174 | master, |
151 | 175 | text=text, |
152 | | - icon=Icons(name="x-circle").image, |
| 176 | + icon=icon, |
153 | 177 | command=command, |
154 | 178 | enabled=enabled, |
155 | 179 | ) |
156 | 180 |
|
157 | 181 |
|
158 | 182 | class BtnClose(_btn_Base): |
159 | 183 | def __init__(self, master, text=BTN_CLOSE, command=None, enabled=True): |
| 184 | + icon = Icons("stop-circle", color=FUCHSIA).image |
160 | 185 | super().__init__( |
161 | 186 | master, |
162 | 187 | text=text, |
163 | | - icon=Icons("sign-stop").image, |
| 188 | + icon=icon, |
164 | 189 | command=command, |
165 | 190 | enabled=enabled, |
166 | 191 | ) |
167 | 192 |
|
168 | 193 |
|
169 | 194 | class BtnExit(_btn_Base): |
170 | 195 | def __init__(self, master, text=BTN_EXIT, command=None, enabled=True): |
| 196 | + icon = Icons("exit-run", color=FUCHSIA).image |
171 | 197 | super().__init__( |
172 | 198 | master, |
173 | 199 | text=text, |
174 | | - icon=Icons("door-open").image, |
| 200 | + icon=icon, |
175 | 201 | command=command, |
176 | 202 | enabled=enabled, |
177 | 203 | ) |
178 | 204 |
|
179 | 205 |
|
180 | 206 | class BtnAdd(_btn_Base): |
181 | 207 | def __init__(self, master, text=BTN_ADD, command=None, enabled=True): |
| 208 | + icon = Icons("plus-box", color=YELLOW).image |
182 | 209 | super().__init__( |
183 | 210 | master, |
184 | 211 | text=text, |
185 | | - icon=Icons("plus-square").image, |
| 212 | + icon=icon, |
186 | 213 | command=command, |
187 | 214 | enabled=enabled, |
188 | 215 | ) |
189 | 216 |
|
190 | 217 |
|
191 | 218 | class BtnRemove(_btn_Base): |
192 | 219 | def __init__(self, master, text=BTN_REMOVE, command=None, enabled=True): |
| 220 | + icon = Icons("minus-box", color=RED).image |
193 | 221 | super().__init__( |
194 | 222 | master, |
195 | 223 | text=text, |
196 | | - icon=Icons("dash-square").image, |
| 224 | + icon=icon, |
197 | 225 | command=command, |
198 | 226 | enabled=enabled, |
199 | 227 | ) |
200 | 228 |
|
201 | 229 |
|
202 | 230 | class BtnDelete(_btn_Base): |
203 | 231 | def __init__(self, master, text=BTN_DELETE, command=None, enabled=True): |
| 232 | + icon = Icons("trash-can", color=LTGRAY).image |
204 | 233 | super().__init__( |
205 | 234 | master, |
206 | 235 | text=text, |
207 | | - icon=Icons("trash").image, |
| 236 | + icon=icon, |
208 | 237 | command=command, |
209 | 238 | enabled=enabled, |
210 | 239 | ) |
211 | 240 |
|
212 | 241 |
|
213 | 242 | class BtnLoad(_btn_Base): |
214 | 243 | def __init__(self, master, text=BTN_LOAD, command=None, enabled=True): |
| 244 | + icon = Icons("folder", color=GREEN).image |
215 | 245 | super().__init__( |
216 | 246 | master, |
217 | 247 | text=text, |
218 | | - icon=Icons("folder").image, |
| 248 | + icon=icon, |
219 | 249 | command=command, |
220 | 250 | enabled=enabled, |
221 | 251 | ) |
222 | 252 |
|
223 | 253 |
|
224 | 254 | class BtnSave(_btn_Base): |
225 | 255 | def __init__(self, master, text=BTN_SAVE, command=None, enabled=True): |
| 256 | + icon = Icons("floppy", color=CYAN).image |
226 | 257 | super().__init__( |
227 | 258 | master, |
228 | 259 | text=text, |
229 | | - icon=Icons("floppy").image, |
| 260 | + icon=icon, |
230 | 261 | command=command, |
231 | 262 | enabled=enabled, |
232 | 263 | ) |
233 | 264 |
|
234 | 265 |
|
235 | 266 | class BtnNew(_btn_Base): |
236 | 267 | def __init__(self, master, text=BTN_NEW, command=None, enabled=True): |
| 268 | + icon = Icons("file", color=WHITE).image |
237 | 269 | super().__init__( |
238 | 270 | master, |
239 | 271 | text=text, |
240 | | - icon=Icons("file").image, |
| 272 | + icon=icon, |
241 | 273 | command=command, |
242 | 274 | enabled=enabled, |
243 | 275 | ) |
244 | 276 |
|
245 | 277 |
|
246 | 278 | class BtnEdit(_btn_Base): |
247 | 279 | def __init__(self, master, text=BTN_EDIT, command=None, enabled=True): |
| 280 | + icon = Icons("file-edit", color=YELLOW).image |
248 | 281 | super().__init__( |
249 | 282 | master, |
250 | 283 | text=text, |
251 | | - icon=Icons("pencil-square").image, |
| 284 | + icon=icon, |
252 | 285 | command=command, |
253 | 286 | enabled=enabled, |
254 | 287 | ) |
255 | 288 |
|
256 | 289 |
|
257 | 290 | class BtnModify(_btn_Base): |
258 | 291 | def __init__(self, master, text=BTN_MODIFY, command=None, enabled=True): |
| 292 | + icon = Icons("pencil", color=YELLOW).image |
259 | 293 | super().__init__( |
260 | 294 | master, |
261 | 295 | text=text, |
262 | | - icon=Icons(name="pencil"), |
| 296 | + icon=icon, |
263 | 297 | command=command, |
264 | 298 | enabled=enabled, |
265 | 299 | ) |
266 | 300 |
|
267 | 301 |
|
268 | 302 | class BtnReset(_btn_Base): |
269 | 303 | def __init__(self, master, text=BTN_RESET, command=None, enabled=True): |
| 304 | + icon = Icons("power-cycle", color=RED).image |
270 | 305 | super().__init__( |
271 | 306 | master, |
272 | 307 | text=text, |
273 | | - icon=Icons(name="bootstrap-reboot"), |
| 308 | + icon=icon, |
274 | 309 | command=command, |
275 | 310 | enabled=enabled, |
276 | 311 | ) |
277 | 312 |
|
278 | 313 |
|
279 | 314 | class BtnReload(_btn_Base): |
280 | 315 | def __init__(self, master, text=BTN_RELOAD, command=None, enabled=True): |
| 316 | + icon = Icons("reload", color=GREEN).image |
281 | 317 | super().__init__( |
282 | 318 | master, |
283 | 319 | text=text, |
284 | | - icon=Icons(name="repeat"), |
| 320 | + icon=icon, |
285 | 321 | command=command, |
286 | 322 | enabled=enabled, |
287 | 323 | ) |
|
0 commit comments