[Feature request] Grid / Table layout helper or function
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
Línea de trabajo
Start by reviewing the existing nested-list layout behavior and the sg.Column API described in the issue, then compare them with the supplied GridLayout helper. Define how empty cells and consistent dimensions should work, and confirm that the proposed integration has clear tests or examples showing the resulting grid layout.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
I'd love something like sg.GridLayout(layout) or sg.TableLayout(layout) analogous to sg.Column(layout). An easy way to arrange elements in a grid.
This is already sort of the default when creating a layout as a nested list of rows where members are placed horizontally in each row, however currently there is no common delineation between those points in the default layout. This should definitely stay that way as it's a sensible way to handle things. Often though we might want elements to stack neatly on top of each with the same dimensions for a clean and readable layout.
This is the default look when layouting with the nested list:
This is the resulting look when wrapping the elements in a grid layout helper:
I'd love to discuss the possibilities for this. I've written a small helper function that can achieve this by itself, but any integration into the codebase will necessarily have to look different. If it would be useful to have though, I'll include that helper here:
def GridLayout(layout):
column_layout = []
columns_num = len(max(layout, key=len))
for i in range(columns_num):
column_list = []
for row_list in layout:
if i < len(row_list):
value = row_list[i]
if value == None: # This allows empty cells.
column_list.append([sg.Text("")])
else:
column_list.append([value])
else:
column_list.append([sg.Text("")])
column_layout.append(sg.Column(column_list))
return column_layout
Using None is the option I went with to allow leaving cells in the grid structure empty. As I'm pretty new with FreeSimpleGUI, I made empty cells happen with empty text elements, but a proper integration could surely do better.
I've been very pleased with FreeSimpleGUI so far, so if there's interest in this and I could get some guidance on how to best integrate something like this, I'd be happy to give it a shot myself when I find time. Any thoughts would be appreciated.
- Lenguaje dominante
- Python
- Estrellas
- 866
- Forks
- 106
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de spyoungtech/FreeSimpleGUI
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
spyoungtech/FreeSimpleGUI#109 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
spyoungtech/FreeSimpleGUI#86 · 1 comentario · 2 reacciones ·
-
Added - Dracula theme supportAbierto
Dificultad 3/5 1-2 días Aptitud para principiantes 64/100
spyoungtech/FreeSimpleGUI#110 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 58/100
spyoungtech/FreeSimpleGUI#101 · 8 reacciones ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
spyoungtech/FreeSimpleGUI#95 ·
Todos los issues de spyoungtech/FreeSimpleGUI
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
BasedHardware/omi#20271 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 92/100
openai/openai-cookbook#3153 ·
Los mantenedores suelen responder en 1 día
-
cvss-severity:high devguard l3montree-cybersecurity/devguard/devguard pkg:golang/github.com/l3montree-dev/devguard risk:low state:open
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
l3montree-dev/devguard#3146 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
-
bug confirmed issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
open-webui/open-webui#31849 · 2 comentarios ·
Los mantenedores suelen responder en 1 día