Flip to using scaled hi DPI detected by Qt
parent
bb1c549d94
commit
193f4f945c
|
@ -32,8 +32,10 @@ log = get_logger(__name__)
|
||||||
# chart-wide fonts specified in inches
|
# chart-wide fonts specified in inches
|
||||||
_font_sizes: Dict[str, Dict[str, float]] = {
|
_font_sizes: Dict[str, Dict[str, float]] = {
|
||||||
'hi': {
|
'hi': {
|
||||||
'default': 0.0616,
|
# 'default': 0.0616,
|
||||||
'small': 0.055,
|
'default': 0.0616 * 2,
|
||||||
|
# 'small': 0.055,
|
||||||
|
'small': 6/66 * (1 + 6/16),
|
||||||
},
|
},
|
||||||
'lo': {
|
'lo': {
|
||||||
'default': 6.5 / 64,
|
'default': 6.5 / 64,
|
||||||
|
@ -95,7 +97,7 @@ class DpiAwareFont:
|
||||||
# take the max since scaling can make things ugly in some cases
|
# take the max since scaling can make things ugly in some cases
|
||||||
pdpi = screen.physicalDotsPerInch()
|
pdpi = screen.physicalDotsPerInch()
|
||||||
ldpi = screen.logicalDotsPerInch()
|
ldpi = screen.logicalDotsPerInch()
|
||||||
dpi = max(pdpi, ldpi)
|
dpi = min(pdpi, ldpi)
|
||||||
|
|
||||||
# for low dpi scale everything down
|
# for low dpi scale everything down
|
||||||
if dpi <= 97:
|
if dpi <= 97:
|
||||||
|
@ -105,8 +107,8 @@ class DpiAwareFont:
|
||||||
|
|
||||||
font_size = math.floor(inches * dpi)
|
font_size = math.floor(inches * dpi)
|
||||||
log.info(
|
log.info(
|
||||||
f"\nscreen:{screen.name()} with DPI: {dpi}"
|
f"\nscreen:{screen.name()} with pDPI: {pdpi}, lDPI: {ldpi}"
|
||||||
f"\nbest font size is {font_size}\n"
|
f"\nbest font size is {font_size} for min dpi {dpi}\n"
|
||||||
)
|
)
|
||||||
|
|
||||||
self._set_qfont_px_size(font_size)
|
self._set_qfont_px_size(font_size)
|
||||||
|
|
Loading…
Reference in New Issue