Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
JackCrumpLeys committed Jun 24, 2024
1 parent 5fbb291 commit 35ccd9e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
10 changes: 7 additions & 3 deletions tools/packet_inspector/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,18 @@ impl GuiApp {
let ctx = cc.egui_ctx.clone();

// Default Application Layout
let mut tree: DockState<Box<dyn Tab>> = DockState::new(vec![Box::new(connection::Connection::new())]);
let mut tree: DockState<Box<dyn Tab>> =
DockState::new(vec![Box::new(connection::Connection::new())]);

let [a, b] = tree.main_surface_mut().split_right( NodeIndex::root(),
let [a, b] = tree.main_surface_mut().split_right(
NodeIndex::root(),
0.3,
vec![Box::new(packet_list::PacketList::new())],
);

let [_, _] = tree.main_surface_mut().split_below(a, 0.25, vec![Box::new(filter::Filter::new())]);
let [_, _] =
tree.main_surface_mut()
.split_below(a, 0.25, vec![Box::new(filter::Filter::new())]);
let [_, _] = tree.main_surface_mut().split_below(
b,
0.5,
Expand Down
6 changes: 3 additions & 3 deletions tools/packet_inspector/src/app/packet_list.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use eframe::epaint::PathShape;
use egui::{
Color32, Pos2, Rect, Response, Rgba, Sense, Shape, Stroke, TextStyle, Ui, Vec2,
WidgetText,
Color32, Pos2, Rect, Response, Rgba, Sense, Shape, Stroke, TextStyle, Ui, Vec2, WidgetText,
};
use packet_inspector::Packet;
use valence_protocol::PacketSide;
Expand Down Expand Up @@ -148,7 +147,8 @@ fn draw_packet_widget(ui: &mut Ui, packet: &Packet, selected: bool) -> Response
};

if ui.is_rect_visible(rect) {
ui.painter().rect(rect, 0.0, fill, Stroke::new(1.0, Rgba::BLACK));
ui.painter()
.rect(rect, 0.0, fill, Stroke::new(1.0, Rgba::BLACK));

let shape = get_triangle(packet.side, &rect);
ui.painter().add(Shape::Path(shape));
Expand Down
2 changes: 0 additions & 2 deletions tools/packet_inspector/src/tri_checkbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ impl<'a> Widget for TriCheckbox<'a> {
visuals.bg_stroke,
));


match *checked {
TriCheckboxState::Enabled => {
// Check mark:
Expand Down Expand Up @@ -128,7 +127,6 @@ impl<'a> Widget for TriCheckbox<'a> {
);

ui.painter().galley(text_pos, text, visuals.text_color());

}
}

Expand Down

0 comments on commit 35ccd9e

Please sign in to comment.