Skip to content

Commit d2b0f74

Browse files
bugfix: Tgui say zoom (#6756)
1 parent 1837c92 commit d2b0f74

File tree

8 files changed

+26
-38
lines changed

8 files changed

+26
-38
lines changed

tgui/packages/tgui-say/TguiSay.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export class TguiSay extends Component<{}, State> {
7474
}
7575

7676
componentDidMount() {
77+
windowSet(WINDOW_SIZES.small);
7778
Byond.subscribeTo('props', this.handleProps);
7879
Byond.subscribeTo('open', this.handleOpen);
7980
}
@@ -305,6 +306,7 @@ export class TguiSay extends Component<{}, State> {
305306
const { maxLength, lightMode } = data;
306307
this.maxLength = maxLength;
307308
this.lightMode = !!lightMode;
309+
window.document.body.style['zoom'] = `${100 / window.devicePixelRatio}%`;
308310
};
309311

310312
reset() {

tgui/packages/tgui-say/helpers.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,13 @@ export const windowSet = (size = WINDOW_SIZES.small) => {
3939

4040
/** Helper function to set window size and visibility */
4141
const setWindowVisibility = (visible: boolean) => {
42+
let sizeStr = `${WINDOW_SIZES.width}x${WINDOW_SIZES.small}`;
4243
Byond.winset('tgui_say', {
4344
'is-visible': visible,
44-
size: `${WINDOW_SIZES.width}x${WINDOW_SIZES.small}`,
45+
size: sizeStr,
46+
});
47+
48+
Byond.winset('tgui_say.browser', {
49+
size: sizeStr,
4550
});
4651
};

tgui/packages/tgui-say/styles/window.scss

+8-28
Original file line numberDiff line numberDiff line change
@@ -21,35 +21,15 @@
2121
background-color: colors.$lightMode;
2222
}
2323

24-
// Remove conditionals with 516
25-
@supports (not (-webkit-hyphens: none)) and (not (-moz-appearance: none)) {
26-
#react-root {
27-
display: flex;
28-
flex-direction: column;
29-
flex: 1;
30-
height: 100%;
31-
width: 100%;
32-
}
33-
34-
/** Window sizes */
35-
.window {
36-
flex: 1;
37-
min-height: 0;
38-
}
24+
/** Window sizes */
25+
.window-30 {
26+
height: 30px;
3927
}
4028

41-
// Remove with 516
42-
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
43-
/** Window sizes */
44-
.window-30 {
45-
height: 30px;
46-
}
47-
48-
.window-50 {
49-
height: 50px;
50-
}
29+
.window-50 {
30+
height: 50px;
31+
}
5132

52-
.window-70 {
53-
height: 70px;
54-
}
33+
.window-70 {
34+
height: 70px;
5535
}

tgui/packages/tgui/components/Input.js

+1
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ export class Input extends Component {
159159
autofocus={false}
160160
ref={this.inputRef}
161161
className="Input__input"
162+
type="search"
162163
placeholder={placeholder}
163164
onInput={this.handleInput}
164165
onFocus={this.handleFocus}

tgui/public/tgui-panel.bundle.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)