MCPcopy Create free account
hub / github.com/donkeyteethUX/iced_plot / view_tick_labels

Method view_tick_labels

src/plot_widget.rs:1087–1136  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

1085 fn view_cursor_overlay(&self) -> Option<Element<'_, PlotUiMessage>> {
1086 if !self.cursor_overlay {
1087 return None;
1088 }
1089
1090 let Some(payload) = &self.cursor_ui else {
1091 return None;
1092 };
1093
1094 let bubble = container(widget::text(payload.text.clone()).size(12.0))
1095 .padding(6.0)
1096 .style(|theme| self.update_style(theme).cursor_overlay);
1097
1098 Some(bubble.into())
1099 }
1100
1101 fn view_top_right_overlay(&self, has_legend: bool) -> Element<'_, PlotUiMessage> {
1102 let help_btn = self.show_controls_help.then(|| {
1103 let help_label = if self.controls_overlay_open {
1104 "×"
1105 } else {
1106 "?"
1107 };
1108
1109 widget::button(widget::text(help_label).size(12.0))
1110 .padding(6.0)
1111 .on_press(PlotUiMessage::ToggleControlsOverlay)
1112 });
1113
1114 let top_row = widget::row![self.view_cursor_overlay(), help_btn].spacing(6.0);
1115 let col = widget::column![top_row, self.view_controls_overlay_panel(has_legend)]
1116 .spacing(6.0)
1117 .width(Length::Shrink)
1118 .height(Length::Shrink)
1119 .align_x(Horizontal::Right);
1120
1121 container(col)
1122 .width(Length::Fill)
1123 .height(Length::Fill)
1124 .padding(Padding {
1125 top: 4.0,
1126 right: 4.0,
1127 ..Padding::ZERO
1128 })
1129 .align_x(Horizontal::Right)
1130 .align_y(Vertical::Top)
1131 .style(container::transparent)
1132 .into()
1133 }
1134
1135 fn view_controls_overlay_panel(&self, has_legend: bool) -> Option<Element<'_, PlotUiMessage>> {
1136 if !self.controls_overlay_open {
1137 return None;
1138 }
1139

Callers 1

Calls 3

is_emptyMethod · 0.80
cached_styleMethod · 0.80
sizeMethod · 0.80

Tested by

no test coverage detected