|
game_launcher 1.1.0
Modern Linux game launcher with Steam / Proton / Wine integration
|
Functions | |
| qreal | primaryRatio () |
| The primary screen's device pixel ratio. | |
| QSize | scaleToPhysical (const QSize &logical) |
| Scale a QSize by the primary screen's DPR. Same rationale as above. | |
| int | scaleToPhysical (const QWidget *w, int logicalPixels) |
| Per-widget version of scaleToPhysical — preferred when the widget is on a non-primary monitor that might have a different DPR (mixed-DPI setups, common on Wayland). | |
| int | scaleToPhysical (int logicalPixels) |
| Scale a logical pixel count into a physical pixel count using the primary screen's DPR. | |
| qreal | widgetRatio (const QWidget *w) |
| Device pixel ratio of the screen a given widget is currently on. | |
|
inline |
The primary screen's device pixel ratio.
Returns 1.0 if Qt hasn't yet established a primary screen (edge cases during very-early initialisation).
Definition at line 36 of file dpr_utils.h.
Referenced by GameThumbnailCache::getGameThumbnail(), GameThumbnailCache::getHeroImage(), scaleToPhysical(), scaleToPhysical(), and widgetRatio().
|
inline |
Scale a QSize by the primary screen's DPR. Same rationale as above.
Definition at line 64 of file dpr_utils.h.
References primaryRatio().
|
inline |
Per-widget version of scaleToPhysical — preferred when the widget is on a non-primary monitor that might have a different DPR (mixed-DPI setups, common on Wayland).
Definition at line 74 of file dpr_utils.h.
References widgetRatio().
|
inline |
Scale a logical pixel count into a physical pixel count using the primary screen's DPR.
Intended for cases where we draw into backing pixmaps that don't get DPR-aware treatment automatically (e.g. QPixmap caches keyed by physical size).
Definition at line 58 of file dpr_utils.h.
References primaryRatio().
|
inline |
Device pixel ratio of the screen a given widget is currently on.
Falls back to the primary screen's DPR if w has no screen assignment yet.
Definition at line 45 of file dpr_utils.h.
References primaryRatio().
Referenced by scaleToPhysical().