fix(ags overview): put a limit on icon sizes
This commit is contained in:
parent
fbe8d06de1
commit
74fe2e3419
1 changed files with 13 additions and 6 deletions
|
@ -6,13 +6,20 @@ import { WindowButton } from './dragndrop.js';
|
||||||
import * as VARS from './variables.js';
|
import * as VARS from './variables.js';
|
||||||
|
|
||||||
const scale = size => size * VARS.SCALE - VARS.MARGIN;
|
const scale = size => size * VARS.SCALE - VARS.MARGIN;
|
||||||
const getFontSize = client => Math.min(scale(client.size[0]),
|
const getFontSize = client => {
|
||||||
scale(client.size[1])) * VARS.ICON_SCALE;
|
const valX = scale(client.size[0]) * VARS.ICON_SCALE;
|
||||||
|
const valY = scale(client.size[1]) * VARS.ICON_SCALE;
|
||||||
|
|
||||||
const IconStyle = client => `transition: font-size 0.2s linear;
|
var size = Math.min(valX, valY);
|
||||||
min-width: ${scale(client.size[0])}px;
|
return size <= 0 ? 0.1 : size;
|
||||||
min-height: ${scale(client.size[1])}px;
|
};
|
||||||
font-size: ${getFontSize(client)}px;`;
|
|
||||||
|
const IconStyle = client => `
|
||||||
|
transition: font-size 0.2s linear;
|
||||||
|
min-width: ${scale(client.size[0])}px;
|
||||||
|
min-height: ${scale(client.size[1])}px;
|
||||||
|
font-size: ${getFontSize(client)}px;
|
||||||
|
`;
|
||||||
|
|
||||||
|
|
||||||
const Client = (client, active, clients) => {
|
const Client = (client, active, clients) => {
|
||||||
|
|
Loading…
Reference in a new issue