fix: Window maximize fix + slight popup tweaks
This commit is contained in:
parent
5b25e50ab8
commit
9f9be695ad
5 changed files with 10 additions and 9 deletions
|
|
@ -13,6 +13,8 @@
|
|||
"window:allow-start-dragging",
|
||||
"window:allow-minimize",
|
||||
"window:allow-maximize",
|
||||
"window:allow-toggle-maximize",
|
||||
"window:allow-internal-toggle-maximize",
|
||||
"event:default",
|
||||
"shell:allow-open"
|
||||
]
|
||||
|
|
|
|||
|
|
@ -88,10 +88,7 @@ function Navbar() {
|
|||
<AccountPopup
|
||||
visible={profileMenuOpen}
|
||||
setVisible={setProfileMenuOpen}
|
||||
ref={(el) => {
|
||||
el.style.left = `${profileButton.getBoundingClientRect().right - el.getBoundingClientRect().width}px`;
|
||||
el.style.top = `${profileButton.getBoundingClientRect().bottom}px`;
|
||||
}}
|
||||
ref={el => Popup.setPos(profileButton, el)}
|
||||
class="mt-2"
|
||||
/>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { Window } from '@tauri-apps/api/window';
|
||||
import { ChevronLeftIcon, MinusIcon, XCloseIcon } from '@untitled-theme/icons-solid';
|
||||
import { ChevronLeftIcon, Maximize02Icon, MinusIcon, XCloseIcon } from '@untitled-theme/icons-solid';
|
||||
import type { JSX } from 'solid-js';
|
||||
import { createSignal, onMount } from 'solid-js';
|
||||
import Modal from './overlay/Modal';
|
||||
|
|
@ -25,9 +25,10 @@ function TitlebarButton(props: TitlebarButtonProps) {
|
|||
function WindowFrame() {
|
||||
const [isModalVisible, setModalVisible] = createSignal(false);
|
||||
|
||||
const maximize = () => Window.getCurrent().toggleMaximize();
|
||||
const minimize = () => Window.getCurrent().minimize();
|
||||
const quit = () => Window.getCurrent().close();
|
||||
// const kill = () => Window.getCurrent().destroy();
|
||||
const kill = () => Window.getCurrent().destroy();
|
||||
|
||||
onMount(() => {
|
||||
Window.getCurrent().onCloseRequested((event) => {
|
||||
|
|
@ -46,6 +47,7 @@ function WindowFrame() {
|
|||
|
||||
<div class="flex flex-row items-center justify-end">
|
||||
<TitlebarButton icon={MinusIcon} onClick={() => minimize()} />
|
||||
<TitlebarButton icon={Maximize02Icon} onClick={() => maximize()} />
|
||||
<TitlebarButton icon={XCloseIcon} onClick={() => quit()} danger />
|
||||
</div>
|
||||
|
||||
|
|
@ -55,7 +57,7 @@ function WindowFrame() {
|
|||
setVisible={setModalVisible}
|
||||
buttons={[
|
||||
<Button buttonStyle="secondary" onClick={() => setModalVisible(false)}>No</Button>,
|
||||
<Button buttonStyle="danger" onClick={() => quit()}>Yes</Button>,
|
||||
<Button buttonStyle="danger" onClick={() => kill()}>Yes</Button>,
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ function AccountPopup(props: Popup.PopupProps) {
|
|||
|
||||
return (
|
||||
<Popup {...props}>
|
||||
<div class="bg-secondary rounded-xl border border-gray-10 w-72 p-2 shadow-lg shadow-black/50">
|
||||
<div class="bg-secondary rounded-xl border border-gray-10 w-72 p-2 shadow-md shadow-black/30">
|
||||
<div class="flex flex-col gap-y-2 text-fg-primary">
|
||||
<AccountComponent username={loggedInAccount.username} uuid={loggedInAccount.uuid} loggedIn />
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ function NotificationPopup(props: Popup.PopupProps) {
|
|||
|
||||
return (
|
||||
<Popup {...props}>
|
||||
<div class="bg-secondary rounded-xl border border-gray-10 w-96 p-2 shadow-lg shadow-black/50">
|
||||
<div class="bg-secondary rounded-xl border border-gray-10 w-96 p-2 shadow-md shadow-black/30">
|
||||
<div class="overflow-hidden transition-[height]" ref={parent}>
|
||||
<div class="flex flex-col justify-start items-stretch text-start gap-2" ref={inner}>
|
||||
<p class="text-2lg px-2 pt-1">Notifications</p>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue