From 009c088a64fae74f69269b88bcfc0550566a69f8 Mon Sep 17 00:00:00 2001 From: fufesou Date: Tue, 31 Oct 2023 15:14:43 +0800 Subject: [PATCH] change active monitor style Signed-off-by: fufesou --- flutter/lib/desktop/widgets/remote_toolbar.dart | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/flutter/lib/desktop/widgets/remote_toolbar.dart b/flutter/lib/desktop/widgets/remote_toolbar.dart index c67b4fa89..6f19b2359 100644 --- a/flutter/lib/desktop/widgets/remote_toolbar.dart +++ b/flutter/lib/desktop/widgets/remote_toolbar.dart @@ -604,7 +604,8 @@ class _MonitorMenu extends StatelessWidget { Widget buildMonitorMenu() { final width = SimpleWrapper(0); - final monitorsIcon = globalMonitorsWidget(width); + final monitorsIcon = + globalMonitorsWidget(width, Colors.white, Colors.black38); return _IconSubmenuButton( tooltip: 'Select Monitor', icon: monitorsIcon, @@ -670,7 +671,8 @@ class _MonitorMenu extends StatelessWidget { final width = SimpleWrapper(0); Widget? monitorsIcon; if (isAllMonitors) { - monitorsIcon = globalMonitorsWidget(width); + monitorsIcon = globalMonitorsWidget( + width, Colors.white, _ToolbarTheme.blueColor); } return _IconMenuButton( tooltip: isMulti @@ -719,7 +721,8 @@ class _MonitorMenu extends StatelessWidget { return monitorList; } - globalMonitorsWidget(SimpleWrapper width) { + globalMonitorsWidget( + SimpleWrapper width, Color activeTextColor, Color activeBgColor) { getMonitors() { final pi = ffi.ffiModel.pi; RxInt display = CurrentDisplayState.find(id); @@ -728,7 +731,7 @@ class _MonitorMenu extends StatelessWidget { return Offstage(); } - final scale = _ToolbarTheme.buttonSize/ rect.height * 0.75; + final scale = _ToolbarTheme.buttonSize / rect.height * 0.75; final startY = (_ToolbarTheme.buttonSize - rect.height * scale) * 0.5; final startX = startY; @@ -750,15 +753,14 @@ class _MonitorMenu extends StatelessWidget { color: Colors.grey, width: 1.0, ), - // to-do: theme - color: Colors.white, + color: display.value == i ? activeBgColor : Colors.white, ), child: Center( child: Text( '${i + 1}', style: TextStyle( color: display.value == i - ? _ToolbarTheme.blueColor + ? activeTextColor : _ToolbarTheme.inactiveColor, fontSize: fontSize, fontWeight: FontWeight.bold,