Commit bb0d582
committed
refactor: code improvements related to min/man calculations
Refactored in "AnalogGaugeWidget" class a few conditional
statements using Python's built-in "min()" and "max()"
functions with clear comments.
The new code is more Pythonic & readable.
1. "rescale_method()" method.
2. "update_value()" method - implemented a classic value
"clamping" operation (constraining a value to stay within a
min/max range). This is a well-known Python idiom for clamping values.
3. "set_MinValue()" & "set_MinValue()" methods.
4. "set_scala_main_count()" method.
Co-authored-by: Cursor AI
Signed-off-by: Pavel Bar <pbar@redhat.com>1 parent fd7a140 commit bb0d582
1 file changed
+13
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
| 115 | + | |
119 | 116 | | |
120 | 117 | | |
121 | 118 | | |
| |||
148 | 145 | | |
149 | 146 | | |
150 | 147 | | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
| 148 | + | |
| 149 | + | |
157 | 150 | | |
158 | 151 | | |
159 | 152 | | |
| |||
266 | 259 | | |
267 | 260 | | |
268 | 261 | | |
269 | | - | |
270 | | - | |
271 | | - | |
| 262 | + | |
| 263 | + | |
272 | 264 | | |
273 | 265 | | |
274 | 266 | | |
275 | 267 | | |
276 | 268 | | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
283 | 273 | | |
284 | 274 | | |
285 | 275 | | |
286 | 276 | | |
287 | 277 | | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
294 | 282 | | |
295 | 283 | | |
296 | 284 | | |
| |||
0 commit comments