rerun icon indicating copy to clipboard operation
rerun copied to clipboard

Custom window frames for Windows and Linux

Open emilk opened this issue 2 years ago • 2 comments

Currently the viewer frame on Windows and Linux have an ugly platform-specific header with a title, close buttons, and a minimize button.

We should just replace those with our own window frame, like in https://github.com/emilk/egui/tree/master/examples/custom_window_frame

Needs some design though.

Blocked by:

  • https://github.com/rerun-io/rerun/pull/997
  • https://github.com/emilk/egui/issues/2680

TODO:

  • [x] Fix window resizing UI on Wayland and Xorg
  • [ ] Fix lower right corner (paint_time_ranges_gaps). Maybe turn off rounding?
  • [ ] Test on Windows
  • [ ] Custom icons for close/maximize/minimize
  • [ ] I think we need to center the panel buttons?

What Rerun currently looks like on Gnome/xorg:

image

If you enable CUSTOM_WINDOW_DECORATIONS on main:

(once https://github.com/rerun-io/rerun/pull/1094 is merged) custom-window-frame

emilk avatar Feb 02 '23 16:02 emilk

There are a bunch of open issues with custom window frames in eframe: https://github.com/emilk/egui/issues?q=is%3Aissue+is%3Aopen+custom_window_frame

emilk avatar Jan 07 '24 15:01 emilk

Custom decorations working fine on Linux/Wayland/Sway.

 /// If true, we fill the entire window, except for the close/maximize/minimize buttons in the top-left.
 /// See <https://github.com/emilk/egui/pull/2049>
-pub const FULLSIZE_CONTENT: bool = cfg!(target_os = "macos");
+pub const FULLSIZE_CONTENT: bool = true;
 
 /// If true, we hide the native window decoration
 /// (the top bar with app title, close button etc),
 /// and instead paint our own close/maximize/minimize buttons.
-pub const CUSTOM_WINDOW_DECORATIONS: bool = false; // !FULLSIZE_CONTENT; // TODO(emilk): https://github.com/rerun-io/rerun/issues/1063
+pub const CUSTOM_WINDOW_DECORATIONS: bool = true; // !FULLSIZE_CONTENT; // TODO(emilk): https://github.com/rerun-io/rerun/issues/1063

image

Close button works as expected -- others don't but that's expected on my setup.

teh-cmc avatar Mar 21 '24 08:03 teh-cmc

Using the same diff on Windows 11: image

Minimize/maximize/close work.

Issues:

  • minimize/maximize/close look unusually small for windows, close button doesn't get red on hover like most other applications (btw. some fade red in some don't... I miss the good old days of native ui everywhere :( )
  • window corners are not transparent/cutout
  • resize at window border doesn't work

Wumpf avatar Apr 07 '24 17:04 Wumpf

I miss the good old days of native ui everywhere

You work for the wrong company 😅

emilk avatar Jun 19 '24 14:06 emilk

I'm pretty sure if me or @nikolausWest worked on a Linux or Windows machine, this issue would have a much higher priority

emilk avatar Jun 19 '24 14:06 emilk