mirror of
https://github.com/emilk/egui.git
synced 2026-06-27 15:13:12 -04:00
Make sure the tab buttons don't cover the RTL "add tab" buttons
This commit is contained in:
@@ -88,11 +88,14 @@ impl Tabs {
|
||||
.rect_filled(ui.max_rect(), 0.0, behavior.tab_bar_color(ui.visuals()));
|
||||
|
||||
ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {
|
||||
// Add buttons such as "add new tab"
|
||||
behavior.top_bar_rtl_ui(ui, node_id);
|
||||
|
||||
ui.spacing_mut().item_spacing.x = 0.0; // Tabs have spacing built-in
|
||||
|
||||
ui.with_layout(egui::Layout::left_to_right(egui::Align::Center), |ui| {
|
||||
ui.set_clip_rect(ui.max_rect()); // Don't cover the `rtl_ui` buttons.
|
||||
|
||||
for (i, &child_id) in self.children.iter().enumerate() {
|
||||
let is_being_dragged = is_being_dragged(ui.ctx(), child_id);
|
||||
|
||||
|
||||
@@ -42,10 +42,6 @@
|
||||
// Everything is quite dynamic, so we have a bunch of defensive coding that call `warn!` on failure.
|
||||
// These situations should not happen in normal use, but could happen if the user messes with
|
||||
// the internals of the tree, putting it in an invalid state.
|
||||
//
|
||||
// ## TODO before release:
|
||||
// * Auto-grid layouts (re-arange as parent is resized)
|
||||
// * Clip tab titles to not cover "add new tab" button
|
||||
|
||||
use egui::{Id, Pos2, Rect};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user