mirror of
https://github.com/SableClient/Sable.git
synced 2026-11-21 09:31:17 -08:00
fix(windows): correct title bar name
This commit is contained in:
1 parent
5628c5cc28
commit
1399d3abc6
1 file changed
+11
-1
@@ -91,6 +91,7 @@ function CloseIcon() {
|
||||
|
||||
export function WindowsTitleBar() {
|
||||
const [maximized, setMaximized] = useState(false);
|
||||
const [windowTitle, setWindowTitle] = useState('Sable');
|
||||
const appWindowRef = useRef<Window | null>(null);
|
||||
const snapTimerRef = useRef<number | undefined>(undefined);
|
||||
const isWindowsDesktopTauri = isTauri() && osType() === 'windows';
|
||||
@@ -114,6 +115,15 @@ export function WindowsTitleBar() {
|
||||
let unlistenResize: (() => void) | undefined;
|
||||
let unlistenTracking: (() => void) | undefined;
|
||||
|
||||
appWindow
|
||||
.title()
|
||||
.then((title) => {
|
||||
if (mounted) setWindowTitle(title);
|
||||
})
|
||||
.catch((error) => {
|
||||
log.warn('Failed to read window title:', error);
|
||||
});
|
||||
|
||||
const syncMaximized = async () => {
|
||||
try {
|
||||
const isMaximizedState = await appWindow.isMaximized();
|
||||
@@ -245,7 +255,7 @@ export function WindowsTitleBar() {
|
||||
<nav className="tauri-titlebar">
|
||||
<div className="tauri-titlebar__drag" data-tauri-drag-region>
|
||||
<span className="tauri-titlebar__title" data-tauri-drag-region>
|
||||
sable
|
||||
{windowTitle}
|
||||
</span>
|
||||
</div>
|
||||
<div className="tauri-titlebar__status" data-tauri-drag-region>
|
||||
|
||||
Reference in new issue
Block a user