1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-16 09:10:35 +03:00

Merge pull request #1404 from A-UNDERSCORE-D/fix/1155/Include-geometry-window-position-in---reset-ui

Reset geometry and UI scale with --reset-ui
This commit is contained in:
Athanasius 2022-01-20 14:08:43 +00:00 committed by GitHub
commit 3cb2c23257
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -74,7 +74,7 @@ if __name__ == '__main__': # noqa: C901
###########################################################################
parser.add_argument(
'--reset-ui',
help='reset UI theme and transparency to defaults',
help='Reset UI theme, transparency, font, font size, ui scale, and ui geometry to default',
action='store_true'
)
###########################################################################
@ -1865,9 +1865,13 @@ sys.path: {sys.path}'''
if args.reset_ui:
config.set('theme', 0) # 'Default' theme uses ID 0
config.set('ui_transparency', 100) # 100 is completely opaque
config.delete('font')
config.delete('font_size')
logger.info('reset theme, font, font size, and transparency to default.')
config.delete('font', suppress=True)
config.delete('font_size', suppress=True)
config.set('ui_scale', 100) # 100% is the default here
config.delete('geometry', suppress=True) # unset is recreated by other code
logger.info('reset theme, transparency, font, font size, ui scale, and ui geometry to default.')
# We prefer a UTF-8 encoding gets set, but older Windows versions have
# issues with this. From Windows 10 1903 onwards we can rely on the