mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 21:30:03 -04:00
Add egui::Sides for adding UI on left and right sides (#5036)
* Closes https://github.com/emilk/egui/issues/5015
This commit is contained in:
@@ -451,7 +451,7 @@ impl<'a> TableBuilder<'a> {
|
||||
let Self {
|
||||
ui,
|
||||
id_salt,
|
||||
columns,
|
||||
mut columns,
|
||||
striped,
|
||||
resizable,
|
||||
cell_layout,
|
||||
@@ -459,6 +459,15 @@ impl<'a> TableBuilder<'a> {
|
||||
sense,
|
||||
} = self;
|
||||
|
||||
for (i, column) in columns.iter_mut().enumerate() {
|
||||
let column_resize_id = ui.id().with("resize_column").with(i);
|
||||
if let Some(response) = ui.ctx().read_response(column_resize_id) {
|
||||
if response.double_clicked() {
|
||||
column.auto_size_this_frame = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let striped = striped.unwrap_or(ui.visuals().striped);
|
||||
|
||||
let state_id = ui.id().with(id_salt);
|
||||
@@ -695,7 +704,7 @@ impl<'a> Table<'a> {
|
||||
ui,
|
||||
table_top,
|
||||
state_id,
|
||||
mut columns,
|
||||
columns,
|
||||
resizable,
|
||||
mut available_width,
|
||||
mut state,
|
||||
@@ -719,15 +728,6 @@ impl<'a> Table<'a> {
|
||||
scroll_bar_visibility,
|
||||
} = scroll_options;
|
||||
|
||||
for (i, column) in columns.iter_mut().enumerate() {
|
||||
let column_resize_id = ui.id().with("resize_column").with(i);
|
||||
if let Some(response) = ui.ctx().read_response(column_resize_id) {
|
||||
if response.double_clicked() {
|
||||
column.auto_size_this_frame = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let cursor_position = ui.cursor().min;
|
||||
|
||||
let mut scroll_area = ScrollArea::new([false, vscroll])
|
||||
|
||||
Reference in New Issue
Block a user