File tree Expand file tree Collapse file tree 3 files changed +27
-11
lines changed Expand file tree Collapse file tree 3 files changed +27
-11
lines changed Original file line number Diff line number Diff line change 1
1
"use client" ;
2
2
3
3
import { getCurrentWindow } from "@tauri-apps/api/window" ;
4
- import Button from "@/components/Button" ;
5
4
import { useEffect , useState } from "react" ;
6
5
import { Stack } from "react-bootstrap" ;
7
6
import { getUseCustomTitlebar } from "@/app/util" ;
@@ -21,6 +20,14 @@ const onClickMaximize = async () => {
21
20
22
21
const onClickMinimize = ( ) => getCurrentWindow ( ) . minimize ( ) ;
23
22
23
+ function TitleBarButton ( { icon, onClick } : { icon : string ; onClick : ( ) => Promise < void > } ) {
24
+ return (
25
+ < div className = "titlebar-button" onClick = { onClick } >
26
+ < i className = { "fa-solid fa-" + icon } > </ i >
27
+ </ div >
28
+ )
29
+ }
30
+
24
31
export default function TitleBar ( ) {
25
32
const [ show , setShow ] = useState < boolean > ( false ) ;
26
33
const [ appName , setAppName ] = useState < string > ( "" ) ;
@@ -39,22 +46,16 @@ export default function TitleBar() {
39
46
< div className = "titlebar" >
40
47
< span data-tauri-drag-region > { appName } </ span >
41
48
< Stack direction = "horizontal" className = "flex-row-reverse" gap = { 1 } >
42
- < Button
43
- variant = "danger"
49
+ < TitleBarButton
44
50
icon = "x"
45
- iconStyle = "solid"
46
51
onClick = { onClickClose }
47
52
/>
48
- < Button
49
- variant = "primary"
53
+ < TitleBarButton
50
54
icon = "window-maximize"
51
- iconStyle = "solid"
52
55
onClick = { onClickMaximize }
53
56
/>
54
- < Button
55
- variant = "primary"
57
+ < TitleBarButton
56
58
icon = "window-minimize"
57
- iconStyle = "solid"
58
59
onClick = { onClickMinimize }
59
60
/>
60
61
</ Stack >
Original file line number Diff line number Diff line change @@ -16,11 +16,14 @@ body {
16
16
overflow-x : hidden ;
17
17
}
18
18
19
- .titlebar button {
19
+ .titlebar- button {
20
20
width : 30px ;
21
21
height : 30px ;
22
22
padding : 1px !important ;
23
23
z-index : 3001 ;
24
+ display : flex ;
25
+ align-items : center ;
26
+ justify-content : center ;
24
27
}
25
28
26
29
.titlebar span {
Original file line number Diff line number Diff line change @@ -19,6 +19,10 @@ $title-bar-bg-opacity: 0.05;
19
19
background-color : rgba ($body-bg , $title-bar-bg-opacity )
20
20
}
21
21
22
+ .titlebar-button :hover {
23
+ background-color : rgba ($body-bg , $title-bar-bg-opacity * 2 );
24
+ }
25
+
22
26
.table-striped thead th {
23
27
background-color : #34476e ;
24
28
}
@@ -171,6 +175,10 @@ $title-bar-bg-opacity: 0.05;
171
175
background-color : rgba ($body-bg-dark , $title-bar-bg-opacity )
172
176
}
173
177
178
+ .titlebar-button :hover {
179
+ background-color : rgba ($body-bg-dark , $title-bar-bg-opacity * 2 );
180
+ }
181
+
174
182
.table-striped thead th {
175
183
background-color : #0099d8 ;
176
184
}
@@ -318,6 +326,10 @@ $title-bar-bg-opacity: 0.05;
318
326
background-color : $body-bg-dark ;
319
327
}
320
328
329
+ .titlebar-button {
330
+ border-radius : 100% ;
331
+ }
332
+
321
333
.btn {
322
334
color : $light !important ;
323
335
font-size : 12pt ;
You can’t perform that action at this time.
0 commit comments