Skip to content

Commit

Permalink
Fix clippy and revert test changes to simple example.
Browse files Browse the repository at this point in the history
  • Loading branch information
Adanos020 committed Apr 3, 2024
1 parent 01bb07c commit 0732be0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
8 changes: 3 additions & 5 deletions examples/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,8 @@ impl Default for MyApp {

impl eframe::App for MyApp {
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
Window::new("test").show(ctx, |ui| {
DockArea::new(&mut self.tree)
.style(Style::from_egui(ui.style().as_ref()))
.show_inside(ui, &mut TabViewer {});
});
DockArea::new(&mut self.tree)
.style(Style::from_egui(ctx.style().as_ref()))
.show(ctx, &mut TabViewer {});
}
}
6 changes: 1 addition & 5 deletions src/widgets/dock_area/show/leaf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,7 @@ impl<'tree, Tab> DockArea<'tree, Tab> {
fade,
);
let title_id = response.id;

let (close_hovered, close_clicked, close_rect) = close_response
.map(|res| (res.hovered(), res.clicked(), res.rect))
.unwrap_or((false, false, Rect::ZERO));

let close_clicked = close_response.is_some_and(|res| res.clicked());
let is_lonely_tab = self.dock_state[surface_index].num_tabs() == 1;

if self.show_tab_name_on_hover {
Expand Down
4 changes: 2 additions & 2 deletions src/widgets/dock_area/show/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use egui::{
CentralPanel, Color32, Context, CursorIcon, EventFilter, Frame, Key, LayerId, Order, Pos2,
Rect, Rounding, Sense, Ui, Vec2,
CentralPanel, Color32, Context, CursorIcon, EventFilter, Frame, Key, Pos2, Rect, Rounding,
Sense, Ui, Vec2,
};

use duplicate::duplicate;
Expand Down

0 comments on commit 0732be0

Please sign in to comment.