public inbox for pmg-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Stefan Sterz <s.sterz@proxmox.com>
To: pmg-devel@lists.proxmox.com
Subject: [pmg-devel] [PATCH pmg-gui 2/3] quarantines: fix the default behavior of the theme toggle button
Date: Thu, 23 Mar 2023 16:44:54 +0100	[thread overview]
Message-ID: <20230323154455.1458701-3-s.sterz@proxmox.com> (raw)
In-Reply-To: <20230323154455.1458701-1-s.sterz@proxmox.com>

since the default theme is "auto" now, the behavior of the dark theme
toggle needs to be adjust accordingly.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
---
checking for null here explicitly as that is the documented behavior
if the cookie does not exist [1].

https://docs-devel.sencha.com/extjs/6.0.0/classic/Ext.util.Cookies.html#method-get

 js/controller/QuarantineController.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/js/controller/QuarantineController.js b/js/controller/QuarantineController.js
index 15e69fa..3135e2b 100644
--- a/js/controller/QuarantineController.js
+++ b/js/controller/QuarantineController.js
@@ -194,7 +194,7 @@ Ext.define('PMG.controller.QuarantineController', {
 	let me = this;
 	let currentTheme = Ext.util.Cookies.get("PMGThemeCookie");
 
-	if (currentTheme === "auto") {
+	if (currentTheme === "__default__" || currentTheme === null) {
 	    me.mediaQueryList = window.matchMedia("(prefers-color-scheme: dark)");
 
 	    me.themeListener = (e) => {
@@ -207,7 +207,7 @@ Ext.define('PMG.controller.QuarantineController', {
 
 	    me.themeListener(me.mediaQueryList);
 	    me.mediaQueryList.addEventListener("change", me.themeListener);
-	} else if (currentTheme === "__default__") {
+	} else if (currentTheme === "crisp") {
 	    me.hideThemeToggle();
 	} else {
 	    me.showThemeToggle();
-- 
2.30.2





  parent reply	other threads:[~2023-03-23 15:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-23 15:44 [pmg-devel] [PATCH pmg-{api, gui} 0/3] Proxmox Dark Theme Fixes - PMG Stefan Sterz
2023-03-23 15:44 ` [pmg-devel] [PATCH pmg-api 1/3] proxy: initialize the theme variable with an empty string Stefan Sterz
2023-03-23 15:44 ` Stefan Sterz [this message]
2023-03-23 15:44 ` [pmg-devel] [PATCH pmg-gui 3/3] quarantines: use a check mark for the dark mode filter Stefan Sterz
2023-03-23 16:24 ` [pmg-devel] applied-series: [PATCH pmg-{api, gui} 0/3] Proxmox Dark Theme Fixes - PMG Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230323154455.1458701-3-s.sterz@proxmox.com \
    --to=s.sterz@proxmox.com \
    --cc=pmg-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal