tauri icon indicating copy to clipboard operation
tauri copied to clipboard

Custom Titlebar with navite Window-Controls (like in Electron) [feat]

Open Captainpast opened this issue 2 years ago • 3 comments

Describe the problem

May modern apps have content on the same level as the Window-Controls, like in GNOME or Windwos 11.

GNOME Settings: grafik

Windwos 11 file explorer; grafik

Describe the solution you'd like

A good solution already exists in ElectronJS with the Window-Controls-Overlay-API for JavaScript and the CSS-Environment-Variables https://github.com/WICG/window-controls-overlay/blob/main/explainer.md https://www.electronjs.org/docs/latest/api/browser-window#winsettitlebaroverlayoptions-windows

Alternatives considered

There is already tauri-controls, but this just native-looking Window-Controls and not change with the GTK-Theme

Additional context

No response

Captainpast avatar Apr 13 '24 18:04 Captainpast

With GTK in Linux/Unix the use of gtk::WindowControls (docs.gtk.org) could be a solution, but this is only existed since GTK4 and tao must first ported from GTK3 to 4.

Captainpast avatar Apr 14 '24 11:04 Captainpast

For what it's worth, I followed this tutorials for a custom title bar and it worked fine. See screenshot below. screenshot

yemikudaisi avatar Apr 15 '24 08:04 yemikudaisi

@yemikudaisi my problem with this solution is, the Window-Controls does not follow the system Theme on Linux and other platforms. As I mentioned, tauri-controls is there for easier native-looking Window-Controls, but their also problems with it on Windows (agmmnn/tauri-controls#26)

Captainpast avatar May 06 '24 16:05 Captainpast

Would be neat to have a custom title bar with the native behaviour without a complete workaround on each OS just like Electron provides.

jorgedanisc avatar Sep 14 '24 02:09 jorgedanisc

It's also ok to just have the same behavior as the native once, but it should use the system theme on Linux and other platforms. If you can, easy use the native Window-Controls like in GTK4 (on Linux) or WinUI 3 (on Windows) it should be used so you don't have to re implement the system natives functionality, like the snap layout menu on Windows.

And it should be an official implementation like in Electron

Captainpast avatar Sep 14 '24 12:09 Captainpast