Skip to content

Commit 71f2119

Browse files
author
Igor Demyanov
committed
Fix menu size
1 parent d5dcd66 commit 71f2119

7 files changed

Lines changed: 49 additions & 30 deletions

File tree

backend/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: 'dslideshow_backend'
2-
version: 9.5.0+1
2+
version: 9.5.1
33
description: A sample command-line application
44
publish_to: none
55
environment:

changelog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
# 9.5.x
1+
# 9.5.1
22
Fix SystemMetricsWidget padding
3+
Fix menu size
34

45
# 9.5.0
56
Added display info

dslideshow_flutter/lib/features/menu/presentation/widgets/mainmenu.dart

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,11 @@ import 'package:flutter/material.dart';
66
import 'package:flutter_bloc/flutter_bloc.dart';
77

88
import 'mainmenu_model.dart';
9+
import 'package:dslideshow_flutter/features/theme/presentation/theme.dart';
910

1011
class MainMenuWidget extends StatelessWidget {
1112
const MainMenuWidget({super.key});
1213

13-
// HUD Стиль
14-
static const Color _kBorderColor = Colors.cyanAccent;
15-
static const Color _kActiveBgColor = Color(0x3300E5FF); // Полупрозрачный Cyan
16-
static const Color _kBgColor = Color(0xE6000000); // 90% Black (Быстро рисуется)
1714

1815
@override
1916
Widget build(BuildContext context) {
@@ -35,14 +32,14 @@ class MainMenuWidget extends StatelessWidget {
3532
// 2. МЕНЮ (По центру экрана)
3633
Center(
3734
child: Container(
38-
width: 400,
39-
height: 400, // Фиксированная высота или можно использовать Constraints
35+
width: ThemeSettings.menuSizeW,
36+
height: ThemeSettings.menuSizeH, // Фиксированная высота или можно использовать Constraints
4037
decoration: BoxDecoration(
41-
color: _kBgColor,
42-
border: Border.all(color: _kBorderColor.withAlpha((255.0 * 0.5).round()), width: 1),
38+
color: ThemeColors.menuBgColor,
39+
border: Border.all(color: ThemeColors.menuBorderColor.withOpacity(0.5), width: 1),
4340
// Убираем скругление для производительности и стиля "Терминал"
4441
boxShadow: [
45-
BoxShadow(color: Colors.black.withAlpha((255.0 * 0.5).round()), blurRadius: 20, spreadRadius: 5)
42+
BoxShadow(color: ThemeColors.menuShadowColor, blurRadius: 20, spreadRadius: 5)
4643
]
4744
),
4845
child: Column(
@@ -51,31 +48,31 @@ class MainMenuWidget extends StatelessWidget {
5148
Container(
5249
width: double.infinity,
5350
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 16),
54-
color: _kBorderColor.withAlpha((255.0 * 0.1).round()),
51+
color: ThemeColors.menuBorderColor.withOpacity(0.1),
5552
child: Row(
5653
mainAxisAlignment: MainAxisAlignment.spaceBetween,
5754
children: [
5855
const Text(
5956
"MENU",
6057
style: TextStyle(
61-
color: _kBorderColor,
62-
fontSize: 24,
58+
color: ThemeColors.menuBorderColor,
59+
fontSize: ThemeSettings.menuHeaderTitleSize,
6360
fontWeight: FontWeight.bold,
6461
letterSpacing: 2.0,
6562
),
6663
),
6764
// Декоративные элементы
6865
Row(
6966
children: [
70-
Container(width: 8, height: 8, color: _kBorderColor.withAlpha((255.0 * 0.5).round())),
67+
Container(width: 8, height: 8, color: ThemeColors.menuBorderColor.withOpacity(0.5)),
7168
const SizedBox(width: 4),
72-
Container(width: 8, height: 8, color: _kBorderColor),
69+
Container(width: 8, height: 8, color: ThemeColors.menuBorderColor),
7370
],
7471
)
7572
],
7673
),
7774
),
78-
const Divider(height: 1, color: _kBorderColor),
75+
Divider(height: 1, color: ThemeColors.menuBorderColor),
7976

8077
// Список
8178
Expanded(
@@ -99,7 +96,7 @@ class MainMenuWidget extends StatelessWidget {
9996
padding: const EdgeInsets.all(8),
10097
child: const Text(
10198
"Use physical buttons to navigate",
102-
style: TextStyle(color: Colors.white24, fontSize: 10),
99+
style: TextStyle(color: ThemeColors.menuSubTextColor, fontSize: ThemeSettings.menuHintTextSize),
103100
),
104101
)
105102
],
@@ -113,29 +110,29 @@ class MainMenuWidget extends StatelessWidget {
113110
Widget _buildMenuItem(BuildContext context, Option item, bool isSelected) {
114111
return Container(
115112
margin: const EdgeInsets.only(bottom: 2),
116-
color: isSelected ? _kActiveBgColor : Colors.transparent,
113+
color: isSelected ? ThemeColors.menuActiveBgColor : Colors.transparent,
117114
child: ListTile(
118115
dense: true,
119116
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 0),
120117
// Иконка
121118
leading: Icon(
122119
item.icon.icon,
123-
color: isSelected ? Colors.white : Colors.white38,
124-
size: 20,
120+
color: isSelected ? ThemeColors.menuTextColor : ThemeColors.menuInactiveIconColor,
121+
size: ThemeSettings.menuItemIconSize,
125122
),
126123
// Текст
127124
title: Text(
128125
item.title.toUpperCase(),
129126
style: TextStyle(
130-
color: isSelected ? Colors.white : Colors.white70,
127+
color: isSelected ? ThemeColors.menuTextColor : ThemeColors.menuInactiveTextColor,
131128
fontWeight: isSelected ? FontWeight.w900 : FontWeight.normal,
132-
fontSize: 20,
129+
fontSize: ThemeSettings.menuListItemTextSize,
133130
letterSpacing: 1.2,
134131
),
135132
),
136133
// Правая часть (стрелка)
137134
trailing: isSelected
138-
? const Icon(Icons.arrow_left, color: _kBorderColor)
135+
? Icon(Icons.arrow_left, color: ThemeColors.menuBorderColor)
139136
: null,
140137
onTap: () {
141138
context.read<MainMenuBloc>().add(MainMenuEvent.execute(item.command));

dslideshow_flutter/lib/features/menu/presentation/widgets/mainmenu_model.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'package:flutter/material.dart';
2+
import 'package:dslideshow_flutter/features/theme/presentation/theme.dart';
23

34
enum MenuCommand { returnToSlideshow, update, config, powerOff, restartApp }
45

@@ -13,31 +14,31 @@ class Option {
1314

1415
final options = [
1516
Option(
16-
icon: const Icon(Icons.keyboard_backspace, size: 40.0),
17+
icon: Icon(Icons.keyboard_backspace, size: ThemeSettings.menuIconSize),
1718
title: 'Return',
1819
subtitle: 'Return to slideshow.',
1920
command: MenuCommand.returnToSlideshow,
2021
),
2122
Option(
22-
icon: const Icon(Icons.system_update, size: 40.0),
23+
icon: Icon(Icons.system_update, size: ThemeSettings.menuIconSize),
2324
title: 'OTA Update',
2425
subtitle: 'OTA Update.',
2526
command: MenuCommand.update,
2627
),
2728
Option(
28-
icon: const Icon(Icons.settings, size: 40.0),
29+
icon: Icon(Icons.settings, size: ThemeSettings.menuIconSize),
2930
title: 'Сonfig',
3031
subtitle: 'Сonfig.',
3132
command: MenuCommand.config,
3233
),
3334
Option(
34-
icon: const Icon(Icons.reset_tv, size: 40.0),
35+
icon: Icon(Icons.reset_tv, size: ThemeSettings.menuIconSize),
3536
title: 'Restart application',
3637
subtitle: 'Restart application.',
3738
command: MenuCommand.restartApp,
3839
),
3940
Option(
40-
icon: const Icon(Icons.power_settings_new, size: 40.0),
41+
icon: Icon(Icons.power_settings_new, size: ThemeSettings.menuIconSize),
4142
title: 'Power off',
4243
subtitle: 'Shut down system.',
4344
command: MenuCommand.powerOff,

dslideshow_flutter/lib/features/theme/presentation/src/theme_colors.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,17 @@ abstract class ThemeColors {
6161
0x4D64B5F6,
6262
); // 0.3 alpha accent color
6363

64+
// Menu Page Colors
65+
static const menuBorderColor = Color(0xFF00E5FF); // Cyan Accent
66+
static const menuActiveBgColor = Color(0x3300E5FF); // Полупрозрачный Cyan
67+
static const menuBgColor = Color(0xE6000000); // 90% Black
68+
static const menuShadowColor = Color(0x80000000); // 50% Black
69+
static const menuTextColor = Color(0xFFFFFFFF); // White
70+
static const menuSubTextColor = Color(0x3DFFFFFF); // Colors.white24
71+
static const menuInactiveIconColor = Color(0x61FFFFFF); // Colors.white38
72+
static const menuInactiveTextColor = Color(0xB3FFFFFF); // Colors.white70
73+
static const menuHintTextColor = Color(0x3DFFFFFF); // Colors.white24
74+
6475
static const terminaTheme = TerminalTheme(
6576
cursor: Colors.transparent, // Скрываем курсор, так как readOnly
6677
selection: Color(0xFF264F78),

dslideshow_flutter/lib/features/theme/presentation/src/theme_settings.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,13 @@ abstract class ThemeSettings{
3939
static const double otaReadyLinkSize = 18 * scaleFactor;
4040
static const double otaReadyAccessCodeSize = 68 * scaleFactor;
4141
static const double otaReadyInstructionIconSize = 20 * scaleFactor;
42+
43+
// Menu Page Sizes
44+
static const double menuIconSize = 40 * scaleFactor;
45+
static const double menuHeaderTitleSize = 24 * scaleFactor;
46+
static const double menuListItemTextSize = 20 * scaleFactor;
47+
static const double menuHintTextSize = 10 * scaleFactor;
48+
static const double menuItemIconSize = 20 * scaleFactor;
49+
static const double menuSizeW = 400 * scaleFactor;
50+
static const double menuSizeH = 280 * scaleFactor;
4251
}

dslideshow_flutter/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: dslideshow_flutter
22
description: Flutter SlideShow
3-
version: 9.5.0+1
3+
version: 9.5.1
44
publish_to: none
55

66
environment:

0 commit comments

Comments
 (0)