More internal return type fixes.

This commit is contained in:
Eric Froemling 2020-04-10 02:09:47 -07:00
parent f801d1626b
commit d03d0e1045
2 changed files with 6 additions and 5 deletions

View File

@ -34,7 +34,7 @@ NOTE: This file was autogenerated by gendummymodule; do not edit by hand.
"""
# (hash we can use to see if this file is out of date)
# SOURCES_HASH=293498427545140555839175614948455855333
# SOURCES_HASH=126196922259492504803685031830587478733
# I'm sorry Pylint. I know this file saddens you. Be strong.
# pylint: disable=useless-suppression
@ -1987,8 +1987,8 @@ def get_connection_to_host_info() -> dict:
return dict()
def get_display_resolution() -> Tuple[int, int]:
"""get_display_resolution() -> Tuple[int, int]
def get_display_resolution() -> Optional[Tuple[int, int]]:
"""get_display_resolution() -> Optional[Tuple[int, int]]
(internal)

View File

@ -256,6 +256,7 @@ class GraphicsSettingsWindow(ba.Window):
on_value_change_call=self._set_gvr_render_target_scale)
else:
native_res = _ba.get_display_resolution()
assert native_res is not None
choices = ['Auto', 'Native']
choices_display = [
ba.Lstr(resource='autoText'),
@ -283,7 +284,7 @@ class GraphicsSettingsWindow(ba.Window):
# set pixel-scale instead
current_res = _ba.get_display_resolution()
if current_res is None:
current_res = (str(min(100, max(10, int(round(
current_res2 = (str(min(100, max(10, int(round(
ba.app.config.resolve('Screen Pixel Scale')
* 100.0))))) + '%') # yapf: disable
popup.PopupMenu(
@ -292,7 +293,7 @@ class GraphicsSettingsWindow(ba.Window):
width=120,
scale=popup_menu_scale,
choices=['100%', '88%', '75%', '63%', '50%'],
current_choice=current_res,
current_choice=current_res2,
on_value_change_call=self._set_pixel_scale)
else:
raise Exception('obsolete path; discrete resolutions'