Skip to content

Commit

Permalink
Format ID option for combo box as uppercase.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmackdev committed Oct 24, 2023
1 parent 01d4570 commit cb166a9
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions pubsubman/src/ui/messages_view.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::fmt::Display;

use chrono::{DateTime, Local};
use egui_json_tree::{DefaultExpand, JsonTree};
use pubsubman_backend::{
Expand Down Expand Up @@ -125,7 +127,7 @@ impl MessagesView {

let search_mode_changed =
egui::ComboBox::from_id_source("search_mode_combo_box")
.selected_text(format!("{:?}", self.search_mode))
.selected_text(format!("{}", self.search_mode))
.width(50.0)
.show_ui(ui, |ui| {
ui.selectable_value(
Expand All @@ -138,7 +140,7 @@ impl MessagesView {
.selectable_value(
&mut self.search_mode,
SearchMode::Id,
"Id",
"ID",
)
.changed()
})
Expand Down Expand Up @@ -279,3 +281,12 @@ enum SearchMode {
Data,
Id,
}

impl Display for SearchMode {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
SearchMode::Data => write!(f, "Data"),
SearchMode::Id => write!(f, "ID"),
}
}
}

0 comments on commit cb166a9

Please sign in to comment.