diff --git a/src/components/windows/Chat.jsx b/src/components/windows/Chat.jsx
index 1a9a2de..f0dfb29 100644
--- a/src/components/windows/Chat.jsx
+++ b/src/components/windows/Chat.jsx
@@ -123,30 +123,6 @@ const Chat = ({
ref={targetRef}
className="chat-container"
>
-
- {
- const {
- clientX,
- clientY,
- } = event;
- dispatch(showContextMenu(
- 'CHANNEL',
- clientX,
- clientY,
- { cid: chatChannel },
- ));
- }}
- role="button"
- title={t`Channel settings`}
- tabIndex={-1}
- >⚙
-
+
+ {
+ const {
+ clientX,
+ clientY,
+ } = event;
+ dispatch(showContextMenu(
+ 'CHANNEL',
+ clientX,
+ clientY,
+ { cid: chatChannel },
+ ));
+ }}
+ role="button"
+ title={t`Channel settings`}
+ tabIndex={-1}
+ >⚙
+
);
};
diff --git a/src/core/utils.js b/src/core/utils.js
index 3d9fef6..d2ba212 100644
--- a/src/core/utils.js
+++ b/src/core/utils.js
@@ -325,7 +325,7 @@ export function colorFromText(str) {
.toString(16)
.toUpperCase();
- return `#${'00000'.substring(0, 6 - c.length)}${c}`;
+ return `#${`00000${c}`.slice(-6)}`;
}
/*
@@ -346,7 +346,10 @@ export function setBrightness(hex, dark = false) {
g += 128;
b += 128;
}
- return `#${r.toString(16)}${g.toString(16)}${b.toString(16)}`;
+ r = `0${r.toString(16)}`.slice(-2);
+ g = `0${g.toString(16)}`.slice(-2);
+ b = `0${b.toString(16)}`.slice(-2);
+ return `#${r}${g}${b}`;
}
/*
diff --git a/src/store/actions/index.js b/src/store/actions/index.js
index d1ffc5f..7f3e586 100644
--- a/src/store/actions/index.js
+++ b/src/store/actions/index.js
@@ -575,17 +575,6 @@ export function openWindow(
width = null,
height = null,
) {
- /*
- * default window size
- */
- if (!fullscreen
- && (!xPos || !width || !yPos || !height)) {
- width = 340;
- height = 400;
- xPos = window.innerWidth - width - 62;
- yPos = window.innerHeight - height - 64;
- }
-
return {
type: 'OPEN_WINDOW',
windowType,
@@ -873,9 +862,18 @@ export function hideAllWindowTypes(
}
export function openChatWindow() {
+ const width = 350;
+ const height = 350;
return openWindow(
'CHAT',
'',
+ null,
+ false,
+ true,
+ window.innerWidth - width - 62,
+ window.innerHeight - height - 64,
+ width,
+ height,
);
}
diff --git a/src/store/reducers/windows.js b/src/store/reducers/windows.js
index f5eccca..da559ee 100644
--- a/src/store/reducers/windows.js
+++ b/src/store/reducers/windows.js
@@ -26,14 +26,15 @@ function generateWindowId(state) {
* clamp size and position to screen borders and restrictions
*/
function clampSize(prefWidth, prefHeight, margin = false) {
- const width = prefWidth || 550;
- const height = prefHeight || 330;
let maxWidth = window.innerWidth;
let maxHeight = window.innerHeight;
if (margin) {
- maxWidth = Math.floor(maxWidth * 0.75);
- maxHeight = Math.floor(maxHeight * 0.75);
+ // same as modal in default.css
+ maxWidth = Math.floor(maxWidth * 0.70);
+ maxHeight = Math.floor(Math.min(maxHeight * 0.80, 900));
}
+ const width = prefWidth || maxWidth;
+ const height = prefHeight || maxHeight;
return [
clamp(
width,
diff --git a/src/styles/default.css b/src/styles/default.css
index 5afed3e..c2328c1 100644
--- a/src/styles/default.css
+++ b/src/styles/default.css
@@ -643,7 +643,7 @@ tr:nth-child(even) {
max-height: none;
outline: none;
border: none;
- border-radius: inherit;
+ border-radius: inherit !important;
}
.modal {