mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 06:40:06 -04:00
Merge branch 'lucas/atoms-preferred-size' into lucas/experiments/measure-widget-size
# Conflicts: # crates/egui/src/ui.rs # crates/egui/src/widgets/button.rs # crates/egui/src/widgets/label.rs # crates/egui_demo_lib/src/demo/popups.rs # crates/egui_extras/src/layout.rs # crates/epaint/src/text/text_layout_types.rs
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use egui::{emath::GuiRounding, Id, Pos2, Rect, Response, Sense, Ui, UiBuilder, Vec2};
|
||||
use egui::{emath::GuiRounding as _, Id, Pos2, Rect, Response, Sense, Ui, UiBuilder, Vec2};
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
pub(crate) enum CellSize {
|
||||
@@ -33,6 +33,7 @@ pub(crate) struct StripLayoutFlags {
|
||||
pub(crate) striped: bool,
|
||||
pub(crate) hovered: bool,
|
||||
pub(crate) selected: bool,
|
||||
pub(crate) overline: bool,
|
||||
|
||||
/// Used when we want to accruately measure the size of this cell.
|
||||
pub(crate) sizing_pass: bool,
|
||||
@@ -233,6 +234,14 @@ impl<'l> StripLayout<'l> {
|
||||
child_ui.style_mut().visuals.override_text_color = Some(stroke_color);
|
||||
}
|
||||
|
||||
if flags.overline {
|
||||
child_ui.painter().hline(
|
||||
max_rect.x_range(),
|
||||
max_rect.top(),
|
||||
child_ui.visuals().widgets.noninteractive.bg_stroke,
|
||||
);
|
||||
}
|
||||
|
||||
add_cell_contents(&mut child_ui);
|
||||
|
||||
child_ui
|
||||
|
||||
Reference in New Issue
Block a user