Skip to content

Commit acaffe6

Browse files
committed
Working table example
1 parent 161d51a commit acaffe6

File tree

3 files changed

+4
-27
lines changed

3 files changed

+4
-27
lines changed

azul-desktop/src/wr_translate.rs

+2-15
Original file line numberDiff line numberDiff line change
@@ -1314,12 +1314,10 @@ pub(crate) fn wr_translate_external_scroll_id(scroll_id: ExternalScrollId) -> Wr
13141314
}
13151315

13161316
pub(crate) fn wr_translate_display_list(input: CachedDisplayList, pipeline_id: PipelineId) -> WrBuiltDisplayList {
1317-
println!("{:#?}", input);
13181317
let root_space_and_clip = WrSpaceAndClipInfo::root_scroll(wr_translate_pipeline_id(pipeline_id));
13191318
let mut positioned_items = Vec::new();
13201319
let mut builder = WrDisplayListBuilder::new(wr_translate_pipeline_id(pipeline_id));
13211320
push_display_list_msg(&mut builder, input.root, root_space_and_clip.spatial_id, root_space_and_clip.clip_id, &mut positioned_items);
1322-
builder.dump_serialized_display_list();
13231321
let (_pipeline_id, built_display_list) = builder.finalize();
13241322
built_display_list
13251323
}
@@ -1407,7 +1405,7 @@ fn push_frame(
14071405
parent_clip_id: WrClipId,
14081406
positioned_items: &mut Vec<(WrSpatialId, WrClipId)>
14091407
) {
1410-
let clip_rect = get_frame_clip_rect(frame.position, frame.size);
1408+
let clip_rect = LogicalRect::new(LogicalPosition::zero(), frame.size); // get_frame_clip_rect(frame.position, frame.size);
14111409

14121410
for item in frame.content {
14131411
push_display_list_content(
@@ -1432,17 +1430,6 @@ fn push_frame(
14321430
}
14331431
}
14341432

1435-
fn get_frame_clip_rect(position_info: PositionInfo, rect_size: LogicalSize) -> LogicalRect {
1436-
match position_info {
1437-
PositionInfo::Static { x_offset, y_offset, .. } |
1438-
PositionInfo::Relative { x_offset, y_offset, .. } |
1439-
PositionInfo::Absolute { x_offset, y_offset, .. } |
1440-
PositionInfo::Fixed { x_offset, y_offset, .. } => {
1441-
LogicalRect::new(LogicalPosition::new(x_offset, y_offset), rect_size)
1442-
}
1443-
}
1444-
}
1445-
14461433
#[inline]
14471434
fn push_scroll_frame(
14481435
builder: &mut WrDisplayListBuilder,
@@ -1458,7 +1445,7 @@ fn push_scroll_frame(
14581445
ComplexClipRegion as WrComplexClipRegion,
14591446
};
14601447

1461-
let clip_rect = get_frame_clip_rect(scroll_frame.frame.position, scroll_frame.frame.size);
1448+
let clip_rect = LogicalRect::new(LogicalPosition::zero(), scroll_frame.frame.size);
14621449

14631450
// if let Some(image_mask) = scroll_frame.frame.image_mask { push_image_mask_clip() }
14641451

azul-widgets/src/table_view.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ impl TableViewState {
207207
Normal(CssProperty::background_content(StyleBackgroundContentVec::from_const_slice(COLOR_E6E6E6_BACKGROUND))),
208208
Normal(CssProperty::flex_direction(LayoutFlexDirection::Column)),
209209
Normal(CssProperty::box_shadow_right(SHADOW)),
210-
// Normal(CssProperty::transform(StyleTransformVec::from_const_slice(TEST_TRANSFORM))),
210+
Normal(CssProperty::transform(StyleTransformVec::from_const_slice(TEST_TRANSFORM))),
211211
];
212212
static ROW_NUMBERS_CONTAINER_CLASS: &[IdOrClass] = &[
213213
IdOrClass::Class(AzString::from_const_str("az-table-row-numbers-container"))
@@ -257,8 +257,6 @@ impl TableViewState {
257257
.with_inline_css_props(NodeDataInlineCssPropertyVec::from_const_slice(ROW_NUMBER_WRAPPER_STYLE))
258258
.with_children(AzDomVec::from(vec![top_left_empty_rect, row_numbers]));
259259

260-
return row_number_wrapper; // DEBUG
261-
262260
static ACTIVE_SELECTION_HANDLE_STYLE: &[NodeDataInlineCssProperty] = &[
263261
Normal(CssProperty::position(LayoutPosition::Absolute)),
264262
Normal(CssProperty::width(LayoutWidth::const_px(10))),

examples/rust/public.rs

+1-9
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,7 @@ const DOM: Dom = Dom {
3838
const CSS: &str = "body { font-size: 50px; } body:hover { color: red; }";
3939

4040
extern "C" fn layout(data: &mut RefAny, _info: LayoutInfo) -> StyledDom {
41-
42-
let styled_dom = StyledDom::from_file("./ui.xml".into());
43-
/*DOM.style(Css::from_string(CSS.into()));*/
44-
45-
if let OptionFile::Some(mut file) = File::create("./debug.html".into()) {
46-
file.write_string(styled_dom.get_html_string().as_refstr());
47-
}
48-
49-
styled_dom
41+
StyledDom::from_file("./ui.xml".into())
5042
}
5143

5244
fn main() {

0 commit comments

Comments
 (0)