Skip to content

Commit 0ce8794

Browse files
committed
fix: useWorkspaceDrawerIconStyle with useHorizontalStyle
1 parent cbbe468 commit 0ce8794

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

src/components/layout/AppLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const styles = (theme: { workspaces: { drawer: { width: any } } }) => ({
6565
transform() {
6666
return workspaceStore.isWorkspaceDrawerOpen
6767
? 'translateX(0)'
68-
: `translateX(-75px)`;
68+
: 'translateX(-75px)';
6969
},
7070
},
7171
titleBar: {

src/features/appearance/index.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,11 @@ function generateShowDragAreaStyle(accentColor) {
330330
`;
331331
}
332332

333-
function generateVerticalStyle(widthStr, alwaysShowWorkspaces) {
333+
function generateVerticalStyle(
334+
widthStr,
335+
alwaysShowWorkspaces,
336+
useWorkspaceDrawerIconStyle,
337+
) {
334338
if (!document.querySelector('#vertical-style')) {
335339
const link = document.createElement('link');
336340
link.id = 'vertical-style';
@@ -343,13 +347,14 @@ function generateVerticalStyle(widthStr, alwaysShowWorkspaces) {
343347
const width = Number(widthStr);
344348
const sidebarWidth = width - 4;
345349
const verticalStyleOffset = 29;
350+
const drawerWidth = useWorkspaceDrawerIconStyle ? '75px' : '300px';
346351

347352
return `
348353
.sidebar {
349354
${
350-
alwaysShowWorkspaces
355+
alwaysShowWorkspaces || useWorkspaceDrawerIconStyle
351356
? `
352-
width: calc(100% - 300px) !important;
357+
width: calc(100% - ${drawerWidth}) !important;
353358
`
354359
: ''
355360
}
@@ -395,6 +400,7 @@ function generateStyle(settings, app) {
395400
useHorizontalStyle,
396401
alwaysShowWorkspaces,
397402
showServiceName,
403+
useWorkspaceDrawerIconStyle,
398404
} = settings;
399405

400406
const { isFullScreen } = app;
@@ -423,7 +429,11 @@ function generateStyle(settings, app) {
423429
style += generateShowDragAreaStyle(accentColor);
424430
}
425431
if (useHorizontalStyle) {
426-
style += generateVerticalStyle(serviceRibbonWidth, alwaysShowWorkspaces);
432+
style += generateVerticalStyle(
433+
serviceRibbonWidth,
434+
alwaysShowWorkspaces,
435+
useWorkspaceDrawerIconStyle,
436+
);
427437
} else if (document.querySelector('#vertical-style')) {
428438
const link = document.querySelector('#vertical-style');
429439
if (link) {

0 commit comments

Comments
 (0)