@@ -109,49 +109,52 @@ A UIStyle is a typed description of available style options.
109
109
For the UIFlatButton the supported attributes are:
110
110
111
111
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
+ `````````````
128
128
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
+ ============ ======================================================
137
137
138
138
139
139
Advanced
140
140
========
141
141
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.
144
144
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:
146
147
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.
149
151
150
152
151
153
Tha basic idea:
152
154
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.
155
158
156
159
Your own stylable widget
157
160
````````````````````````
@@ -168,7 +171,6 @@ Your own stylable widget
168
171
class UIStyle(UIStyleBase):
169
172
color: RGBA255 = arcade.color.GREEN
170
173
171
-
172
174
DEFAULT_STYLE = {
173
175
"normal": UIStyle(),
174
176
"hover": UIStyle(color=arcade.color.YELLOW),
0 commit comments