From: Stefan Sterz <s.sterz@proxmox.com>
To: pmg-devel@lists.proxmox.com
Subject: [pmg-devel] [PATCH pmg-gui 3/3] quarantines: use a check mark for the dark mode filter
Date: Thu, 23 Mar 2023 16:44:55 +0100 [thread overview]
Message-ID: <20230323154455.1458701-4-s.sterz@proxmox.com> (raw)
In-Reply-To: <20230323154455.1458701-1-s.sterz@proxmox.com>
...instead of a toggle button. also adjusts the wording and adds a
separator.
Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
---
js/AttachmentQuarantine.js | 12 ++++++++----
js/SpamQuarantine.js | 12 ++++++++----
js/VirusQuarantine.js | 12 ++++++++----
js/controller/QuarantineController.js | 12 +++++++-----
4 files changed, 31 insertions(+), 17 deletions(-)
diff --git a/js/AttachmentQuarantine.js b/js/AttachmentQuarantine.js
index 6e9e546..52bda4c 100644
--- a/js/AttachmentQuarantine.js
+++ b/js/AttachmentQuarantine.js
@@ -108,10 +108,14 @@ Ext.define('PMG.AttachmentQuarantine', {
iconCls: 'fa fa-file-code-o',
},
{
- xtype: 'button',
- reference: 'themeToggle',
- text: gettext('Toggle Theme'),
- enableToggle: true,
+ xtype: 'tbseparator',
+ reference: 'themeCheckSep',
+ },
+ {
+ xtype: 'proxmoxcheckbox',
+ reference: 'themeCheck',
+ checked: true,
+ boxLabel: gettext('Dark-mode filter'),
iconCls: 'fa fa-paint-brush',
},
'->',
diff --git a/js/SpamQuarantine.js b/js/SpamQuarantine.js
index 093413d..a390dcf 100644
--- a/js/SpamQuarantine.js
+++ b/js/SpamQuarantine.js
@@ -225,10 +225,14 @@ Ext.define('PMG.SpamQuarantine', {
iconCls: 'fa fa-bullhorn',
},
{
- xtype: 'button',
- reference: 'themeToggle',
- text: gettext('Toggle Theme'),
- enableToggle: true,
+ xtype: 'tbseparator',
+ reference: 'themeCheckSep',
+ },
+ {
+ xtype: 'proxmoxcheckbox',
+ reference: 'themeCheck',
+ checked: true,
+ boxLabel: gettext('Dark-mode filter'),
iconCls: 'fa fa-paint-brush',
},
'->',
diff --git a/js/VirusQuarantine.js b/js/VirusQuarantine.js
index 08bd7d9..9e5a4fb 100644
--- a/js/VirusQuarantine.js
+++ b/js/VirusQuarantine.js
@@ -121,10 +121,14 @@ Ext.define('PMG.VirusQuarantine', {
iconCls: 'fa fa-file-code-o',
},
{
- xtype: 'button',
- reference: 'themeToggle',
- text: gettext('Toggle Theme'),
- enableToggle: true,
+ xtype: 'tbseparator',
+ reference: 'themeCheckSep',
+ },
+ {
+ xtype: 'proxmoxcheckbox',
+ reference: 'themeCheck',
+ checked: true,
+ boxLabel: gettext('Dark-mode filter'),
iconCls: 'fa fa-paint-brush',
},
'->',
diff --git a/js/controller/QuarantineController.js b/js/controller/QuarantineController.js
index 3135e2b..2a24389 100644
--- a/js/controller/QuarantineController.js
+++ b/js/controller/QuarantineController.js
@@ -46,21 +46,23 @@ Ext.define('PMG.controller.QuarantineController', {
hideThemeToggle: function(argument) {
let me = this;
- let themeButton = me.lookup("themeToggle");
+ let themeButton = me.lookup('themeCheck');
themeButton.disable();
themeButton.hide();
+ me.lookup('themeCheckSep').hide();
me.themed = true;
me.toggleTheme();
},
showThemeToggle: function(argument) {
let me = this;
- let themeButton = me.lookup("themeToggle");
+ let themeButton = me.lookup('themeCheck');
me.themed = false;
me.toggleTheme();
- themeButton.setPressed(true);
+ themeButton.setValue(true);
themeButton.enable();
themeButton.show();
+ me.lookup('themeCheckSep').show();
},
toggleRaw: function(button) {
@@ -226,8 +228,8 @@ Ext.define('PMG.controller.QuarantineController', {
'button[reference=raw]': {
click: 'toggleRaw',
},
- 'button[reference=themeToggle]': {
- click: 'toggleTheme',
+ 'proxmoxcheckbox[reference=themeCheck]': {
+ change: 'toggleTheme',
},
'pmgQuarantineList': {
selectionChange: 'onSelectMail',
--
2.30.2
next prev 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 ` [pmg-devel] [PATCH pmg-gui 2/3] quarantines: fix the default behavior of the theme toggle button Stefan Sterz
2023-03-23 15:44 ` Stefan Sterz [this message]
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-4-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