From e63d61cb739fd9c81ebc41d4964960bd5b53cf6f Mon Sep 17 00:00:00 2001 From: Cristian Maureira-Fredes Date: Thu, 10 Jun 2021 20:59:28 +0200 Subject: examples: add default image Adding a default image for examples that have no screenshot yet, or are terminal based. Task-number: PYSIDE-841 Change-Id: I771173801218654a99f11d1062df12aa10a64eec Reviewed-by: Friedemann Kleint (cherry picked from commit d0c6c06df04ee23fe523b477e9fb2a508cf78f3e) Reviewed-by: Qt Cherry-pick Bot --- sources/pyside6/doc/example_no_image.png | Bin 0 -> 65484 bytes tools/example_gallery/main.py | 10 ++++++---- 2 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 sources/pyside6/doc/example_no_image.png diff --git a/sources/pyside6/doc/example_no_image.png b/sources/pyside6/doc/example_no_image.png new file mode 100644 index 000000000..626714074 Binary files /dev/null and b/sources/pyside6/doc/example_no_image.png differ diff --git a/tools/example_gallery/main.py b/tools/example_gallery/main.py index 8cc156101..1c37a8670 100644 --- a/tools/example_gallery/main.py +++ b/tools/example_gallery/main.py @@ -96,7 +96,7 @@ def get_module_gallery(examples): gallery = ( ".. panels::\n" f"{ind(1)}:container: container-lg pb-3\n" - f"{ind(1)}:column: col-lg-3 col-md-3 col-sm-6 col-xs-12 p-2\n\n" + f"{ind(1)}:column: col-lg-3 col-md-6 col-sm-6 col-xs-12 p-2\n\n" ) # Iteration per rows @@ -116,10 +116,12 @@ def get_module_gallery(examples): gallery += f"{ind(1)}---\n" if e["img_doc"]: - gallery += f"{ind(1)}:img-top: {e['img_doc'].name}\n" - gallery += f"{ind(1)}:img-top-cls: + d-flex align-self-center\n\n" + img_name = e['img_doc'].name else: - gallery += "\n" + img_name = "../example_no_image.png" + + gallery += f"{ind(1)}:img-top: {img_name}\n" + gallery += f"{ind(1)}:img-top-cls: + d-flex align-self-center\n\n" gallery += f"{ind(1)}`{name} <{url}>`_\n" -- cgit v1.2.3