@@ -179,9 +179,9 @@ impl ListItemContent for PropertyContent<'_> {
179
179
} = * self ;
180
180
181
181
// │ │
182
- // │◀───────────────────────────── background_x_range──── ─────────────────────────▶│
182
+ // │◀─────────────────────layout_info. background_x_range─────────────────────────▶│
183
183
// │ │
184
- // │ ◀───────────state .left_column_width─── ─────────▶│┌──COLUMN_SPACING │
184
+ // │ ◀────────layout_info .left_column_width─────────▶│┌──COLUMN_SPACING │
185
185
// │ ▼ │
186
186
// │ ◀─────────────────────────┼────────context.rect──────▶ │
187
187
// │ ┌ ─ ─ ─ ─ ┬ ─ ─ ─ ─ ┬ ┬────────┬─┬─────────────┬─┬─────────────┬─┬─────────┐ │
@@ -192,18 +192,17 @@ impl ListItemContent for PropertyContent<'_> {
192
192
// │ │ │ │ │││ │ │ │ │
193
193
// │ └ ─ ─ ─ ─ ┴ ─ ─ ─ ─ ┴ ┴────────┴─┴─────────────┴─┴─────────────┴─┴─────────┘ │
194
194
// │ ▲ ▲ ▲ │ ▲ │
195
- // │ └──state.left_x │ └───────────────────────────────┤ │
195
+ // │ └──layout_info.left │ └───────────────────────────────┤ │
196
196
// │ │ ▲ │ │
197
- // │ content_left_x──┘ mid_point_x───┘ text_to_icon_padding │
197
+ // │ content_left_x──┘ mid_point_x───┘ text_to_icon_padding() │
198
198
// │ │
199
199
200
- let state = super :: StateStack :: top ( ui. ctx ( ) ) ;
201
-
202
200
let content_left_x = context. rect . left ( ) ;
203
201
// Total indent left of the content rect. This is part of the left column width.
204
- let content_indent = content_left_x - state. left_x ;
205
- let mid_point_x = state. left_x
206
- + state
202
+ let content_indent = content_left_x - context. layout_info . left_x ;
203
+ let mid_point_x = context. layout_info . left_x
204
+ + context
205
+ . layout_info
207
206
. left_column_width
208
207
. unwrap_or_else ( || content_indent + ( context. rect . width ( ) / 2. ) . at_least ( 0.0 ) ) ;
209
208
@@ -217,7 +216,7 @@ impl ListItemContent for PropertyContent<'_> {
217
216
let action_button_dimension =
218
217
ReUi :: small_icon_size ( ) . x + 2.0 * ui. spacing ( ) . button_padding . x ;
219
218
let reserve_action_button_space =
220
- action_buttons. is_some ( ) || state . reserve_action_button_space ;
219
+ action_buttons. is_some ( ) || context . layout_info . reserve_action_button_space ;
221
220
let action_button_extra = if reserve_action_button_space {
222
221
action_button_dimension + ReUi :: text_to_icon_padding ( )
223
222
} else {
@@ -258,10 +257,12 @@ impl ListItemContent for PropertyContent<'_> {
258
257
( content_indent + icon_extra + desired_galley. size ( ) . x + Self :: COLUMN_SPACING / 2.0 )
259
258
. ceil ( ) ;
260
259
261
- super :: StateStack :: top_mut ( ui. ctx ( ) , |state| {
262
- state. register_desired_left_column_width ( desired_width) ;
263
- state. reserve_action_button_space ( action_buttons. is_some ( ) ) ;
264
- } ) ;
260
+ context
261
+ . layout_info
262
+ . register_desired_left_column_width ( ui. ctx ( ) , desired_width) ;
263
+ context
264
+ . layout_info
265
+ . reserve_action_button_space ( ui. ctx ( ) , action_buttons. is_some ( ) ) ;
265
266
266
267
let galley = if desired_galley. size ( ) . x <= label_rect. width ( ) {
267
268
desired_galley
0 commit comments