Skip to content

Commit

Permalink
hover tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
Wumpf committed Nov 4, 2024
1 parent 6743ced commit 696ea49
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion crates/store/re_video/src/decode/async_decoder_wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl AsyncDecoderWrapper {
let comms = Comms::default();

let thread = std::thread::Builder::new()
.name(format!("decoer thread for {debug_name}"))
.name(format!("decoder of {debug_name}"))
.spawn({
let comms = comms.clone();
move || {
Expand Down
28 changes: 20 additions & 8 deletions crates/viewer/re_data_ui/src/video.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,24 +198,36 @@ fn frame_info_ui(ui: &mut egui::Ui, frame_info: &FrameInfo, timescale: re_video:
let time_range = frame_info.time_range();
ui.list_item_flat_noninteractive(PropertyContent::new("Time range").value_text(format!(
"{} - {}",
re_format::format_timestamp_seconds(time_range.start.into_secs(timescale),),
re_format::format_timestamp_seconds(time_range.end.into_secs(timescale),),
re_format::format_timestamp_seconds(time_range.start.into_secs(timescale)),
re_format::format_timestamp_seconds(time_range.end.into_secs(timescale)),
)))
.on_hover_text("Time range in which this frame is valid.");

ui.list_item_flat_noninteractive(
PropertyContent::new("PTS").value_text(frame_info.presentation_timestamp.0.to_string()),
)
.on_hover_text("Raw presentation timestamp prior to applying the timescale.\n\
This specifies the time at which the frame should be shown relative to the start of a video stream.");
fn value_fn_for_time(
time: re_video::Time,
timescale: re_video::Timescale,
) -> impl FnOnce(&mut egui::Ui, egui::style::WidgetVisuals) {
move |ui, _| {
ui.add(egui::Label::new(time.0.to_string()).truncate())
.on_hover_text(re_format::format_timestamp_seconds(
time.into_secs(timescale),
));
}
}

if let Some(dts) = frame_info.latest_decode_timestamp {
ui.list_item_flat_noninteractive(
PropertyContent::new("DTS").value_text(dts.0.to_string()),
PropertyContent::new("DTS").value_fn(value_fn_for_time(dts, timescale)),
)
.on_hover_text("Raw decode timestamp prior to applying the timescale.\n\
If a frame is made up of multiple chunks, this is the last decode timestamp that was needed to decode the frame.");
}

ui.list_item_flat_noninteractive(
PropertyContent::new("PTS").value_fn(value_fn_for_time(frame_info.presentation_timestamp, timescale)),
)
.on_hover_text("Raw presentation timestamp prior to applying the timescale.\n\
This specifies the time at which the frame should be shown relative to the start of a video stream.");
}

fn source_image_data_format_ui(ui: &mut egui::Ui, format: &SourceImageDataFormat) {
Expand Down

0 comments on commit 696ea49

Please sign in to comment.