Add more source code links to demos (#1260)

This commit is contained in:
Urho Laukkarinen 2022-02-17 18:08:13 +02:00 committed by GitHub
parent 3d754e3a16
commit 6abdde0334
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 3 deletions

View file

@ -83,6 +83,10 @@ impl super::View for CodeExample {
fn ui(&mut self, ui: &mut egui::Ui) {
use crate::syntax_highlighting::code_view_ui;
ui.vertical_centered(|ui| {
ui.add(crate::__egui_github_link_file!());
});
code_view_ui(
ui,
r"

View file

@ -105,6 +105,9 @@ impl super::View for ContextMenus {
});
});
});
ui.vertical_centered(|ui| {
ui.add(crate::__egui_github_link_file!());
});
}
}

View file

@ -31,6 +31,10 @@ impl super::Demo for FontBook {
impl super::View for FontBook {
fn ui(&mut self, ui: &mut egui::Ui) {
ui.vertical_centered(|ui| {
ui.add(crate::__egui_github_link_file!());
});
ui.label(format!(
"The selected font supports {} characters.",
self.named_chars

View file

@ -242,9 +242,9 @@ impl super::Demo for PaintBezier {
impl super::View for PaintBezier {
fn ui(&mut self, ui: &mut Ui) {
// ui.vertical_centered(|ui| {
// ui.add(crate::__egui_github_link_file!());
// });
ui.vertical_centered(|ui| {
ui.add(crate::__egui_github_link_file!());
});
self.ui_control(ui);
Frame::dark_canvas(ui.style()).show(ui, |ui| {