mirror of
https://github.com/ClementTsang/bottom.git
synced 2025-07-23 21:55:11 +02:00
refactor: remove TypedBuilder for col row (#1158)
This commit is contained in:
parent
f541947a59
commit
a1a48bc647
@ -538,9 +538,7 @@ impl BottomLayout {
|
|||||||
vec![
|
vec![
|
||||||
BottomCol::builder()
|
BottomCol::builder()
|
||||||
.canvas_handle_width(true)
|
.canvas_handle_width(true)
|
||||||
.children(vec![BottomColRow::builder()
|
.children(vec![BottomColRow::new(vec![BottomWidget::builder()
|
||||||
.canvas_handle_height(true)
|
|
||||||
.children(vec![BottomWidget::builder()
|
|
||||||
.canvas_handle_width(true)
|
.canvas_handle_width(true)
|
||||||
.widget_type(BottomWidgetType::Disk)
|
.widget_type(BottomWidgetType::Disk)
|
||||||
.widget_id(4)
|
.widget_id(4)
|
||||||
@ -548,15 +546,12 @@ impl BottomLayout {
|
|||||||
.left_neighbour(Some(8))
|
.left_neighbour(Some(8))
|
||||||
.right_neighbour(Some(DEFAULT_WIDGET_ID + 2))
|
.right_neighbour(Some(DEFAULT_WIDGET_ID + 2))
|
||||||
.build()])
|
.build()])
|
||||||
.build()])
|
.canvas_handle_height(true)])
|
||||||
.build(),
|
.build(),
|
||||||
BottomCol::builder()
|
BottomCol::builder()
|
||||||
.canvas_handle_width(true)
|
.canvas_handle_width(true)
|
||||||
.children(vec![
|
.children(vec![
|
||||||
BottomColRow::builder()
|
BottomColRow::new(vec![
|
||||||
.canvas_handle_height(true)
|
|
||||||
.total_widget_ratio(3)
|
|
||||||
.children(vec![
|
|
||||||
BottomWidget::builder()
|
BottomWidget::builder()
|
||||||
.canvas_handle_width(true)
|
.canvas_handle_width(true)
|
||||||
.widget_type(BottomWidgetType::ProcSort)
|
.widget_type(BottomWidgetType::ProcSort)
|
||||||
@ -579,10 +574,9 @@ impl BottomLayout {
|
|||||||
.width_ratio(2)
|
.width_ratio(2)
|
||||||
.build(),
|
.build(),
|
||||||
])
|
])
|
||||||
.build(),
|
|
||||||
BottomColRow::builder()
|
|
||||||
.canvas_handle_height(true)
|
.canvas_handle_height(true)
|
||||||
.children(vec![BottomWidget::builder()
|
.total_widget_ratio(3),
|
||||||
|
BottomColRow::new(vec![BottomWidget::builder()
|
||||||
.canvas_handle_width(true)
|
.canvas_handle_width(true)
|
||||||
.widget_type(BottomWidgetType::ProcSearch)
|
.widget_type(BottomWidgetType::ProcSearch)
|
||||||
.widget_id(DEFAULT_WIDGET_ID + 1)
|
.widget_id(DEFAULT_WIDGET_ID + 1)
|
||||||
@ -591,14 +585,12 @@ impl BottomLayout {
|
|||||||
.right_neighbour(Some(7))
|
.right_neighbour(Some(7))
|
||||||
.parent_reflector(Some((WidgetDirection::Up, 1)))
|
.parent_reflector(Some((WidgetDirection::Up, 1)))
|
||||||
.build()])
|
.build()])
|
||||||
.build(),
|
.canvas_handle_height(true),
|
||||||
])
|
])
|
||||||
.build(),
|
.build(),
|
||||||
BottomCol::builder()
|
BottomCol::builder()
|
||||||
.canvas_handle_width(true)
|
.canvas_handle_width(true)
|
||||||
.children(vec![BottomColRow::builder()
|
.children(vec![BottomColRow::new(vec![BottomWidget::builder()
|
||||||
.canvas_handle_height(true)
|
|
||||||
.children(vec![BottomWidget::builder()
|
|
||||||
.canvas_handle_width(true)
|
.canvas_handle_width(true)
|
||||||
.widget_type(BottomWidgetType::Temp)
|
.widget_type(BottomWidgetType::Temp)
|
||||||
.widget_id(7)
|
.widget_id(7)
|
||||||
@ -606,13 +598,11 @@ impl BottomLayout {
|
|||||||
.left_neighbour(Some(DEFAULT_WIDGET_ID))
|
.left_neighbour(Some(DEFAULT_WIDGET_ID))
|
||||||
.right_neighbour(Some(8))
|
.right_neighbour(Some(8))
|
||||||
.build()])
|
.build()])
|
||||||
.build()])
|
.canvas_handle_height(true)])
|
||||||
.build(),
|
.build(),
|
||||||
BottomCol::builder()
|
BottomCol::builder()
|
||||||
.canvas_handle_width(true)
|
.canvas_handle_width(true)
|
||||||
.children(vec![BottomColRow::builder()
|
.children(vec![BottomColRow::new(vec![BottomWidget::builder()
|
||||||
.canvas_handle_height(true)
|
|
||||||
.children(vec![BottomWidget::builder()
|
|
||||||
.canvas_handle_width(true)
|
.canvas_handle_width(true)
|
||||||
.widget_type(BottomWidgetType::Battery)
|
.widget_type(BottomWidgetType::Battery)
|
||||||
.widget_id(8)
|
.widget_id(8)
|
||||||
@ -620,16 +610,14 @@ impl BottomLayout {
|
|||||||
.left_neighbour(Some(7))
|
.left_neighbour(Some(7))
|
||||||
.right_neighbour(Some(4))
|
.right_neighbour(Some(4))
|
||||||
.build()])
|
.build()])
|
||||||
.build()])
|
.canvas_handle_height(true)])
|
||||||
.build(),
|
.build(),
|
||||||
]
|
]
|
||||||
} else {
|
} else {
|
||||||
vec![
|
vec![
|
||||||
BottomCol::builder()
|
BottomCol::builder()
|
||||||
.canvas_handle_width(true)
|
.canvas_handle_width(true)
|
||||||
.children(vec![BottomColRow::builder()
|
.children(vec![BottomColRow::new(vec![BottomWidget::builder()
|
||||||
.canvas_handle_height(true)
|
|
||||||
.children(vec![BottomWidget::builder()
|
|
||||||
.canvas_handle_width(true)
|
.canvas_handle_width(true)
|
||||||
.widget_type(BottomWidgetType::Disk)
|
.widget_type(BottomWidgetType::Disk)
|
||||||
.widget_id(4)
|
.widget_id(4)
|
||||||
@ -637,14 +625,12 @@ impl BottomLayout {
|
|||||||
.left_neighbour(Some(7))
|
.left_neighbour(Some(7))
|
||||||
.right_neighbour(Some(DEFAULT_WIDGET_ID + 2))
|
.right_neighbour(Some(DEFAULT_WIDGET_ID + 2))
|
||||||
.build()])
|
.build()])
|
||||||
.build()])
|
.canvas_handle_height(true)])
|
||||||
.build(),
|
.build(),
|
||||||
BottomCol::builder()
|
BottomCol::builder()
|
||||||
.canvas_handle_width(true)
|
.canvas_handle_width(true)
|
||||||
.children(vec![
|
.children(vec![
|
||||||
BottomColRow::builder()
|
BottomColRow::new(vec![
|
||||||
.canvas_handle_height(true)
|
|
||||||
.children(vec![
|
|
||||||
BottomWidget::builder()
|
BottomWidget::builder()
|
||||||
.canvas_handle_width(true)
|
.canvas_handle_width(true)
|
||||||
.widget_type(BottomWidgetType::ProcSort)
|
.widget_type(BottomWidgetType::ProcSort)
|
||||||
@ -665,10 +651,8 @@ impl BottomLayout {
|
|||||||
.right_neighbour(Some(7))
|
.right_neighbour(Some(7))
|
||||||
.build(),
|
.build(),
|
||||||
])
|
])
|
||||||
.build(),
|
.canvas_handle_height(true),
|
||||||
BottomColRow::builder()
|
BottomColRow::new(vec![BottomWidget::builder()
|
||||||
.canvas_handle_height(true)
|
|
||||||
.children(vec![BottomWidget::builder()
|
|
||||||
.canvas_handle_width(true)
|
.canvas_handle_width(true)
|
||||||
.widget_type(BottomWidgetType::ProcSearch)
|
.widget_type(BottomWidgetType::ProcSearch)
|
||||||
.widget_id(DEFAULT_WIDGET_ID + 1)
|
.widget_id(DEFAULT_WIDGET_ID + 1)
|
||||||
@ -677,14 +661,12 @@ impl BottomLayout {
|
|||||||
.right_neighbour(Some(7))
|
.right_neighbour(Some(7))
|
||||||
.parent_reflector(Some((WidgetDirection::Up, 1)))
|
.parent_reflector(Some((WidgetDirection::Up, 1)))
|
||||||
.build()])
|
.build()])
|
||||||
.build(),
|
.canvas_handle_height(true),
|
||||||
])
|
])
|
||||||
.build(),
|
.build(),
|
||||||
BottomCol::builder()
|
BottomCol::builder()
|
||||||
.canvas_handle_width(true)
|
.canvas_handle_width(true)
|
||||||
.children(vec![BottomColRow::builder()
|
.children(vec![BottomColRow::new(vec![BottomWidget::builder()
|
||||||
.canvas_handle_height(true)
|
|
||||||
.children(vec![BottomWidget::builder()
|
|
||||||
.canvas_handle_width(true)
|
.canvas_handle_width(true)
|
||||||
.widget_type(BottomWidgetType::Temp)
|
.widget_type(BottomWidgetType::Temp)
|
||||||
.widget_id(7)
|
.widget_id(7)
|
||||||
@ -692,7 +674,7 @@ impl BottomLayout {
|
|||||||
.left_neighbour(Some(DEFAULT_WIDGET_ID))
|
.left_neighbour(Some(DEFAULT_WIDGET_ID))
|
||||||
.right_neighbour(Some(4))
|
.right_neighbour(Some(4))
|
||||||
.build()])
|
.build()])
|
||||||
.build()])
|
.canvas_handle_height(true)])
|
||||||
.build(),
|
.build(),
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
@ -704,24 +686,20 @@ impl BottomLayout {
|
|||||||
.canvas_handle_height(true)
|
.canvas_handle_height(true)
|
||||||
.children(vec![BottomCol::builder()
|
.children(vec![BottomCol::builder()
|
||||||
.canvas_handle_width(true)
|
.canvas_handle_width(true)
|
||||||
.children(vec![BottomColRow::builder()
|
.children(vec![BottomColRow::new(vec![BottomWidget::builder()
|
||||||
.canvas_handle_height(true)
|
|
||||||
.children(vec![BottomWidget::builder()
|
|
||||||
.canvas_handle_width(true)
|
.canvas_handle_width(true)
|
||||||
.widget_type(BottomWidgetType::BasicCpu)
|
.widget_type(BottomWidgetType::BasicCpu)
|
||||||
.widget_id(1)
|
.widget_id(1)
|
||||||
.down_neighbour(Some(2))
|
.down_neighbour(Some(2))
|
||||||
.build()])
|
.build()])
|
||||||
.build()])
|
.canvas_handle_height(true)])
|
||||||
.build()])
|
.build()])
|
||||||
.build(),
|
.build(),
|
||||||
BottomRow::builder()
|
BottomRow::builder()
|
||||||
.canvas_handle_height(true)
|
.canvas_handle_height(true)
|
||||||
.children(vec![BottomCol::builder()
|
.children(vec![BottomCol::builder()
|
||||||
.canvas_handle_width(true)
|
.canvas_handle_width(true)
|
||||||
.children(vec![BottomColRow::builder()
|
.children(vec![BottomColRow::new(vec![
|
||||||
.canvas_handle_height(true)
|
|
||||||
.children(vec![
|
|
||||||
BottomWidget::builder()
|
BottomWidget::builder()
|
||||||
.canvas_handle_width(true)
|
.canvas_handle_width(true)
|
||||||
.widget_type(BottomWidgetType::BasicMem)
|
.widget_type(BottomWidgetType::BasicMem)
|
||||||
@ -739,22 +717,20 @@ impl BottomLayout {
|
|||||||
.left_neighbour(Some(2))
|
.left_neighbour(Some(2))
|
||||||
.build(),
|
.build(),
|
||||||
])
|
])
|
||||||
.build()])
|
.canvas_handle_height(true)])
|
||||||
.build()])
|
.build()])
|
||||||
.build(),
|
.build(),
|
||||||
BottomRow::builder()
|
BottomRow::builder()
|
||||||
.canvas_handle_height(true)
|
.canvas_handle_height(true)
|
||||||
.children(vec![BottomCol::builder()
|
.children(vec![BottomCol::builder()
|
||||||
.canvas_handle_width(true)
|
.canvas_handle_width(true)
|
||||||
.children(vec![BottomColRow::builder()
|
.children(vec![BottomColRow::new(vec![BottomWidget::builder()
|
||||||
.canvas_handle_height(true)
|
|
||||||
.children(vec![BottomWidget::builder()
|
|
||||||
.canvas_handle_width(true)
|
.canvas_handle_width(true)
|
||||||
.widget_type(BottomWidgetType::BasicTables)
|
.widget_type(BottomWidgetType::BasicTables)
|
||||||
.widget_id(100)
|
.widget_id(100)
|
||||||
.up_neighbour(Some(2))
|
.up_neighbour(Some(2))
|
||||||
.build()])
|
.build()])
|
||||||
.build()])
|
.canvas_handle_height(true)])
|
||||||
.build()])
|
.build()])
|
||||||
.build(),
|
.build(),
|
||||||
BottomRow::builder()
|
BottomRow::builder()
|
||||||
@ -804,23 +780,47 @@ pub struct BottomCol {
|
|||||||
pub flex_grow: bool,
|
pub flex_grow: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Default, Debug, TypedBuilder)]
|
#[derive(Clone, Default, Debug)]
|
||||||
pub struct BottomColRow {
|
pub struct BottomColRow {
|
||||||
pub children: Vec<BottomWidget>,
|
pub children: Vec<BottomWidget>,
|
||||||
|
|
||||||
#[builder(default = 1)]
|
|
||||||
pub total_widget_ratio: u32,
|
pub total_widget_ratio: u32,
|
||||||
|
|
||||||
#[builder(default = 1)]
|
|
||||||
pub col_row_height_ratio: u32,
|
pub col_row_height_ratio: u32,
|
||||||
|
|
||||||
#[builder(default = false)]
|
|
||||||
pub canvas_handle_height: bool,
|
pub canvas_handle_height: bool,
|
||||||
|
|
||||||
#[builder(default = false)]
|
|
||||||
pub flex_grow: bool,
|
pub flex_grow: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl BottomColRow {
|
||||||
|
pub(crate) fn new(children: Vec<BottomWidget>) -> Self {
|
||||||
|
Self {
|
||||||
|
children,
|
||||||
|
total_widget_ratio: 1,
|
||||||
|
col_row_height_ratio: 1,
|
||||||
|
canvas_handle_height: false,
|
||||||
|
flex_grow: false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub(crate) fn total_widget_ratio(mut self, total_widget_ratio: u32) -> Self {
|
||||||
|
self.total_widget_ratio = total_widget_ratio;
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
|
pub(crate) fn col_row_height_ratio(mut self, col_row_height_ratio: u32) -> Self {
|
||||||
|
self.col_row_height_ratio = col_row_height_ratio;
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
|
pub(crate) fn canvas_handle_height(mut self, canvas_handle_height: bool) -> Self {
|
||||||
|
self.canvas_handle_height = canvas_handle_height;
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
|
pub(crate) fn flex_grow(mut self, flex_grow: bool) -> Self {
|
||||||
|
self.flex_grow = flex_grow;
|
||||||
|
self
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Eq, PartialEq)]
|
#[derive(Debug, Clone, Eq, PartialEq)]
|
||||||
pub enum WidgetDirection {
|
pub enum WidgetDirection {
|
||||||
Left,
|
Left,
|
||||||
|
@ -59,18 +59,13 @@ impl Row {
|
|||||||
BottomCol::builder()
|
BottomCol::builder()
|
||||||
.col_width_ratio(width_ratio)
|
.col_width_ratio(width_ratio)
|
||||||
.children(if left_legend {
|
.children(if left_legend {
|
||||||
vec![BottomColRow::builder()
|
vec![BottomColRow::new(vec![
|
||||||
.total_widget_ratio(20)
|
|
||||||
.children(vec![
|
|
||||||
BottomWidget::builder()
|
BottomWidget::builder()
|
||||||
.width_ratio(3)
|
.width_ratio(3)
|
||||||
.widget_type(BottomWidgetType::CpuLegend)
|
.widget_type(BottomWidgetType::CpuLegend)
|
||||||
.widget_id(*iter_id)
|
.widget_id(*iter_id)
|
||||||
.canvas_handle_width(true)
|
.canvas_handle_width(true)
|
||||||
.parent_reflector(Some((
|
.parent_reflector(Some((WidgetDirection::Right, 1)))
|
||||||
WidgetDirection::Right,
|
|
||||||
1,
|
|
||||||
)))
|
|
||||||
.build(),
|
.build(),
|
||||||
BottomWidget::builder()
|
BottomWidget::builder()
|
||||||
.width_ratio(17)
|
.width_ratio(17)
|
||||||
@ -79,11 +74,9 @@ impl Row {
|
|||||||
.flex_grow(true)
|
.flex_grow(true)
|
||||||
.build(),
|
.build(),
|
||||||
])
|
])
|
||||||
.build()]
|
.total_widget_ratio(20)]
|
||||||
} else {
|
} else {
|
||||||
vec![BottomColRow::builder()
|
vec![BottomColRow::new(vec![
|
||||||
.total_widget_ratio(20)
|
|
||||||
.children(vec![
|
|
||||||
BottomWidget::builder()
|
BottomWidget::builder()
|
||||||
.width_ratio(17)
|
.width_ratio(17)
|
||||||
.widget_type(BottomWidgetType::Cpu)
|
.widget_type(BottomWidgetType::Cpu)
|
||||||
@ -95,13 +88,10 @@ impl Row {
|
|||||||
.widget_type(BottomWidgetType::CpuLegend)
|
.widget_type(BottomWidgetType::CpuLegend)
|
||||||
.widget_id(*iter_id)
|
.widget_id(*iter_id)
|
||||||
.canvas_handle_width(true)
|
.canvas_handle_width(true)
|
||||||
.parent_reflector(Some((
|
.parent_reflector(Some((WidgetDirection::Left, 1)))
|
||||||
WidgetDirection::Left,
|
|
||||||
1,
|
|
||||||
)))
|
|
||||||
.build(),
|
.build(),
|
||||||
])
|
])
|
||||||
.build()]
|
.total_widget_ratio(20)]
|
||||||
})
|
})
|
||||||
.build()
|
.build()
|
||||||
}
|
}
|
||||||
@ -113,16 +103,12 @@ impl Row {
|
|||||||
.total_col_row_ratio(2)
|
.total_col_row_ratio(2)
|
||||||
.col_width_ratio(width_ratio)
|
.col_width_ratio(width_ratio)
|
||||||
.children(vec![
|
.children(vec![
|
||||||
BottomColRow::builder()
|
BottomColRow::new(vec![
|
||||||
.children(vec![
|
|
||||||
BottomWidget::builder()
|
BottomWidget::builder()
|
||||||
.widget_type(BottomWidgetType::ProcSort)
|
.widget_type(BottomWidgetType::ProcSort)
|
||||||
.widget_id(*iter_id)
|
.widget_id(*iter_id)
|
||||||
.canvas_handle_width(true)
|
.canvas_handle_width(true)
|
||||||
.parent_reflector(Some((
|
.parent_reflector(Some((WidgetDirection::Right, 2)))
|
||||||
WidgetDirection::Right,
|
|
||||||
2,
|
|
||||||
)))
|
|
||||||
.width_ratio(1)
|
.width_ratio(1)
|
||||||
.build(),
|
.build(),
|
||||||
BottomWidget::builder()
|
BottomWidget::builder()
|
||||||
@ -132,27 +118,22 @@ impl Row {
|
|||||||
.build(),
|
.build(),
|
||||||
])
|
])
|
||||||
.total_widget_ratio(3)
|
.total_widget_ratio(3)
|
||||||
.flex_grow(true)
|
.flex_grow(true),
|
||||||
.build(),
|
BottomColRow::new(vec![BottomWidget::builder()
|
||||||
BottomColRow::builder()
|
|
||||||
.children(vec![BottomWidget::builder()
|
|
||||||
.widget_type(BottomWidgetType::ProcSearch)
|
.widget_type(BottomWidgetType::ProcSearch)
|
||||||
.widget_id(proc_search_id)
|
.widget_id(proc_search_id)
|
||||||
.parent_reflector(Some((WidgetDirection::Up, 1)))
|
.parent_reflector(Some((WidgetDirection::Up, 1)))
|
||||||
.build()])
|
.build()])
|
||||||
.canvas_handle_height(true)
|
.canvas_handle_height(true),
|
||||||
.build(),
|
|
||||||
])
|
])
|
||||||
.build()
|
.build()
|
||||||
}
|
}
|
||||||
_ => BottomCol::builder()
|
_ => BottomCol::builder()
|
||||||
.col_width_ratio(width_ratio)
|
.col_width_ratio(width_ratio)
|
||||||
.children(vec![BottomColRow::builder()
|
.children(vec![BottomColRow::new(vec![BottomWidget::builder()
|
||||||
.children(vec![BottomWidget::builder()
|
|
||||||
.widget_type(widget_type)
|
.widget_type(widget_type)
|
||||||
.widget_id(*iter_id)
|
.widget_id(*iter_id)
|
||||||
.build()])
|
.build()])])
|
||||||
.build()])
|
|
||||||
.build(),
|
.build(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -194,10 +175,7 @@ impl Row {
|
|||||||
*iter_id += 1;
|
*iter_id += 1;
|
||||||
if left_legend {
|
if left_legend {
|
||||||
col_row_children.push(
|
col_row_children.push(
|
||||||
BottomColRow::builder()
|
BottomColRow::new(vec![
|
||||||
.col_row_height_ratio(col_row_height_ratio)
|
|
||||||
.total_widget_ratio(20)
|
|
||||||
.children(vec![
|
|
||||||
BottomWidget::builder()
|
BottomWidget::builder()
|
||||||
.width_ratio(3)
|
.width_ratio(3)
|
||||||
.widget_type(BottomWidgetType::CpuLegend)
|
.widget_type(BottomWidgetType::CpuLegend)
|
||||||
@ -215,14 +193,12 @@ impl Row {
|
|||||||
.flex_grow(true)
|
.flex_grow(true)
|
||||||
.build(),
|
.build(),
|
||||||
])
|
])
|
||||||
.build(),
|
.col_row_height_ratio(col_row_height_ratio)
|
||||||
|
.total_widget_ratio(20),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
col_row_children.push(
|
col_row_children.push(
|
||||||
BottomColRow::builder()
|
BottomColRow::new(vec![
|
||||||
.col_row_height_ratio(col_row_height_ratio)
|
|
||||||
.total_widget_ratio(20)
|
|
||||||
.children(vec![
|
|
||||||
BottomWidget::builder()
|
BottomWidget::builder()
|
||||||
.width_ratio(17)
|
.width_ratio(17)
|
||||||
.widget_type(BottomWidgetType::Cpu)
|
.widget_type(BottomWidgetType::Cpu)
|
||||||
@ -240,7 +216,8 @@ impl Row {
|
|||||||
)))
|
)))
|
||||||
.build(),
|
.build(),
|
||||||
])
|
])
|
||||||
.build(),
|
.col_row_height_ratio(col_row_height_ratio)
|
||||||
|
.total_widget_ratio(20),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -250,16 +227,12 @@ impl Row {
|
|||||||
let proc_search_id = *iter_id + 1;
|
let proc_search_id = *iter_id + 1;
|
||||||
*iter_id += 2;
|
*iter_id += 2;
|
||||||
col_row_children.push(
|
col_row_children.push(
|
||||||
BottomColRow::builder()
|
BottomColRow::new(vec![
|
||||||
.children(vec![
|
|
||||||
BottomWidget::builder()
|
BottomWidget::builder()
|
||||||
.widget_type(BottomWidgetType::ProcSort)
|
.widget_type(BottomWidgetType::ProcSort)
|
||||||
.widget_id(*iter_id)
|
.widget_id(*iter_id)
|
||||||
.canvas_handle_width(true)
|
.canvas_handle_width(true)
|
||||||
.parent_reflector(Some((
|
.parent_reflector(Some((WidgetDirection::Right, 2)))
|
||||||
WidgetDirection::Right,
|
|
||||||
2,
|
|
||||||
)))
|
|
||||||
.width_ratio(1)
|
.width_ratio(1)
|
||||||
.build(),
|
.build(),
|
||||||
BottomWidget::builder()
|
BottomWidget::builder()
|
||||||
@ -269,29 +242,24 @@ impl Row {
|
|||||||
.build(),
|
.build(),
|
||||||
])
|
])
|
||||||
.col_row_height_ratio(col_row_height_ratio)
|
.col_row_height_ratio(col_row_height_ratio)
|
||||||
.total_widget_ratio(3)
|
.total_widget_ratio(3),
|
||||||
.build(),
|
|
||||||
);
|
);
|
||||||
col_row_children.push(
|
col_row_children.push(
|
||||||
BottomColRow::builder()
|
BottomColRow::new(vec![BottomWidget::builder()
|
||||||
.col_row_height_ratio(col_row_height_ratio)
|
|
||||||
.children(vec![BottomWidget::builder()
|
|
||||||
.widget_type(BottomWidgetType::ProcSearch)
|
.widget_type(BottomWidgetType::ProcSearch)
|
||||||
.widget_id(proc_search_id)
|
.widget_id(proc_search_id)
|
||||||
.parent_reflector(Some((WidgetDirection::Up, 1)))
|
.parent_reflector(Some((WidgetDirection::Up, 1)))
|
||||||
.build()])
|
.build()])
|
||||||
.canvas_handle_height(true)
|
.canvas_handle_height(true)
|
||||||
.build(),
|
.col_row_height_ratio(col_row_height_ratio),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
_ => col_row_children.push(
|
_ => col_row_children.push(
|
||||||
BottomColRow::builder()
|
BottomColRow::new(vec![BottomWidget::builder()
|
||||||
.col_row_height_ratio(col_row_height_ratio)
|
|
||||||
.children(vec![BottomWidget::builder()
|
|
||||||
.widget_type(widget_type)
|
.widget_type(widget_type)
|
||||||
.widget_id(*iter_id)
|
.widget_id(*iter_id)
|
||||||
.build()])
|
.build()])
|
||||||
.build(),
|
.col_row_height_ratio(col_row_height_ratio),
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user