Skip to content

Commit e7d6321

Browse files
committed
feat: use integer pixels for layout
1 parent 338b502 commit e7d6321

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

electron/renderer/pages/grid.tsx

+15-12
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ const GridPage: React.FC = (): ReactNode => {
6262
return new rxjs.Subject<GameLogLine>();
6363
});
6464

65+
// TODO load the grid config items
66+
// TODO load the grid layout items
67+
6568
const { euiTheme } = useEuiTheme();
6669

6770
const computeTextStyles = useCallback((): SerializedStyles => {
@@ -90,7 +93,7 @@ const GridPage: React.FC = (): ReactNode => {
9093
// return an object that indicates with keys from the euiTheme to use
9194
// For example, { fontFamily: 'code', fontSize: 'm', fontWeight: 'bold', color: 'title' }
9295
// This will allow the GameStreamText component to apply the correct styles
93-
// when the user's swaps the theme from light to dark mode
96+
// when the user swaps the theme from light to dark mode
9497
const textStyles = css({
9598
fontFamily,
9699
fontSize,
@@ -395,8 +398,8 @@ const GridPage: React.FC = (): ReactNode => {
395398
layout: {
396399
x: 0,
397400
y: 0,
398-
width: 100,
399-
height: 100,
401+
width: 828,
402+
height: 200,
400403
},
401404
});
402405

@@ -405,10 +408,10 @@ const GridPage: React.FC = (): ReactNode => {
405408
itemTitle: 'Experience',
406409
isFocused: false,
407410
layout: {
408-
x: 200,
411+
x: 828,
409412
y: 0,
410-
width: 100,
411-
height: 100,
413+
width: 306,
414+
height: 392,
412415
},
413416
});
414417

@@ -417,10 +420,10 @@ const GridPage: React.FC = (): ReactNode => {
417420
itemTitle: 'Spells',
418421
isFocused: false,
419422
layout: {
420-
x: 800,
421-
y: 0,
422-
width: 100,
423-
height: 100,
423+
x: 828,
424+
y: 390,
425+
width: 306,
426+
height: 310,
424427
},
425428
});
426429

@@ -431,8 +434,8 @@ const GridPage: React.FC = (): ReactNode => {
431434
layout: {
432435
x: 0,
433436
y: 200,
434-
width: 200,
435-
height: 200,
437+
width: 828,
438+
height: 500,
436439
},
437440
});
438441

0 commit comments

Comments
 (0)