aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/appearance
diff options
context:
space:
mode:
Diffstat (limited to 'src/features/appearance')
-rw-r--r--src/features/appearance/index.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/features/appearance/index.js b/src/features/appearance/index.js
index 6dcdfc986..a14d1461e 100644
--- a/src/features/appearance/index.js
+++ b/src/features/appearance/index.js
@@ -63,6 +63,22 @@ function generateServiceRibbonWidthStyle(widthStr, iconSizeStr) {
63 `; 63 `;
64} 64}
65 65
66function generateShowDragAreaStyle(accentColor) {
67 return `
68 .sidebar {
69 padding-top: 0px !important;
70 }
71 .window-draggable {
72 position: initial;
73 background-color: ${accentColor};
74 }
75 #root {
76 /** Remove 22px from app height, otherwise the page will be to high */
77 height: calc(100% - 22px);
78 }
79 `;
80}
81
66function generateStyle(settings) { 82function generateStyle(settings) {
67 let style = ''; 83 let style = '';
68 84
@@ -70,6 +86,7 @@ function generateStyle(settings) {
70 accentColor, 86 accentColor,
71 serviceRibbonWidth, 87 serviceRibbonWidth,
72 iconSize, 88 iconSize,
89 showDragArea,
73 } = settings; 90 } = settings;
74 91
75 if (accentColor !== DEFAULT_APP_SETTINGS.accentColor) { 92 if (accentColor !== DEFAULT_APP_SETTINGS.accentColor) {
@@ -79,6 +96,9 @@ function generateStyle(settings) {
79 || iconSize !== DEFAULT_APP_SETTINGS.iconSize) { 96 || iconSize !== DEFAULT_APP_SETTINGS.iconSize) {
80 style += generateServiceRibbonWidthStyle(serviceRibbonWidth, iconSize); 97 style += generateServiceRibbonWidthStyle(serviceRibbonWidth, iconSize);
81 } 98 }
99 if (showDragArea) {
100 style += generateShowDragAreaStyle(accentColor);
101 }
82 102
83 return style; 103 return style;
84} 104}
@@ -121,4 +141,13 @@ export default function initAppearance(stores) {
121 updateStyle(settings.all.app); 141 updateStyle(settings.all.app);
122 }, 142 },
123 ); 143 );
144 // Update draggable area
145 reaction(
146 () => (
147 settings.all.app.showDragArea
148 ),
149 () => {
150 updateStyle(settings.all.app);
151 },
152 );
124} 153}