Skip to content

Commit

Permalink
Add link to the Rerun Discord server
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Jan 3, 2024
1 parent df481ec commit 405ca80
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
Binary file added crates/re_ui/data/icons/discord.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions crates/re_ui/src/icons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ pub const EXTERNAL_LINK: Icon = Icon::new(
"external_link",
include_bytes!("../data/icons/external_link.png"),
);
pub const DISCORD: Icon = Icon::new("discord", include_bytes!("../data/icons/discord.png"));

pub const SPACE_VIEW_TEXT: Icon = Icon::new(
"spaceview_text",
Expand Down
21 changes: 21 additions & 0 deletions crates/re_viewer/src/ui/rerun_menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,27 @@ impl App {
});
}

if egui::Button::image_and_text(
re_ui::icons::DISCORD
.as_image()
.fit_to_exact_size(ReUi::small_icon_size()),
"Rerun Discord",
)
.ui(ui)
.on_hover_cursor(egui::CursorIcon::PointingHand)
.on_hover_text(
"Join the ReRun Discord server, where you can ask questions and get help.",
)
.clicked()
{
ui.ctx().output_mut(|o| {
o.open_url = Some(egui::output::OpenUrl {
url: "https://discord.gg/PXtCgFBSmH".to_owned(),
new_tab: true,
});
});
}

#[cfg(not(target_arch = "wasm32"))]
{
ui.add_space(spacing);
Expand Down

0 comments on commit 405ca80

Please sign in to comment.