From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <pve-devel-bounces@lists.proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
	by lore.proxmox.com (Postfix) with ESMTPS id 8A6F11FF162
	for <inbox@lore.proxmox.com>; Mon,  5 May 2025 14:03:53 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
	by firstgate.proxmox.com (Proxmox) with ESMTP id 767E81B2B5;
	Mon,  5 May 2025 14:04:07 +0200 (CEST)
From: Shan Shaji <s.shaji@proxmox.com>
To: pve-devel@lists.proxmox.com
Date: Mon,  5 May 2025 14:03:55 +0200
Message-Id: <20250505120355.31056-1-s.shaji@proxmox.com>
X-Mailer: git-send-email 2.39.5
MIME-Version: 1.0
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.467 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DMARC_MISSING             0.1 Missing DMARC policy
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 POISEN_SPAM_PILL          0.1 Meta: its spam
 POISEN_SPAM_PILL_2        0.1 random spam to be learned in bayes
 POISEN_SPAM_PILL_4        0.1 random spam to be learned in bayes
 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to
 Validity was blocked. See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more
 information.
 RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to
 Validity was blocked. See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more
 information.
 RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to
 Validity was blocked. See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more
 information.
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
Subject: [pve-devel] [PATCH pve_flutter_frontend v2] ui: replace use of
 `background` property
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
Reply-To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Cc: Shan Shaji <s.shaji@proxmox.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: pve-devel-bounces@lists.proxmox.com
Sender: "pve-devel" <pve-devel-bounces@lists.proxmox.com>

As of flutter v3.22 the `background` property is
deprecated. The material guidelines suggest
using the surface color for backgrounds.

https://m3.material.io/styles/color/roles#8562cf18-5cc0-44ae-b783-2e38bdb39585

Due to the difference between the current background color and surface
color, this patch assigns the colors `supportGreyTint75`(light theme)
and `grey`(dark theme) to the `surfaceContainer` property,
replacing all instances of `background` with `surfaceContainer`.

Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
---

changes since v1:
* fixed commit message line length

 lib/main.dart                                      | 4 ++--
 lib/widgets/pve_lxc_overview.dart                  | 2 +-
 lib/widgets/pve_node_overview.dart                 | 3 +--
 lib/widgets/pve_qemu_overview.dart                 | 3 ++-
 lib/widgets/pve_task_log_expansiontile_widget.dart | 2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/lib/main.dart b/lib/main.dart
index a985e3a..d966a17 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -108,7 +108,7 @@ class MyApp extends StatelessWidget {
             secondaryContainer: ProxmoxColors.supportLightOrange,
             surface: ProxmoxColors.supportGreyTint50,
             onSurface: Colors.black,
-            background: ProxmoxColors.supportGreyTint75,
+            surfaceContainer: ProxmoxColors.supportGreyTint75,
             onBackground: Colors.black,
           ),
           indicatorColor: ProxmoxColors.orange,
@@ -147,7 +147,7 @@ class MyApp extends StatelessWidget {
             onSurface: Colors.white,
             secondary: ProxmoxColors.orange,
             secondaryContainer: ProxmoxColors.supportLightOrange,
-            background: ProxmoxColors.grey,
+            surfaceContainer: ProxmoxColors.grey,
             onBackground: ProxmoxColors.supportGreyTint75,
           ),
           indicatorColor: ProxmoxColors.orange,
diff --git a/lib/widgets/pve_lxc_overview.dart b/lib/widgets/pve_lxc_overview.dart
index 3c6808d..e8e6edb 100644
--- a/lib/widgets/pve_lxc_overview.dart
+++ b/lib/widgets/pve_lxc_overview.dart
@@ -76,7 +76,7 @@ class PveLxcOverview extends StatelessWidget {
                   elevation: 0,
                   title: Text(config?.hostname ?? 'CT $guestID'),
                 ),
-                backgroundColor: Theme.of(context).colorScheme.background,
+                backgroundColor: Theme.of(context).colorScheme.surfaceContainer,
                 body: SingleChildScrollView(
                   child: Column(
                     children: <Widget>[
diff --git a/lib/widgets/pve_node_overview.dart b/lib/widgets/pve_node_overview.dart
index 23f0edc..179f6b7 100644
--- a/lib/widgets/pve_node_overview.dart
+++ b/lib/widgets/pve_node_overview.dart
@@ -63,8 +63,7 @@ class PveNodeOverview extends StatelessWidget {
                 overflow: TextOverflow.ellipsis,
               ),
             ),
-            //backgroundColor: Theme.of(context).colorScheme.primary,
-            backgroundColor: Theme.of(context).colorScheme.background,
+            backgroundColor: Theme.of(context).colorScheme.surfaceContainer,
             body: SingleChildScrollView(
               child: Column(
                 children: <Widget>[
diff --git a/lib/widgets/pve_qemu_overview.dart b/lib/widgets/pve_qemu_overview.dart
index ac16d26..b019b0f 100644
--- a/lib/widgets/pve_qemu_overview.dart
+++ b/lib/widgets/pve_qemu_overview.dart
@@ -78,7 +78,8 @@ class PveQemuOverview extends StatelessWidget {
                     elevation: 0,
                     title: Text(config?.name ?? 'VM $guestID'),
                   ),
-                  backgroundColor: Theme.of(context).colorScheme.background,
+                  backgroundColor:
+                      Theme.of(context).colorScheme.surfaceContainer,
                   body: SingleChildScrollView(
                       child: Column(
                     children: <Widget>[
diff --git a/lib/widgets/pve_task_log_expansiontile_widget.dart b/lib/widgets/pve_task_log_expansiontile_widget.dart
index 6491b6b..1d79c8f 100644
--- a/lib/widgets/pve_task_log_expansiontile_widget.dart
+++ b/lib/widgets/pve_task_log_expansiontile_widget.dart
@@ -64,7 +64,7 @@ class _PveTaskExpansionTileState extends State<PveTaskExpansionTile> {
         });
       },
       backgroundColor: Theme.of(context).colorScheme.surface,
-      collapsedBackgroundColor: Theme.of(context).colorScheme.background,
+      collapsedBackgroundColor: Theme.of(context).colorScheme.surfaceContainer,
       key: PageStorageKey<PveClusterTasksModel>(widget.task),
       leading: Icon(
         hasError
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel