From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 9370B90692 for ; Thu, 9 Mar 2023 09:01:12 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 74E716F69 for ; Thu, 9 Mar 2023 09:00:42 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Thu, 9 Mar 2023 09:00:41 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 822E6416E8 for ; Thu, 9 Mar 2023 09:00:41 +0100 (CET) From: Stefan Sterz To: pmg-devel@lists.proxmox.com Date: Thu, 9 Mar 2023 09:00:36 +0100 Message-Id: <20230309080036.28996-1-s.sterz@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230308161840.2396113-1-s.sterz@proxmox.com> References: <20230308161840.2396113-1-s.sterz@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.077 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pmg-devel] [PATCH pmg-gui v1 1/6] mainview/quarantine: add theme switcher X-BeenThere: pmg-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Mail Gateway development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Mar 2023 08:01:12 -0000 adds a theme switcher to the main view and quarantine so that users can choose a theme. this requires a bump to the widget toolkit so the necessary widget are present. Signed-off-by: Stefan Sterz --- js/MainView.js | 8 ++++++++ js/QuarantineView.js | 12 ++++++++++++ pmg-index.html.tt | 7 +++++++ 3 files changed, 27 insertions(+) diff --git a/js/MainView.js b/js/MainView.js index 311b8c7..2cc140c 100644 --- a/js/MainView.js +++ b/js/MainView.js @@ -208,6 +208,14 @@ Ext.define('PMG.MainView', { text: gettext('My Settings'), handler: () => Ext.create('PMG.window.Settings').show(), }, + { + iconCls: 'fa fa-paint-brush', + text: gettext('Theme'), + handler: () => Ext.create('Proxmox.window.ThemeEditWindow', { + cookieName: 'PMGThemeCookie', + autoShow: true, + }), + }, { iconCls: 'fa fa-language', text: gettext('Language'), diff --git a/js/QuarantineView.js b/js/QuarantineView.js index 149f581..b3315cf 100644 --- a/js/QuarantineView.js +++ b/js/QuarantineView.js @@ -141,6 +141,10 @@ Ext.define('PMG.QuarantineView', { }).show(); }, + changeTheme: () => Ext.create('Proxmox.window.ThemeEditWindow', { + cookieName: 'PMGThemeCookie', + autoShow: true, + }), navigate: function(treelist, item) { this.redirectTo(item.get('path')); }, @@ -156,6 +160,9 @@ Ext.define('PMG.QuarantineView', { '[reference=languageButton]': { click: 'changeLanguage', }, + '[reference=themeButton]': { + click: 'changeTheme', + }, }, init: function(view) { @@ -233,6 +240,11 @@ Ext.define('PMG.QuarantineView', { margin: '0 5 0 0', iconCls: 'fa fa-user', menu: [ + { + reference: 'themeButton', + iconCls: 'fa fa-paint-brush', + text: gettext('Theme'), + }, { iconCls: 'fa fa-language', text: gettext('Language'), diff --git a/pmg-index.html.tt b/pmg-index.html.tt index 4e9f1af..12c18d3 100644 --- a/pmg-index.html.tt +++ b/pmg-index.html.tt @@ -13,6 +13,13 @@ + [%- IF theme %] + [%- IF theme == 'auto' %] + + [%- ELSE %] + + [%- END -%] + [%- END -%] [% IF langfile %] [% ELSE %] -- 2.30.2