Skip to content

Commit

Permalink
Improve Rerun Menu with link to Rerun Discord (#4661)
Browse files Browse the repository at this point in the history
### What
Cleans up the code around the options menu, and splits out the debug
options to its own menu.

Also adds a link to our Discord (part of
#4436)

The icon comes from https://discord.com/branding


![image](https://github.com/rerun-io/rerun/assets/1148717/c5406373-cf8a-4058-8c6c-b7021dc41e10)


### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using newly built examples:
[app.rerun.io](https://app.rerun.io/pr/4661/index.html)
* Using examples from latest `main` build:
[app.rerun.io](https://app.rerun.io/pr/4661/index.html?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[app.rerun.io](https://app.rerun.io/pr/4661/index.html?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG

- [PR Build Summary](https://build.rerun.io/pr/4661)
- [Docs
preview](https://rerun.io/preview/c3f224b67f947b1434d236757fe77c01c5efb562/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/c3f224b67f947b1434d236757fe77c01c5efb562/examples)
<!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)
  • Loading branch information
emilk authored Jan 3, 2024
1 parent da88fdd commit 17e64f6
Show file tree
Hide file tree
Showing 5 changed files with 249 additions and 233 deletions.
5 changes: 3 additions & 2 deletions crates/re_space_view_spatial/src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,11 @@ pub fn screenshot_context_menu(
if _ctx.app_options.experimental_space_view_screenshots {
let mut take_screenshot = None;
let response = response.context_menu(|ui| {
if ui.button("Screenshot (save to disk)").clicked() {
ui.style_mut().wrap = Some(false);
if ui.button("Save screenshot to disk").clicked() {
take_screenshot = Some(ScreenshotMode::SaveAndCopyToClipboard);
ui.close_menu();
} else if ui.button("Screenshot (clipboard only)").clicked() {
} else if ui.button("Copy screenshot to clipboard").clicked() {
take_screenshot = Some(ScreenshotMode::CopyToClipboard);
ui.close_menu();
}
Expand Down
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.
5 changes: 2 additions & 3 deletions crates/re_ui/src/design_tokens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ fn apply_design_tokens(ctx: &egui::Context) -> DesignTokens {

let panel_bg_color = get_aliased_color(&json, "{Alias.Color.Surface.Default.value}");
// let floating_color = get_aliased_color(&json, "{Alias.Color.Surface.Floating.value}");
let floating_color = Color32::from_gray(38); // TODO(emilk): change the content of the design_tokens.json origin instead
let floating_color = Color32::from_gray(35); // TODO(emilk): change the content of the design_tokens.json origin instead

// Used as the background of text edits, scroll bars and others things
// that needs to look different from other interactive stuff.
Expand All @@ -110,8 +110,7 @@ fn apply_design_tokens(ctx: &egui::Context) -> DesignTokens {

egui_style.visuals.button_frame = true;
egui_style.visuals.widgets.inactive.weak_bg_fill = Default::default(); // Buttons have no background color when inactive
egui_style.visuals.widgets.inactive.bg_fill = Color32::from_gray(40);
// get_aliased_color(&json, "{Alias.Color.Action.Default.value}"); // too dark to see, especially for scroll bars
egui_style.visuals.widgets.inactive.bg_fill = Color32::from_gray(50); // Fill of unchecked radio buttons, checkboxes, etc. Must be brigher than the background floating_color.

{
// Background colors for buttons (menu buttons, blueprint buttons, etc) when hovered or clicked:
Expand Down
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
Loading

0 comments on commit 17e64f6

Please sign in to comment.