Skip to content

Commit 6be3588

Browse files
authored
TGUI window flashing begone (#761)
1 parent e7235ca commit 6be3588

4 files changed

Lines changed: 19 additions & 38 deletions

File tree

html/statbrowser.css

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.light:root {
2-
--scrollbar-base: #f2f2f2;
3-
--scrollbar-thumb: #a7a7a7;
2+
--color-base: #ffffff;
3+
--scrollbar-base: #f2f2f2;
4+
--scrollbar-thumb: #a7a7a7;
45
}
56

67
html,
@@ -197,20 +198,14 @@ img {
197198
* MARK: Dark theme colors
198199
*/
199200
.dark:root {
200-
--scrollbar-base: #151515;
201-
--scrollbar-thumb: #363636;
201+
--color-base: #151515;
202+
--scrollbar-base: #151515;
203+
--scrollbar-thumb: #363636;
202204
}
203205

204206
body.dark {
205-
background-color: #151515;
206-
color: #b2c4dd;
207-
scrollbar-base-color: #1c1c1c;
208-
scrollbar-face-color: #3b3b3b;
209-
scrollbar-3dlight-color: #252525;
210-
scrollbar-highlight-color: #252525;
211-
scrollbar-track-color: #1c1c1c;
212-
scrollbar-arrow-color: #929292;
213-
scrollbar-shadow-color: #3b3b3b;
207+
background-color: #151515;
208+
color: #b2c4dd;
214209
}
215210

216211
.dark a {

html/statbrowser.js

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -703,15 +703,13 @@ function draw_verbs(cat) {
703703
}
704704

705705
function set_theme(which) {
706-
if (which == "light") {
707-
document.body.className = "";
708-
document.documentElement.className = 'light';
709-
set_style_sheet("browserOutput_white");
710-
} else if (which == "dark") {
711-
document.body.className = "dark";
712-
document.documentElement.className = 'dark';
713-
set_style_sheet("browserOutput");
714-
}
706+
if (which == "light") {
707+
document.body.className = "";
708+
document.documentElement.className = "light";
709+
} else if (which == "dark") {
710+
document.body.className = "dark";
711+
document.documentElement.className = "dark";
712+
}
715713
}
716714

717715
function set_font_size(size) {
@@ -731,21 +729,6 @@ function set_tabs_style(style) {
731729
}
732730
}
733731

734-
function set_style_sheet(sheet) {
735-
if (document.getElementById("goonStyle")) {
736-
var currentSheet = document.getElementById("goonStyle");
737-
currentSheet.parentElement.removeChild(currentSheet);
738-
}
739-
var head = document.getElementsByTagName('head')[0];
740-
var sheetElement = document.createElement("link");
741-
sheetElement.id = "goonStyle";
742-
sheetElement.rel = "stylesheet";
743-
sheetElement.type = "text/css";
744-
sheetElement.href = sheet + ".css";
745-
sheetElement.media = 'all';
746-
head.appendChild(sheetElement);
747-
}
748-
749732
function restoreFocus() {
750733
run_after_focus(function () {
751734
Byond.winset('map', {

tgui/packages/tgui/backend.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,10 @@ export const backendMiddleware = (store) => {
225225
suspendRenderer();
226226
clearInterval(suspendInterval);
227227
suspendInterval = undefined;
228+
// Tiny window to not show previous content when resumed
228229
Byond.winset(Byond.windowId, {
230+
size: '1x1',
231+
pos: '1,1',
229232
'is-visible': false,
230233
});
231234
setTimeout(() => focusMap());

tgui/public/tgui.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<!-- tgui:ntos-error -->
1414
<!-- tgui:inline-css -->
1515
</head>
16-
<body>
16+
<body style="background-color: var(--color-base)">
1717
<!-- tgui:assets -->
1818
<!-- tgui:inline-html-start -->
1919
<!-- tgui:inline-html -->

0 commit comments

Comments
 (0)