You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Chapters/toplo/skinningAWidget.md
+8-22Lines changed: 8 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,12 +2,11 @@
2
2
3
3
In this chapter we show how we can take the simple input widget developed in a previous chapter and make it skinnable.
4
4
5
-
In a first period, we will focus on what is called raw skins. The idea behind raw skins are that we define classes with states and methods to define the behavior of a skin in a given theme. At the end of this chapter we will see that we can also skin widgets
6
-
using stylesheets following the spirit of CSS.
5
+
In a first period, we will focus on what is called raw skins. The idea behind raw skins are that we define classes with states and methods to define the behavior of a skin in a given theme. At the end of this chapter we will see that we can also skin widgets using stylesheets following the spirit of CSS.
7
6
8
7
The outline of this chapter is then: first we show that we can extend a theme and define a skin.
9
8
Then in a second time we show that we can define an autonomous theme.
10
-
Finally we will show that we can use stylesheet
9
+
Finally we will show that we can use stylesheet.
11
10
12
11
Remember that we want to create a widget as shown in Figure *@inputFinalSkin@*.
13
12
@@ -16,13 +15,12 @@ Remember that we want to create a widget as shown in Figure *@inputFinalSkin@*.
16
15
### Getting started
17
16
18
17
If you implemented the widget as presented earlier, just copy the class giving it a new name for example `ToIntegerInputElement`.
19
-
The definition of the `BlIntegerInputElement` is available SD:DefineAPlace.
20
18
21
19
The first thing that we should do is to make `ToIntegerInputElement` inherit from `ToElement` as follows:
Here we redefine the background of the element and its 'plus' and 'minus' sub-elements, but we also define a border to our element using tokens from our theme.
85
83
We accessed our element through the event received, this can be done in both following ways
86
84
87
-
88
-
##### Remark
89
-
Notice that the two following forms are equivalent.
90
-
This is important if you want to maximize
91
-
92
85
```
93
86
anEvent elementDo: [ :e |
94
87
e border: (e valueOfTokenNamed: #'color-border-checkable’).
0 commit comments