Factor info print into func

epoch_index_backup
Tyler Goodlet 2022-11-17 16:05:22 -05:00
parent e618d13fc9
commit 6f0b1ea283
1 changed files with 28 additions and 41 deletions

View File

@ -38,13 +38,16 @@ main_widget = QtWidgets.QWidget()
window.setCentralWidget(main_widget)
window.show()
# TODO: move widget through multiple displays and auto-detect the pixel
# ratio? (probably is gonna require calls to i3ipc on linux)..
pxr = main_widget.devicePixelRatioF()
# screen_num = app.desktop().screenNumber()
# TODO: how to detect list of displays from API?
# screen = app.screens()[screen_num]
screen = app.screenAt(main_widget.geometry().center())
def ppscreeninfo(screen: 'QScreen') -> None:
# screen_num = app.desktop().screenNumber()
name = screen.name()
size = screen.size()
geo = screen.availableGeometry()
@ -65,27 +68,11 @@ print(
print('-'*50 + '\n')
screen = app.screenAt(main_widget.geometry().center())
ppscreeninfo(screen)
screen = app.primaryScreen()
name = screen.name()
size = screen.size()
geo = screen.availableGeometry()
phydpi = screen.physicalDotsPerInch()
logdpi = screen.logicalDotsPerInch()
rr = screen.refreshRate()
print(
# f'screen number: {screen_num}\n',
f'screen: {name}\n'
f' size: {size}\n'
f' geometry: {geo}\n'
f' logical dpi: {logdpi}\n'
f' devicePixelRationF(): {pxr}\n'
f' physical dpi: {phydpi}\n'
f' refresh rate: {rr}\n'
)
print('-'*50 + '\n')
ppscreeninfo(screen)
# app-wide font
font = QtGui.QFont("Hack")