File tree Expand file tree Collapse file tree
frontend/src/components/window/title-bar Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88
99 import LayoutRow from " @graphite/components/layout/LayoutRow.svelte" ;
1010 import TextButton from " @graphite/components/widgets/buttons/TextButton.svelte" ;
11+ import WindowButtonsLinux from " @graphite/components/window/title-bar/WindowButtonsLinux.svelte" ;
1112 import WindowButtonsMac from " @graphite/components/window/title-bar/WindowButtonsMac.svelte" ;
1213 import WindowButtonsWeb from " @graphite/components/window/title-bar/WindowButtonsWeb.svelte" ;
1314 import WindowButtonsWindows from " @graphite/components/window/title-bar/WindowButtonsWindows.svelte" ;
8283 </LayoutRow >
8384 <!-- Window buttons (except on Mac) -->
8485 <LayoutRow class =" right" >
85- {#if platform === " Windows" || platform === " Linux " }
86+ {#if platform === " Windows" }
8687 <WindowButtonsWindows {maximized } />
88+ {:else if platform === " Linux" }
89+ <WindowButtonsLinux {maximized } />
8790 {:else if platform === " Web" }
8891 <WindowButtonsWeb />
8992 {/if }
Original file line number Diff line number Diff line change 1+ <script lang =" ts" >
2+ import { getContext } from " svelte" ;
3+
4+ import type { Editor } from " @graphite/editor" ;
5+
6+ import LayoutRow from " @graphite/components/layout/LayoutRow.svelte" ;
7+ import IconLabel from " @graphite/components/widgets/labels/IconLabel.svelte" ;
8+
9+ export let maximized;
10+
11+ const editor = getContext <Editor >(" editor" );
12+ </script >
13+
14+ <LayoutRow class ="window-button linux" tooltip ="Minimize" on:click ={() => editor .handle .appWindowMinimize ()}>
15+ <IconLabel icon ={" WindowButtonWinMinimize" } />
16+ </LayoutRow >
17+ <LayoutRow class ="window-button linux" tooltip ={maximized ? " Unmaximize" : " Maximize" } on:click ={() => editor .handle .appWindowMaximize ()}>
18+ <IconLabel icon ={maximized ? " WindowButtonWinRestoreDown" : " WindowButtonWinMaximize" } />
19+ </LayoutRow >
20+ <LayoutRow class ="window-button linux" tooltip ="Close" on:click ={() => editor .handle .appWindowClose ()}>
21+ <IconLabel icon ={" WindowButtonWinClose" } />
22+ </LayoutRow >
23+
24+ <style lang =" scss" global >
25+ .window-button.linux {
26+ flex : 0 0 auto ;
27+ align-items : center ;
28+ padding : 0 12px ;
29+
30+ svg {
31+ fill : var (--color-e-nearwhite );
32+ }
33+
34+ & :hover {
35+ background : var (--color-6-lowergray );
36+ border-radius : 2px ;
37+
38+ svg {
39+ fill : var (--color-f-white );
40+ }
41+ }
42+ }
43+ </style >
Original file line number Diff line number Diff line change 11<script lang =" ts" >
22 import { getContext } from " svelte" ;
33
4- import type { Editor } from " @graphite/editor" ;
54 import type { FullscreenState } from " @graphite/state-providers/fullscreen" ;
65
76 import LayoutRow from " @graphite/components/layout/LayoutRow.svelte" ;
87 import IconLabel from " @graphite/components/widgets/labels/IconLabel.svelte" ;
98 import TextLabel from " @graphite/components/widgets/labels/TextLabel.svelte" ;
109
11- const editor = getContext <Editor >(" editor" );
1210 const fullscreen = getContext <FullscreenState >(" fullscreen" );
1311
1412 $ : requestFullscreenHotkeys = fullscreen .keyboardLockApiSupported && ! $fullscreen .keyboardLocked ;
1513
16- async function handleClick(e : MouseEvent ) {
17- // TODO: Remove this debugging option to switch from web to desktop window buttons
18- if (e .ctrlKey && e .shiftKey && e .altKey ) {
19- editor .handle .appWindowMinimize ();
20- editor .handle .appWindowMinimize ();
21- return ;
22- }
23-
14+ async function handleClick() {
2415 if ($fullscreen .windowFullscreen ) fullscreen .exitFullscreen ();
2516 else fullscreen .enterFullscreen ();
2617 }
You can’t perform that action at this time.
0 commit comments