From 2b51baa1981fb445b938e64bdce539e58fe70264 Mon Sep 17 00:00:00 2001
From: Runt <qingingrunt2010@qq.com>
Date: Sat, 26 Jul 2025 13:17:14 +0000
Subject: [PATCH] 小窗缩放, 相机转小窗显示 小窗旋转,相机画面旋转 关闭按钮优化

---
 LiveProject/views/MButton.swift |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/LiveProject/views/MButton.swift b/LiveProject/views/MButton.swift
index 06da285..54b2d2d 100644
--- a/LiveProject/views/MButton.swift
+++ b/LiveProject/views/MButton.swift
@@ -12,7 +12,7 @@
     
     var valid :ValidState = .VALID;
     
-    var icon : (any View)? = nil;
+    var icon : IconInfo? = nil;
     
     var text : String? = nil;
     
@@ -21,7 +21,6 @@
     }
     
     var body: some View {
-        //登录按钮
         Button(action: {
             if(valid == .INVALID){
                 return
@@ -31,19 +30,23 @@
             
             ZStack() {// iOS
                 HStack() {// iOS
-                    if let iconView = icon {
-                        AnyView(iconView)
+                    if let info = icon{
+                        Image(systemName: info.name)
+                            .resizable()
+                            .frame(width: info.size.width, height: info.size.height)
+                            .aspectRatio(contentMode: .fit)
+                            .foregroundColor(Color.white)
                     }
                     if let str = text {
                         Text(str)
                             .font(Font.system(size: 16))
-                            .foregroundColor(Color.init("ColorWhite"))
+                            .foregroundColor(Color.white)
                             .frame(width: .infinity, height: 40)
                     }
                 }.frame(minWidth: 40, maxHeight: 40).padding(EdgeInsets(top: 0, leading: 15, bottom: 0, trailing: 15))
             }.frame(maxHeight: 40).background(
                 RoundedRectangle(cornerRadius: 20, style: .continuous)
-                    .fill(Color.init(valid == .INVALID ?"ColorGray":"ColorText"))
+                    .fill(valid == .INVALID ? Color.colorGray : Color.colorText)
             )
             
         }.buttonStyle( TextBtnStyle())
@@ -52,6 +55,6 @@
 
 struct MButton_Previews: PreviewProvider {
     static var previews: some View {
-        MButton(icon: IconPortrait())
+        MButton(icon: Icons.IMAGE_MUTE)
     }
 }

--
Gitblit v1.9.1