Skip to content

Commit

Permalink
Add screenshots of simple windows on mobile.
Browse files Browse the repository at this point in the history
  • Loading branch information
freakboy3742 committed Nov 26, 2023
1 parent 3c80bc4 commit 7c186a0
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 42 deletions.
5 changes: 2 additions & 3 deletions docs/reference/api/app.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,8 @@ format compatible with :any:`importlib.metadata`. If you deploy your app with `B
Assigning a main window
-----------------------

An app *must* assign :any:`~toga.App.main_window` as part of the startup process.
However, the value that is assigned as the main window will affect the behavior of the
app.
An app *must* assign ``main_window`` as part of the startup process. However, the value
that is assigned as the main window will affect the behavior of the app.

Normal app
~~~~~~~~~~
Expand Down
40 changes: 14 additions & 26 deletions docs/reference/api/documentmainwindow.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
MainWindow
==========
DocumentMainWindow
==================

A main window representing a document.

Expand All @@ -23,42 +23,30 @@ A main window representing a document.
:align: center
:width: 450px

.. group-tab:: Android
.. group-tab:: Android |no|

.. figure:: /reference/images/mainwindow-android.png
:align: center
:width: 450px

.. group-tab:: iOS

.. figure:: /reference/images/mainwindow-iOS.png
:align: center
:width: 450px
Not supported

.. group-tab:: Web |beta|
.. group-tab:: iOS |no|

.. .. figure:: /reference/images/mainwindow-web.png
.. :align: center
.. :width: 300px
Not supported

Screenshot not available
.. group-tab:: Web |no|

.. group-tab:: Textual |beta|
Not supported

.. .. figure:: /reference/images/mainwindow-textual.png
.. :align: center
.. :width: 300px
.. group-tab:: Textual |no|

Screenshot not available
Not supported

Usage
-----

A DocumentMainWindow is a normal :class:`toga.MainWindow`, except that it is bound to a
specific :any:`toga.Document`` instance.
A DocumentMainWindow is a normal :any:`toga.MainWindow`, except that it is bound to a
specific :any:`toga.Document` instance.

Instances of :any:`~toga.DocumentMainWindow` should be created as part of the
:any:`~toga.Document.create()` method of an implementation of :any:`toga.Document`.
Instances of DocumentMainWindow should be created as part of the ``create()`` method of
an implementation of :any:`toga.Document`.

Reference
---------
Expand Down
4 changes: 1 addition & 3 deletions docs/reference/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,9 @@ Other
:hidden:

app
simpleapp
windowlessapp
documentapp
window
mainwindow
documentmainwindow
containers/index
resources/index
widgets/index
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/api/resources/document.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ macOS

On macOS, there is only ever a single instance of an App running at any given time. That
instance can manage multiple documents. If you use the Finder to open a second document
of a type managed by then App, it will be opened in the existingn App instance. Closing
of a type managed by then App, it will be opened in the existing App instance. Closing
all documents will not cause the app to exit; the app will keep executing until
explicitly exited.

Expand Down
22 changes: 13 additions & 9 deletions docs/reference/api/window.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@ An operating system-managed container of widgets.
:align: center
:width: 300px

.. group-tab:: Android |no|
.. group-tab:: Android

Not supported
.. figure:: /reference/images/window-android.png
:align: center
:width: 300px

.. group-tab:: iOS |no|
.. group-tab:: iOS

Not supported
.. figure:: /reference/images/window-iOS.png
:align: center
:width: 300px

.. group-tab:: Web |no|

Expand Down Expand Up @@ -85,11 +89,11 @@ Notes
avoid making UI design decisions that are dependent on specific size and
placement of windows.

* A mobile application can only have a single window (the :class:`~toga.MainWindow`),
and that window cannot be moved, resized, hidden, or made full screen. Toga will raise
an exception if you attempt to create a secondary window on a mobile platform. If you
try to modify the size, position, or visibility of the main window, the request will
be ignored.
* A mobile application can only have a single window (the ``main_window``), and that
window cannot be moved, resized, hidden, or made full screen. Toga will raise an
exception if you attempt to create a secondary window on a mobile platform. If you try
to modify the size, position, or visibility of the main window, the request will be
ignored.

Reference
---------
Expand Down
Binary file added docs/reference/images/window-android.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/reference/images/window-iOS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7c186a0

Please sign in to comment.