Skip to content

Commit 2aa2e66

Browse files
committed
Fix centering About window on small screens
1 parent 7bc1342 commit 2aa2e66

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/functions.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,9 +1570,6 @@ function show_about_paint() {
15701570
$("#failed-to-check-if-outdated").attr("hidden", "hidden");
15711571
$("#outdated").attr("hidden", "hidden");
15721572

1573-
$about_paint_window.center();
1574-
$about_paint_window.center(); // @XXX - but it helps tho
1575-
15761573
$about_paint_window.$Button(localize("OK"), () => {
15771574
$about_paint_window.close();
15781575
})
@@ -1595,6 +1592,13 @@ function show_about_paint() {
15951592
show_news();
15961593
});//.focus();
15971594

1595+
// Hack to avoid mis-centering within small screens,
1596+
// due to dynamic width of window when it abuts the right side of the screen
1597+
// (due to line wrapping of text content at the right edge of the screen)
1598+
// TODO: include this in OS-GUI library's centering logic
1599+
$about_paint_window.css({ left: -innerWidth, top: -innerHeight });
1600+
$about_paint_window.center();
1601+
15981602
if (is_discord_embed) {
15991603
// No checking for updates in the Discord Activity for now at least.
16001604
// It's sandboxed, so it can't fetch the news without some extra server logic to proxy it,

0 commit comments

Comments
 (0)