fix random text color
This commit is contained in:
parent
d11afa83fd
commit
fc86dcd967
|
@ -123,30 +123,6 @@ const Chat = ({
|
||||||
ref={targetRef}
|
ref={targetRef}
|
||||||
className="chat-container"
|
className="chat-container"
|
||||||
>
|
>
|
||||||
<div
|
|
||||||
className="chatlink"
|
|
||||||
style={{
|
|
||||||
fontSize: btnSize,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
onClick={(event) => {
|
|
||||||
const {
|
|
||||||
clientX,
|
|
||||||
clientY,
|
|
||||||
} = event;
|
|
||||||
dispatch(showContextMenu(
|
|
||||||
'CHANNEL',
|
|
||||||
clientX,
|
|
||||||
clientY,
|
|
||||||
{ cid: chatChannel },
|
|
||||||
));
|
|
||||||
}}
|
|
||||||
role="button"
|
|
||||||
title={t`Channel settings`}
|
|
||||||
tabIndex={-1}
|
|
||||||
>⚙</span>
|
|
||||||
</div>
|
|
||||||
<ul
|
<ul
|
||||||
className="chatarea"
|
className="chatarea"
|
||||||
ref={listRef}
|
ref={listRef}
|
||||||
|
@ -230,6 +206,30 @@ const Chat = ({
|
||||||
chatChannel={chatChannel}
|
chatChannel={chatChannel}
|
||||||
/>
|
/>
|
||||||
</form>
|
</form>
|
||||||
|
<div
|
||||||
|
className="chatlink"
|
||||||
|
style={{
|
||||||
|
fontSize: btnSize,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
onClick={(event) => {
|
||||||
|
const {
|
||||||
|
clientX,
|
||||||
|
clientY,
|
||||||
|
} = event;
|
||||||
|
dispatch(showContextMenu(
|
||||||
|
'CHANNEL',
|
||||||
|
clientX,
|
||||||
|
clientY,
|
||||||
|
{ cid: chatChannel },
|
||||||
|
));
|
||||||
|
}}
|
||||||
|
role="button"
|
||||||
|
title={t`Channel settings`}
|
||||||
|
tabIndex={-1}
|
||||||
|
>⚙</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -325,7 +325,7 @@ export function colorFromText(str) {
|
||||||
.toString(16)
|
.toString(16)
|
||||||
.toUpperCase();
|
.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;
|
g += 128;
|
||||||
b += 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}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -575,17 +575,6 @@ export function openWindow(
|
||||||
width = null,
|
width = null,
|
||||||
height = 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 {
|
return {
|
||||||
type: 'OPEN_WINDOW',
|
type: 'OPEN_WINDOW',
|
||||||
windowType,
|
windowType,
|
||||||
|
@ -873,9 +862,18 @@ export function hideAllWindowTypes(
|
||||||
}
|
}
|
||||||
|
|
||||||
export function openChatWindow() {
|
export function openChatWindow() {
|
||||||
|
const width = 350;
|
||||||
|
const height = 350;
|
||||||
return openWindow(
|
return openWindow(
|
||||||
'CHAT',
|
'CHAT',
|
||||||
'',
|
'',
|
||||||
|
null,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
window.innerWidth - width - 62,
|
||||||
|
window.innerHeight - height - 64,
|
||||||
|
width,
|
||||||
|
height,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,14 +26,15 @@ function generateWindowId(state) {
|
||||||
* clamp size and position to screen borders and restrictions
|
* clamp size and position to screen borders and restrictions
|
||||||
*/
|
*/
|
||||||
function clampSize(prefWidth, prefHeight, margin = false) {
|
function clampSize(prefWidth, prefHeight, margin = false) {
|
||||||
const width = prefWidth || 550;
|
|
||||||
const height = prefHeight || 330;
|
|
||||||
let maxWidth = window.innerWidth;
|
let maxWidth = window.innerWidth;
|
||||||
let maxHeight = window.innerHeight;
|
let maxHeight = window.innerHeight;
|
||||||
if (margin) {
|
if (margin) {
|
||||||
maxWidth = Math.floor(maxWidth * 0.75);
|
// same as modal in default.css
|
||||||
maxHeight = Math.floor(maxHeight * 0.75);
|
maxWidth = Math.floor(maxWidth * 0.70);
|
||||||
|
maxHeight = Math.floor(Math.min(maxHeight * 0.80, 900));
|
||||||
}
|
}
|
||||||
|
const width = prefWidth || maxWidth;
|
||||||
|
const height = prefHeight || maxHeight;
|
||||||
return [
|
return [
|
||||||
clamp(
|
clamp(
|
||||||
width,
|
width,
|
||||||
|
|
|
@ -643,7 +643,7 @@ tr:nth-child(even) {
|
||||||
max-height: none;
|
max-height: none;
|
||||||
outline: none;
|
outline: none;
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: inherit;
|
border-radius: inherit !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal {
|
.modal {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user