Closed jpirnay closed 1 week ago
This PR fixes icon translation issues and adds functionality to set custom background colors for icons. The main changes involve replacing the use of GraphicsPath.Box with direct bbox calculations from Geomstr and implementing a new forced background color feature.
sequenceDiagram
participant User
participant IconManager
participant wxMemoryDC as wx.MemoryDC
participant wxGraphicsContext as wx.GraphicsContext
User->>IconManager: GetBitmap(..., forced_background)
IconManager->>IconManager: retrieve_bitmap(..., forced_background)
IconManager->>IconManager: prepare_bitmap(..., forced_background)
IconManager->>wxMemoryDC: Create MemoryDC
wxMemoryDC->>wxGraphicsContext: Create GraphicsContext
wxGraphicsContext-->>IconManager: Return GraphicsContext
IconManager-->>User: Return Bitmap with forced background
classDiagram
class IconManager {
- wx.Colour _background
- wx.Pen _pen
+ prepare_bitmap(final_icon_width, final_icon_height, buffer, forced_background)
+ retrieve_bitmap(color_dark, final_icon_width, final_icon_height, buffer, forced_background)
+ GetBitmap(color, final_icon_width, final_icon_height, force_darkmode, force_lightmode, buffer, resolution, forced_background)
}
class Geomstr {
+ bbox()
}
IconManager --> Geomstr : uses
note for IconManager "Added forced_background parameter to methods for custom icon background colors"
Change | Details | Files |
---|---|---|
Fixed icon boundary calculation by replacing GraphicsPath.Box with direct bbox calculations |
|
meerk40t/gui/icons.py |
Added support for custom background colors in icons |
|
meerk40t/gui/icons.py |
Enhanced material manager with colorful icon backgrounds |
|
meerk40t/gui/materialmanager.py |
Improved debug window initialization |
|
meerk40t/gui/mkdebug.py |
After:
Summary by Sourcery
Fix icon boundary calculation to correct shifted appearances and add functionality to set icon background colors for improved visual consistency.
Bug Fixes:
Enhancements: