Window customization with rust frontend #10279
-
In docs there is only javascript example for implementing functionality for titlebar buttons. After I set all permissions and css, I created <body>
<div data-tauri-drag-region class="titlebar">
<div class="titlebar-button" id="titlebar-minimize">
<img
src="https://api.iconify.design/mdi:window-minimize.svg"
alt="minimize"
/>
</div>
<div class="titlebar-button" id="titlebar-maximize">
<img
src="https://api.iconify.design/mdi:window-maximize.svg"
alt="maximize"
/>
</div>
<div class="titlebar-button" id="titlebar-close">
<img
src="https://api.iconify.design/mdi:close.svg"
alt="close"
/>
</div>
</div>
<script>
const { Window } = window.__TAURI__.window
const appWindow = new Window('main')
document
.getElementById('titlebar-minimize')
?.addEventListener('click', () => appWindow.minimize())
document
.getElementById('titlebar-maximize')
?.addEventListener('click', () => appWindow.toggleMaximize())
document
.getElementById('titlebar-close')
?.addEventListener('click', () => appWindow.close())
</script>
</body> After compiling, buttons are not working and all leptos frontend is gone. In web console there are these errors:
and
Also depending on what button I click console gives these errors:
How to do window customization in Tauri Leptos app correctly? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 12 replies
-
Sounds like you missed the permission section https://v2.tauri.app/plugin/window-customization/#permissions it applies no matter what frontend stack you're using. Edit: just saw you said you set those, apologies. But still, that's what the error is saying 🤔 |
Beta Was this translation helpful? Give feedback.
Ah then you're not on the latest version. Try just
getCurrent
then