Shrink the window size to fit on smaller screens.

This commit is contained in:
PySimpleGUI 2021-08-15 18:59:27 -04:00
parent 1591003a83
commit ef7c7b3096
1 changed files with 3 additions and 3 deletions

View File

@ -668,7 +668,7 @@ color_map = {
sg.popup_quick_message('Building your table... one moment please...', background_color='red', text_color='white', font='_ 20') sg.popup_quick_message('Building your table... one moment please...', background_color='red', text_color='white', font='_ 20')
sg.set_options(button_element_size=(12, 1), sg.set_options(button_element_size=(11, 1),
element_padding=(0, 0), element_padding=(0, 0),
auto_size_buttons=False, auto_size_buttons=False,
border_width=0, tooltip_time=100) border_width=0, tooltip_time=100)
@ -694,8 +694,8 @@ total_rows = num_colors//colors_per_row
# justification='center', font='Default 20')]] + [[sg.Button(color_list[row_num + i * total_rows], button_color=('black', color_list[row_num + i * total_rows]), key=color_list[row_num + i * total_rows], tooltip=color_map[color_list[row_num + i * total_rows]], border_width=0) for i in range(colors_per_row)] for row_num in range(total_rows)] # justification='center', font='Default 20')]] + [[sg.Button(color_list[row_num + i * total_rows], button_color=('black', color_list[row_num + i * total_rows]), key=color_list[row_num + i * total_rows], tooltip=color_map[color_list[row_num + i * total_rows]], border_width=0) for i in range(colors_per_row)] for row_num in range(total_rows)]
window = sg.Window('Color Viewer', window = sg.Window('Color Viewer',
[[sg.Text('Hover mouse to see RGB value, click for popup with buttons', justification='center', font='Default 20')]] + [[sg.Text('Hover mouse to see RGB value, click for popup with buttons', justification='center', font='Default 15')]] +
[[sg.Button(color_list[row_num + i * total_rows], button_color=('black', color_list[row_num + i * total_rows]), key=color_list[row_num + i * total_rows], tooltip=color_map[color_list[row_num + i * total_rows]], border_width=0) for i in range(colors_per_row)] for row_num in range(total_rows)], font='Default 9', element_justification='c', use_default_focus=False) [[sg.Button(color_list[row_num + i * total_rows], button_color=('black', color_list[row_num + i * total_rows]), key=color_list[row_num + i * total_rows], tooltip=color_map[color_list[row_num + i * total_rows]], border_width=0) for i in range(colors_per_row)] for row_num in range(total_rows)], font='Default 7', element_justification='c', use_default_focus=False)
# -- Event loop -- # -- Event loop --
while True: while True: