mirror of
https://github.com/mikedilger/gossip.git
synced 2024-09-19 19:46:50 +00:00
More ui copy stuff
This commit is contained in:
parent
fab8c7400b
commit
1d4e65a963
@ -171,7 +171,10 @@ fn render_post(
|
|||||||
|
|
||||||
ui.add_space(10.0);
|
ui.add_space(10.0);
|
||||||
|
|
||||||
ui.label("(i)").on_hover_ui(|ui| {
|
if ui.add(CopyButton {}).clicked() {
|
||||||
|
ui.output().copied_text = event.id.as_hex_string();
|
||||||
|
}
|
||||||
|
ui.label("[ID]").on_hover_ui(|ui| {
|
||||||
ui.label(&format!("ID: {}", event.id.as_hex_string()));
|
ui.label(&format!("ID: {}", event.id.as_hex_string()));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -32,8 +32,8 @@ impl CopyButton {
|
|||||||
closed: false,
|
closed: false,
|
||||||
fill: Color32::TRANSPARENT,
|
fill: Color32::TRANSPARENT,
|
||||||
stroke: Stroke {
|
stroke: Stroke {
|
||||||
width: 1.5,
|
width: 1.0,
|
||||||
color: Color32::from_rgb(0xb1, 0xa2, 0x96),
|
color: Color32::from_rgb(0x8d, 0x7f, 0x73),
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@ -63,8 +63,8 @@ impl CopyButton {
|
|||||||
closed: true,
|
closed: true,
|
||||||
fill: Color32::TRANSPARENT,
|
fill: Color32::TRANSPARENT,
|
||||||
stroke: Stroke {
|
stroke: Stroke {
|
||||||
width: 1.5,
|
width: 1.0,
|
||||||
color: Color32::from_rgb(0xb1, 0xa2, 0x96),
|
color: Color32::from_rgb(0x8d, 0x7f, 0x73),
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
@ -88,7 +88,7 @@ impl Widget for CopyButton {
|
|||||||
x: rect.min.x + padding.x + shift,
|
x: rect.min.x + padding.x + shift,
|
||||||
y: rect.min.y + padding.y + shift,
|
y: rect.min.y + padding.y + shift,
|
||||||
};
|
};
|
||||||
Self::paint(ui, pos);
|
Self::paint(ui, ui.painter().round_pos_to_pixels(pos));
|
||||||
|
|
||||||
response
|
response
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user