From 5b89efd07c984d10f1215bd30fe6f62b011dbb69 Mon Sep 17 00:00:00 2001 From: suchmememanyskill Date: Sat, 21 May 2022 19:36:22 +0200 Subject: [PATCH] Fix UI issues on newer steam deck version --- main.py | 2 +- main_view.html | 60 +++++++++++++++++++++---------- themes/Colored Toggles/shared.css | 6 ++-- 3 files changed, 45 insertions(+), 23 deletions(-) diff --git a/main.py b/main.py index 97b868a..f44b643 100644 --- a/main.py +++ b/main.py @@ -261,7 +261,7 @@ async def checkIfReady(self): try: await asyncio.sleep(1) if not await tab_has_element("SP", "test_css_loaded"): - + await asyncio.sleep(3) # Make sure everything is loaded? await inject_to_tab("SP", f""" (function() {{ diff --git a/main_view.html b/main_view.html index b0e2d69..079b17a 100644 --- a/main_view.html +++ b/main_view.html @@ -38,7 +38,7 @@ async function handleToggle(toggleId, name){ var toggle = document.getElementById(toggleId) - var state = toggle.classList.contains("gamepaddialog_On_yLrDA") + var state = toggle.classList.contains("gamepaddialog_On_3ld7T") if (toggle.hasAttribute("disabled")) return @@ -46,13 +46,13 @@ if (state) { toggle.setAttribute("disabled", "") await py_remove(name) - toggle.classList.remove("gamepaddialog_On_yLrDA") + toggle.classList.remove("gamepaddialog_On_3ld7T") toggle.removeAttribute("disabled") } else { toggle.setAttribute("disabled", "") await py_inject(name) - toggle.classList.add("gamepaddialog_On_yLrDA") + toggle.classList.add("gamepaddialog_On_3ld7T") toggle.removeAttribute("disabled") } } @@ -72,7 +72,7 @@ var menuToggle = clone.querySelector("#menuToggle") menuToggle.id = theme.name + "_toggle" if (theme.active) { - menuToggle.classList.add("gamepaddialog_On_yLrDA") + menuToggle.classList.add("gamepaddialog_On_3ld7T") } menuToggle.onclick = (function (toggleId, name) { return function() { @@ -152,30 +152,52 @@ .optionSelect option { font-size: 15; } + + .gamepaddialog_FieldLeadIcon_OKYIj > svg { + display: inline-block; + vertical-align: bottom; + margin-right: 10px; + margin-left: 10px; + } + + .toggleText { + display: inline-block; + } + + .gamepaddialog_FieldChildren_14_HB { + margin-left: auto; + } + + .themeToggle { + padding-bottom: 8px; + padding-top: 8px; + }