GUIBRUSHR.GUI.LAYOUT.ScaleManager module

ScaleManager - Singleton that manages named fonts and handles responsive scaling.

When the main window is resized, all named Font objects are updated automatically, causing every widget that references them to redraw at the new size.

All configurable values (reference height, scale limits, font families, base sizes) are read from graphics.yaml via GraphicsConfig.

class GUIBRUSHR.GUI.LAYOUT.ScaleManager.ScaleManager(root)[source]

Bases: object

classmethod init(root)[source]

Initialize the singleton instance. Must be called once after tk.Tk() is created.

Parameters:

root – The root tkinter Tk widget.

Returns:

The singleton instance.

Return type:

ScaleManager

classmethod get()[source]

Get the singleton instance.

Returns:

The singleton instance, or None if init() has not been called.

Return type:

ScaleManager or None

__init__(root)[source]

Initialize the ScaleManager with the root tkinter widget.

Parameters:

root – The root tkinter Tk widget used for resize event binding.

property scale

The current scale factor (float).

scaled(base_size)[source]

Get a scaled integer size for one-off uses.

Parameters:

base_size – The base font size to scale.

Returns:

The scaled size, with a minimum of 7.

Return type:

int