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
- Returns the (possibly casted) value that was set
73
76
74
-
Note from the above that values assigned to l/t/r/b are not kept in properties
77
+
Take note above that values assigned to l/t/r/b are not kept in properties
75
78
of the same name, but setting e.g. `rleft=(value)` actually saves the value to
76
79
`self.position.left`.
77
80
78
-
Thus, it is these fields in `self.position.*` that contains values directly as
79
-
specified by user (e.g. 30, "center", "30%" etc.)
81
+
Thus, it is these fields in `self.position.*` that contain values directly as
82
+
specified by user (e.g. 30, "center", "30%" etc.).
80
83
81
-
See more in `lib/widgets/element.js:1369` if interested.
84
+
See more in Blessed's `lib/widgets/element.js:1369` if interested.
82
85
83
86
### Getters
84
87
@@ -97,7 +100,7 @@ based on absolute coordinates. The code is simple:
97
100
98
101
### Setters
99
102
100
-
Setting `width` and `height`behaves the same as setting "r" fields:
103
+
Setting `width` and `height`works the same like setting "r" fields described above:
101
104
102
105
- If value is an integer passed as a string, casts to int
103
106
- Emits `Resize` event on self
@@ -123,7 +126,7 @@ If left or top value is 'center', then widget's size will be first set to 50% of
123
126
The largest possible space (width or height) is calculated while taking all restrictions into account. In other words, the calculated space
124
127
is limited by the size of parent, amount of parent's "i" values (inner thickness, explained below), and the current widget's desired left/top/right/bottom values.
125
128
126
-
Therefore, a value of null is very different from setting "100%". Setting 100% or any percentage translates to direct percentage of parent's size,
129
+
Therefore, a value of null is very different from setting "100%". Setting 100% or any other percentage translates to direct percentage of parent's size,
127
130
without accounting for "i" or desired left/top/right/bottom values.
128
131
129
132
## Absolute position
@@ -135,7 +138,7 @@ without accounting for "i" or desired left/top/right/bottom values.
135
138
136
139
### Setters
137
140
138
-
There is no place to store the absolute and relative position separately among widget's data (in `self.position.*`).
141
+
There is no place in widgets' properties to store the absolute and relative position separately (in `self.position.*`).
139
142
140
143
Setting "a" values works similarly to the "r" values. Blessed just subtracts
141
144
the parent's value from the current widget's value to convert absolute to
@@ -161,21 +164,21 @@ of the render. These coordinates are in essence the same as position and size in
161
164
should match 1:1. The only exception/problem is if a widget is moved somehow and lpos values are not
162
165
updated.
163
166
164
-
But, as Blessed's author says: "However, if we can guarantee that lpos is good and up to date, it can
165
-
be more accurate than the calculated position.
167
+
But, as Blessed's author says:
166
168
169
+
"However, if we can guarantee that lpos is good and up to date, it can be more accurate than the
170
+
calculated position.
167
171
If the element is being rendered, it's guaranteed that the parent will have been rendered first, in
168
172
which case we can use the parent's lpos instead of recalculating its position (since that might be
169
-
wrong because it doesn't handle content shrinkage)".
170
-
171
-
Thus, all getter functions have an optional parameter `get`, which defaults to false. When it is
172
-
false, we simply use parent widget to access its width/height, "a" values and "i" values.
173
+
wrong because it doesn't handle content shrinkage)."
173
174
174
-
When value of `get` is true, then Blessed does not use parent directly, but looks up its
175
+
Thus, all getter functions have an optional parameter `get`, which defaults to false:
176
+
- When it is false, we simply use parent widget to access its width/height, "a" values and "i" values.
177
+
- When value of `get` is true, then Blessed does not use parent directly, but looks up its
175
178
lpos. It returns parent's lpos as-is if its `aleft` (and implicitly all other 'a' values) are
176
179
filled in. If they are not filled in, Blessed first produces them and then returns the lpos object
177
-
which can be used in place of the parent. It produces "a" values based on screen width/height and
178
-
xi...xl, yi...yl values that are/must be already present.
180
+
which can be used in place of parent's calculated values. It produces "a" values based on screen
181
+
width/height and xi...xl, yi...yl values that are/must be already present.
179
182
180
183
All position-related functions use `get=false`.
181
184
@@ -235,3 +238,9 @@ them all inside `position` hash. If they're given separately, Blessed packs them
235
238
236
239
One can also specify `shrink = true` on a widget. This causes widget to render in minimal
237
240
necessary box to accommodate its content.
241
+
242
+
## Changes in Crysterm
243
+
244
+
In Crysterm borders can be more than 1 cell big and can be set for each side separately.
245
+
246
+
Similarly, shadow size and sides can be chosen and set individually for each side.
0 commit comments