KiCad PCB EDA Suite
|
Class to handle configuration and automatic determination of the DPI scale to use for canvases. More...
#include <dpi_scaling.h>
Public Member Functions | |
DPI_SCALING () | |
Construct a DPI scale provider. | |
virtual | ~DPI_SCALING () |
virtual double | GetScaleFactor () const =0 |
Get the DPI scale from all known sources in order: | |
virtual double | GetContentScaleFactor () const =0 |
Get the content scale factor, which may be different from the scale factor on some platforms. | |
virtual bool | GetCanvasIsAutoScaled () const =0 |
Is the current value auto scaled, or is it user-set in the config. | |
virtual void | SetDpiConfig (bool aAuto, double aValue)=0 |
Set the common DPI config in a given config object. | |
Static Public Member Functions | |
static double | GetMaxScaleFactor () |
static double | GetMinScaleFactor () |
static double | GetDefaultScaleFactor () |
Get the "default" scaling factor to use if not other config is available. | |
Class to handle configuration and automatic determination of the DPI scale to use for canvases.
This has several sources and the availability of some of them are platform dependent.
Definition at line 35 of file dpi_scaling.h.
|
inline |
Construct a DPI scale provider.
aConfig | the config store to check for a user value (can be nullptr, in which case on automatically determined values are considered) |
aWindow | a WX window to use for automatic DPI determination |
Definition at line 46 of file dpi_scaling.h.
|
inlinevirtual |
Definition at line 48 of file dpi_scaling.h.
|
pure virtual |
Is the current value auto scaled, or is it user-set in the config.
Implemented in DPI_SCALING_COMMON.
|
pure virtual |
Get the content scale factor, which may be different from the scale factor on some platforms.
This value should be used for scaling user interface elements (fonts, icons, etc) whereas the scale factor should be used for scaling canvases.
Implemented in DPI_SCALING_COMMON.
|
static |
Get the "default" scaling factor to use if not other config is available.
Definition at line 42 of file dpi_scaling.cpp.
Referenced by DPI_SCALING_COMMON::GetContentScaleFactor(), DPI_SCALING_COMMON::GetScaleFactor(), and PANEL_COMMON_SETTINGS::PANEL_COMMON_SETTINGS().
|
static |
Definition at line 27 of file dpi_scaling.cpp.
Referenced by PANEL_COMMON_SETTINGS::PANEL_COMMON_SETTINGS().
|
static |
Definition at line 35 of file dpi_scaling.cpp.
Referenced by PANEL_COMMON_SETTINGS::PANEL_COMMON_SETTINGS().
|
pure virtual |
Get the DPI scale from all known sources in order:
Implemented in DPI_SCALING_COMMON.
|
pure virtual |
Set the common DPI config in a given config object.
The encoding of the automatic/manual nature of the config is handled internally.
aAuto | store a value meaning "no user-set scale" |
aValue | the value to store (ignored if aAuto set) |
Implemented in DPI_SCALING_COMMON.