5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-04 00:43:14 +08:00

Improve frameless example

This commit is contained in:
Lea Anthony 2024-12-27 09:37:55 +11:00
parent acd9241819
commit 0d4cb4698f
No known key found for this signature in database
GPG Key ID: 33DAF7BB90A58405

View File

@ -21,12 +21,27 @@
}
</style>
<script type="module" src="/wails/runtime.js"></script>
<script type="module">
document.addEventListener('DOMContentLoaded', (event) => {
let minimiseButton = document.querySelector('#min');
minimiseButton.addEventListener('click', function(event) {
window.wails.Window.Minimise();
setTimeout(function() {
window.wails.Window.UnMinimise();
}, 3000);
});
let closeButton = document.querySelector('#close');
closeButton.addEventListener('click', function(event) {
window.wails.Window.Close();
});
});
</script>
</head>
<body>
<div class="container">
<div class="quarter" style="background-color: lightblue; --wails-draggable: drag">Draggable</div>
<div class="quarter" style="background-color: lightgreen;">Not Draggable</div>
<div class="quarter" style="background-color: lightpink;">Not Draggable</div>
<div class="quarter" style="background-color: lightgreen;"><div>Not Draggable</div><button id="min">Minimise for 3s</button></div>
<div class="quarter" style="background-color: lightpink;"><div>Not Draggable</div><button id="close">Close</button></div>
<div class="quarter" style="background-color: lightyellow; --wails-draggable: drag">Draggable</div>
</div>
</body>