mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2026-03-05 05:20:59 -08:00
Revert "refactor: remove unused titlebar"
This reverts commit 6797b0436a.
This commit is contained in:
parent
ede2e43fa4
commit
bbee8e8a5e
4 changed files with 34 additions and 2 deletions
|
|
@ -167,7 +167,7 @@ const SidebarContainer = ({ children }: { children: React.ReactNode }): JSX.Elem
|
|||
|
||||
export default function Main(): JSX.Element {
|
||||
const workspacesList = useWorkspacesListObservable();
|
||||
const [{ attachToMenubar, sidebar, pauseNotifications, themeSource }, isFullScreen] = usePromiseValue<[Partial<IPreferences>, boolean | undefined]>(
|
||||
const [{ attachToMenubar, titleBar, sidebar, pauseNotifications, themeSource }, isFullScreen] = usePromiseValue<[Partial<IPreferences>, boolean | undefined]>(
|
||||
async () => await Promise.all([window.service.preference.getPreferences(), window.service.window.isFullScreen()]),
|
||||
[{}, false],
|
||||
)!;
|
||||
|
|
@ -189,7 +189,7 @@ export default function Main(): JSX.Element {
|
|||
<Root>
|
||||
{sidebar === true && (
|
||||
<SidebarContainer>
|
||||
<SidebarTop fullscreen={isFullScreen === true || attachToMenubar}>
|
||||
<SidebarTop fullscreen={isFullScreen === true || titleBar || attachToMenubar}>
|
||||
{workspacesList === undefined ? (
|
||||
<div>Loading...</div>
|
||||
) : (
|
||||
|
|
|
|||
|
|
@ -219,6 +219,7 @@ export default function Preferences(): JSX.Element {
|
|||
swipeToNavigate,
|
||||
syncDebounceInterval,
|
||||
themeSource,
|
||||
titleBar,
|
||||
unreadCountBadge,
|
||||
useHardwareAcceleration,
|
||||
} = preference;
|
||||
|
|
@ -351,6 +352,25 @@ export default function Preferences(): JSX.Element {
|
|||
/>
|
||||
</ListItemSecondaryAction>
|
||||
</ListItem>
|
||||
{platform === 'darwin' && (
|
||||
<>
|
||||
<Divider />
|
||||
<ListItem>
|
||||
<ListItemText primary={t('Preference.ShowTitleBar')} secondary={t('Preference.ShowTitleBarDetail')} />
|
||||
<ListItemSecondaryAction>
|
||||
<Switch
|
||||
edge="end"
|
||||
color="primary"
|
||||
checked={titleBar}
|
||||
onChange={async (event) => {
|
||||
await window.service.preference.set('titleBar', event.target.checked);
|
||||
await window.service.workspaceView.realignActiveWorkspace();
|
||||
}}
|
||||
/>
|
||||
</ListItemSecondaryAction>
|
||||
</ListItem>
|
||||
</>
|
||||
)}
|
||||
{platform !== 'darwin' && (
|
||||
<>
|
||||
<Divider />
|
||||
|
|
|
|||
|
|
@ -55,6 +55,16 @@ export class View implements IViewService {
|
|||
void this.workspaceViewService.realignActiveWorkspace();
|
||||
},
|
||||
},
|
||||
{
|
||||
label: () => (this.preferenceService.get('titleBar') ? 'Hide Title Bar' : 'Show Title Bar'),
|
||||
accelerator: 'CmdOrCtrl+Alt+T',
|
||||
enabled: process.platform === 'darwin',
|
||||
visible: process.platform === 'darwin',
|
||||
click: () => {
|
||||
void this.preferenceService.set('titleBar', !this.preferenceService.get('titleBar'));
|
||||
void this.workspaceViewService.realignActiveWorkspace();
|
||||
},
|
||||
},
|
||||
// same behavior as BrowserWindow with autoHideMenuBar: true
|
||||
// but with addition to readjust BrowserView so it won't cover the menu bar
|
||||
{
|
||||
|
|
|
|||
|
|
@ -102,6 +102,7 @@ export class Window implements IWindowService {
|
|||
this.setWindowMeta(windowName, meta);
|
||||
const existedWindowMeta = this.getWindowMeta(windowName);
|
||||
const attachToMenubar: boolean = this.preferenceService.get('attachToMenubar');
|
||||
const titleBar: boolean = this.preferenceService.get('titleBar');
|
||||
|
||||
if (existedWindow !== undefined) {
|
||||
// TODO: handle this menubar logic
|
||||
|
|
@ -151,6 +152,7 @@ export class Window implements IWindowService {
|
|||
minimizable: false,
|
||||
fullscreenable: false,
|
||||
autoHideMenuBar: false,
|
||||
titleBarStyle: titleBar ? 'default' : 'hidden',
|
||||
webPreferences: {
|
||||
devTools: true,
|
||||
nodeIntegration: false,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue