@@ -1536,8 +1536,12 @@ impl StyledDom {
1536
1536
}
1537
1537
1538
1538
/// Inject scroll bar DIVs with relevant event handlers into the DOM
1539
+ ///
1540
+ /// This function essentially takes
1539
1541
pub fn inject_scroll_bars ( & mut self ) {
1540
1542
1543
+ use azul_css_parser:: CssApiWrapper ;
1544
+
1541
1545
// allocate 14 nodes for every node
1542
1546
//
1543
1547
// 0: root component
@@ -1557,6 +1561,70 @@ impl StyledDom {
1557
1561
// 14: |- self.root
1558
1562
// |- ... self.children
1559
1563
1564
+ let dom_to_inject = Dom :: div ( )
1565
+ // .with_class("__azul-native-scroll-root-component".into())
1566
+ . with_inline_style ( "display:flex; flex-grow:1; flex-direction:column;" . into ( ) )
1567
+ . with_children ( vec ! [
1568
+
1569
+ Dom :: div( )
1570
+ // .with_class("__azul-native-scroll-vertical-container".into())
1571
+ . with_inline_style( "display:flex; flex-grow:1; flex-direction:column-reverse;" . into( ) )
1572
+ . with_children( vec![
1573
+
1574
+ Dom :: div( )
1575
+ // .with_class("__azul-native-scroll-horizontal-scrollbar".into())
1576
+ . with_inline_style( "display:flex; flex-grow:1; flex-direction:row; height:15px; background:grey;" . into( ) )
1577
+ . with_children( vec![
1578
+ Dom :: div( ) ,
1579
+ // .with_class("__azul-native-scroll-horizontal-scrollbar-track-left".into()),
1580
+ Dom :: div( )
1581
+ // .with_class("__azul-native-scroll-horizontal-scrollbar-track-middle".into())
1582
+ . with_children( vec![
1583
+ Dom :: div( )
1584
+ // .with_class("__azul-native-scroll-horizontal-scrollbar-track-thumb".into())
1585
+ ] . into( ) ) ,
1586
+ Dom :: div( )
1587
+ // .with_class("__azul-native-scroll-horizontal-scrollbar-track-right".into()),
1588
+ ] . into( ) ) ,
1589
+
1590
+ Dom :: div( )
1591
+ // .with_class("__azul-native-scroll-content-container-1".into())
1592
+ . with_inline_style( "display:flex; flex-grow:1; flex-direction:row-reverse;" . into( ) )
1593
+ . with_children( vec![
1594
+
1595
+ Dom :: div( )
1596
+ // .with_class("__azul-native-scroll-vertical-scrollbar".into())
1597
+ . with_inline_style( "display:flex; flex-grow:1; flex-direction:column; width:15px; background:grey;" . into( ) )
1598
+ . with_children( vec![
1599
+ Dom :: div( ) ,
1600
+ // .with_class("__azul-native-scroll-vertical-scrollbar-track-top".into()),
1601
+ Dom :: div( )
1602
+ // .with_class("__azul-native-scroll-vertical-scrollbar-track-middle".into())
1603
+ . with_children( vec![
1604
+ Dom :: div( )
1605
+ // .with_class("__azul-native-scroll-vertical-scrollbar-track-thumb".into())
1606
+ ] . into( ) ) ,
1607
+ Dom :: div( )
1608
+ // .with_class("__azul-native-scroll-vertical-scrollbar-track-bottom".into()),
1609
+ ] . into( ) ) ,
1610
+
1611
+ Dom :: div( )
1612
+ // .with_class("__azul-native-scroll-content-container-1".into())
1613
+ . with_inline_style( "display:flex; flex-grow:1; flex-direction:column;" . into( ) )
1614
+ . with_children( vec![
1615
+ Dom :: div( ) // <- this div is where the new children will be injected into
1616
+ ] . into( ) )
1617
+ ] . into( ) )
1618
+ ] . into( ) )
1619
+ ] . into ( ) )
1620
+ . style ( CssApiWrapper :: empty ( ) ) ;
1621
+
1622
+ // pre-allocate a new DOM tree with self.nodes.len() * dom_to_inject.nodes.len() nodes
1623
+
1624
+ // inject self.root as the nth node
1625
+ let inject_as_id = 0 ;
1626
+
1627
+ println ! ( "inject scroll bars:\r \n {}" , dom_to_inject. get_html_string( "" , "" , true ) ) ;
1560
1628
}
1561
1629
1562
1630
/// Inject a menu bar into the root component
0 commit comments