File tree Expand file tree Collapse file tree 1 file changed +10
-13
lines changed
Expand file tree Collapse file tree 1 file changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -55,20 +55,17 @@ def _get_theme_orientation() -> Orientation:
5555
5656
5757def _get_theme_size () -> tuple [int , int ]:
58- if config .THEME_DATA ["display" ].get ("DISPLAY_SIZE" , '' ) == '0.96"' :
59- return 80 , 160
60- if config .THEME_DATA ["display" ].get ("DISPLAY_SIZE" , '' ) == '2.1"' :
61- return 480 , 480
62- elif config .THEME_DATA ["display" ].get ("DISPLAY_SIZE" , '' ) == '3.5"' :
63- return 320 , 480
64- elif config .THEME_DATA ["display" ].get ("DISPLAY_SIZE" , '' ) == '5"' :
65- return 480 , 800
66- elif config .THEME_DATA ["display" ].get ("DISPLAY_SIZE" , '' ) == '8.8"' :
67- return 480 , 1920
68- else :
58+ sizes = {
59+ '0.96"' :(80 , 160 ),
60+ '2.1"' :(480 , 480 ),
61+ '3.5"' :(320 , 480 ),
62+ '5"' :(480 , 800 ),
63+ '8.8"' :(480 , 1920 ),
64+ }
65+ if config .THEME_DATA ["display" ].get ("DISPLAY_SIZE" , '' ) not in sizes .keys ():
6966 logger .warning (
70- f'Cannot find valid DISPLAY_SIZE property in selected theme { config .CONFIG_DATA ["config" ]["THEME" ]} , defaulting to 3.5"' )
71- return 320 , 480
67+ f'Cannot find valid DISPLAY_SIZE property in selected theme { config .CONFIG_DATA ["config" ]["THEME" ]} , defaulting to 3.5"' )
68+ return sizes . get ( config . THEME_DATA [ "display" ]. get ( "DISPLAY_SIZE" , '' ), ( 320 , 480 ))
7269
7370
7471class Display :
You can’t perform that action at this time.
0 commit comments