Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom window frames for Windows and Linux #1063

Open
2 of 5 tasks
emilk opened this issue Feb 2, 2023 · 5 comments
Open
2 of 5 tasks

Custom window frames for Windows and Linux #1063

emilk opened this issue Feb 2, 2023 · 5 comments
Labels
egui Requires egui/eframe work enhancement New feature or request 🐧 linux Linux-specific problems ui concerns graphical user interface 🪟 windows Problems specific to the Windows OS

Comments

@emilk
Copy link
Member

emilk commented Feb 2, 2023

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

TODO:

  • 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:

custom-window-frame

@emilk emilk added enhancement New feature or request ui concerns graphical user interface 👀 needs triage This issue needs to be triaged by the Rerun team labels Feb 2, 2023
@nikolausWest nikolausWest removed the 👀 needs triage This issue needs to be triaged by the Rerun team label Feb 2, 2023
@emilk emilk self-assigned this Feb 6, 2023
@emilk emilk removed their assignment Feb 23, 2023
@emilk emilk added the egui Requires egui/eframe work label Nov 6, 2023
@emilk emilk added 🪟 windows Problems specific to the Windows OS 🐧 linux Linux-specific problems labels Nov 22, 2023
@emilk
Copy link
Member Author

emilk commented Jan 7, 2024

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

@teh-cmc
Copy link
Member

teh-cmc commented Mar 21, 2024

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.

@Wumpf
Copy link
Member

Wumpf commented Apr 7, 2024

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

@emilk
Copy link
Member Author

emilk commented Jun 19, 2024

I miss the good old days of native ui everywhere

You work for the wrong company 😅

@emilk
Copy link
Member Author

emilk commented Jun 19, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
egui Requires egui/eframe work enhancement New feature or request 🐧 linux Linux-specific problems ui concerns graphical user interface 🪟 windows Problems specific to the Windows OS
Projects
None yet
Development

No branches or pull requests

4 participants