Skip to content

Commit

Permalink
update egui and egui deps
Browse files Browse the repository at this point in the history
  • Loading branch information
dmackdev committed Feb 10, 2025
1 parent 26df7bd commit 8fb2d98
Show file tree
Hide file tree
Showing 9 changed files with 265 additions and 197 deletions.
408 changes: 239 additions & 169 deletions Cargo.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions pubsubman/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ edition = "2021"
[dependencies]
chrono = { workspace = true }
clap = { version = "4.4.0", features = ["derive"] }
eframe = { version = "0.30", default-features = false, features = [
eframe = { version = "0.31", default-features = false, features = [
"accesskit", # Make egui comptaible with screen readers. NOTE: adds a lot of dependencies.
"default_fonts", # Embed the default egui fonts.
"glow", # Use the glow rendering backend. Alternative: "wgpu".
"persistence", # Enable restoring app state when restarting the app.
"wayland", # Required for Linux support (including CI!)
"x11",
] }
egui = "0.30"
egui-notify = "0.18.0"
egui_json_tree = "0.10.0"
egui = "0.31"
egui-notify = "0.19.0"
egui_json_tree = "0.11.0"
env_logger = "0.10"
log = "0.4"
pubsubman_backend = { version = "0.1.0", path = "../pubsubman_backend" }
Expand Down
2 changes: 1 addition & 1 deletion pubsubman/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ impl App {
});

egui::SidePanel::right("selected_message")
.frame(egui::Frame::none())
.frame(egui::Frame::NONE)
.resizable(true)
.show_animated(ctx, selected_message.is_some(), |ui| {
if let Some(message) = selected_message {
Expand Down
10 changes: 5 additions & 5 deletions pubsubman/src/exit_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ pub enum SubscriptionCleanupState {
}

const MARGIN: egui::Margin = egui::Margin {
left: 16.0,
right: 16.0,
top: 12.0,
bottom: 4.0,
left: 16,
right: 16,
top: 12,
bottom: 4,
};

impl ExitState {
Expand All @@ -46,7 +46,7 @@ impl ExitState {
};

Modal::new("exit_modal".into()).show(ctx, |ui| {
egui::Frame::none().inner_margin(MARGIN).show(ui, |ui| {
egui::Frame::NONE.inner_margin(MARGIN).show(ui, |ui| {
ui.with_layout(egui::Layout::top_down(egui::Align::Center), |ui| {
ui.heading(title);
ui.add_space(20.0);
Expand Down
6 changes: 2 additions & 4 deletions pubsubman/src/ui/json_ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ pub fn show_json_context_menu(ui: &mut egui::Ui, context: RenderContext<'_, '_,
.context_menu(|ui| {
let pointer = context.pointer().to_json_pointer_string();
if !pointer.is_empty() && ui.button("Copy path").clicked() {
ui.output_mut(|o| {
o.copied_text = pointer;
});
ui.ctx().copy_text(pointer);
ui.close_menu();
}

if ui.button("Copy contents").clicked() {
if let Ok(pretty_str) = serde_json::to_string_pretty(context.value()) {
ui.output_mut(|o| o.copied_text = pretty_str);
ui.ctx().copy_text(pretty_str);
}
ui.close_menu();
}
Expand Down
10 changes: 5 additions & 5 deletions pubsubman/src/ui/messages_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ impl MessagesView {
let stream_mode_toggle = ui.add(
egui::Button::new("Stream")
.selected(self.stream_messages_enabled)
.rounding(ui.visuals().widgets.active.rounding),
.corner_radius(ui.visuals().widgets.active.corner_radius),
);

if stream_mode_toggle.clicked() {
Expand Down Expand Up @@ -167,16 +167,16 @@ impl MessagesView {
});

let outer_margin = egui::Margin {
top: 8.0,
bottom: 12.0,
top: 8,
bottom: 12,
..Default::default()
};

egui::Frame::none()
egui::Frame::NONE
.fill(ui.style().visuals.panel_fill)
.inner_margin(egui::vec2(6.0, 3.0))
.outer_margin(outer_margin)
.rounding(ui.style().visuals.window_rounding)
.corner_radius(ui.style().visuals.window_corner_radius)
.show(ui, |ui| {
egui::ScrollArea::vertical()
.stick_to_bottom(true)
Expand Down
8 changes: 4 additions & 4 deletions pubsubman/src/ui/topic_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ pub fn render_topic_name(
(egui::Stroke::NONE, ui.visuals().code_bg_color)
};

egui::Frame::none()
egui::Frame::NONE
.stroke(stroke)
.fill(fill)
.inner_margin(egui::Margin::same(7.5))
.outer_margin(egui::Margin::same(2.5))
.rounding(ui.visuals().window_rounding)
.inner_margin(egui::Margin::same(7))
.outer_margin(egui::Margin::same(2))
.corner_radius(ui.visuals().window_corner_radius)
.show(ui, |ui| {
ui.set_width(ui.available_width());

Expand Down
8 changes: 4 additions & 4 deletions pubsubman/src/ui/validity_frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ pub trait ValidityFrame {
impl ValidityFrame for &mut egui::Ui {
fn validity_frame(&self, is_valid: bool) -> egui::Frame {
let (stroke, rounding) = if is_valid {
(egui::Stroke::NONE, egui::Rounding::ZERO)
(egui::Stroke::NONE, egui::CornerRadius::ZERO)
} else {
(
egui::Stroke {
width: 1.0,
color: self.visuals().error_fg_color,
},
self.visuals().widgets.hovered.rounding,
self.visuals().widgets.hovered.corner_radius,
)
};

egui::Frame::none()
egui::Frame::NONE
.stroke(stroke)
.inner_margin(2.0)
.rounding(rounding)
.corner_radius(rounding)
}
}
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
# to the user in the error, instead of "error: invalid channel name '[toolchain]'".

[toolchain]
channel = "1.80.0"
channel = "1.81.0"
components = [ "rustfmt", "clippy" ]

0 comments on commit 8fb2d98

Please sign in to comment.