-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlayouts.py
33 lines (27 loc) · 1.38 KB
/
layouts.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import PySimpleGUI
NAME_SIZE = 23
def name(name):
dots = NAME_SIZE - len(name) - 2
return PySimpleGUI.Text(name + ' ' +
'•' * dots,
size=(NAME_SIZE, 1), justification='r',
pad=(0, 0), font='Courier 10')
def get_layout(form: str, value: str = ''):
match form:
case 'MainWindow':
layout = [
[PySimpleGUI.Text('Folder'), PySimpleGUI.InputText(key='-FOLDER-'), PySimpleGUI.FolderBrowse()],
[PySimpleGUI.T('Extensions Setup: (Select which is needed, others will be deleted)')],
[name('SomeExtension'), PySimpleGUI.Checkbox('', key='-Ext-'),
name('SomeExtension1'), PySimpleGUI.Checkbox('', key='-Ext1-'),
name('SomeExtension2'), PySimpleGUI.Checkbox('', key='-Ext2-')],
[name('SomeExtension3'), PySimpleGUI.Checkbox('', key='-Ext3-'),
name('SomeExtension4'), PySimpleGUI.Checkbox('', key='-Ext4-'),
name('SomeExtension5'), PySimpleGUI.Checkbox('', key='-Ext5-')],
[PySimpleGUI.Submit(), PySimpleGUI.Cancel()]
]
case 'ErrorWindow':
layout = [
[PySimpleGUI.T(value)]
]
return layout