Skip to content

Commit 5052e2e

Browse files
authored
Formatting fixes (#2272)
1 parent 74e30fe commit 5052e2e

File tree

1 file changed

+34
-32
lines changed

1 file changed

+34
-32
lines changed

doc/programming_guide/gui/style.rst

Lines changed: 34 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -109,49 +109,52 @@ A UIStyle is a typed description of available style options.
109109
For the UIFlatButton the supported attributes are:
110110

111111

112-
================ ================= ===================== ==================================
113-
Name Type Default value Description
114-
================ ================= ===================== ==================================
115-
font_size int 12 Size of the text on the button
116-
font_name FontNameOrNames ("calibri", "arial") Font of the text
117-
font_color RGBA255 arcade.color.WHITE Color of text
118-
bg RGBA255 (21, 19, 21, 255) Background color
119-
border Optional None Border color
120-
border_width int 0 Border width
121-
================ ================= ===================== ==================================
122-
123-
The style attribute is a dictionary, which maps a state like 'normal, 'hover' etc.
124-
to an instance of UIFlatButton.UIStyle.
125-
126-
Wellknown states
127-
````````````````
112+
================ =================== ======================== ==================================
113+
Name Type Default value Description
114+
================ =================== ======================== ==================================
115+
``font_size`` ``int`` 12 Size of the text on the button
116+
``font_name`` ``FontNameOrNames`` ``("calibri", "arial")`` Font of the text
117+
``font_color`` ``RGBA255`` ``arcade.color.WHITE`` Color of text
118+
``bg`` ``RGBA255`` ``(21, 19, 21, 255)`` Background color
119+
``border`` ``Optional`` ``None`` Border color
120+
``border_width`` ``int`` 0 Border width
121+
================ =================== ======================== ==================================
122+
123+
The style attribute is a dictionary, which maps states such as ``normal``, ``hover``, ``press``,
124+
and ``disabled`` to an instance of the class's ``UIStyle``.
125+
126+
Common states
127+
`````````````
128128

129-
======== ======================================================
130-
Name Description
131-
======== ======================================================
132-
normal The default state of a widget.
133-
hover Mouse hovered over an interactive widget.
134-
press Mouse is pressed while hovering over the widget.
135-
disabled The widget is disabled.
136-
======== ======================================================
129+
============ ======================================================
130+
Name Description
131+
============ ======================================================
132+
``normal`` The default state of a widget.
133+
``hover`` The mouse is hovered over an interactive widget.
134+
``press`` The mouse is pressed while hovering over the widget.
135+
``disabled`` The widget is disabled.
136+
============ ======================================================
137137

138138

139139
Advanced
140140
========
141141

142-
This section describes the styling system itself,
143-
and how it can be used to create own stylable widgets or extend existing ones.
142+
This section describes the styling system itself, and how it can be used to
143+
create your own stylable widgets or extend existing ones.
144144

145-
Stylable widgets inherit from `UIStyledWidget`, which provides two basic features:
145+
Stylable widgets inherit from :py:meth:`~arcade.gui.UIStyledWidget`, which
146+
provides two basic features:
146147

147-
1. owns a style property, which provides a mapping between a widgets state and style to be applied
148-
2. provides an abstractmethod which have to provide a state (which is a simple string)
148+
1. A :py:attr:`~arcade.gui.UIStyledWidget.style` property, which provides a
149+
mapping between a widget's state and style to be applied.
150+
2. Provides an ``abstractmethod`` to provide a state, which is a simple string.
149151

150152

151153
Tha basic idea:
152154

153-
- a stylable widget has a state (e.g. 'normal', 'hover', 'press', or 'disabled')
154-
- the state is used to define, which style will be applied
155+
- A stylable widget has a state, which can be ``normal``, ``hover``, ``press``,
156+
or ``disabled``.
157+
- The state is used to define which style will be applied.
155158

156159
Your own stylable widget
157160
````````````````````````
@@ -168,7 +171,6 @@ Your own stylable widget
168171
class UIStyle(UIStyleBase):
169172
color: RGBA255 = arcade.color.GREEN
170173
171-
172174
DEFAULT_STYLE = {
173175
"normal": UIStyle(),
174176
"hover": UIStyle(color=arcade.color.YELLOW),

0 commit comments

Comments
 (0)