From 4b0ec368e78b2d795810cbe424398e2d17916bae Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Tue, 28 Nov 2023 02:29:17 +0800 Subject: [PATCH] AppInstaller // Fine-tune the visual style. --- Installer/MainView.swift | 9 +++++++-- Installer/vChewingInstallerApp.swift | 23 +++++++++++++++++++++-- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/Installer/MainView.swift b/Installer/MainView.swift index 6ecc6e34..0e0f2c78 100644 --- a/Installer/MainView.swift +++ b/Installer/MainView.swift @@ -72,10 +72,12 @@ public struct MainView: View { HStack(alignment: .top) { Text("i18n:installer.DISCLAIMER_TEXT") .font(.custom("Tahoma", size: 11)) + .opacity(0.5) .frame(maxWidth: .infinity) VStack(spacing: 4) { Button { installationButtonClicked() } label: { - Text(isUpgrading ? "i18n:installer.DO_APP_UPGRADE" : "i18n:installer.ACCEPT_INSTALLATION").frame(width: 114) + Text(isUpgrading ? "i18n:installer.DO_APP_UPGRADE" : "i18n:installer.ACCEPT_INSTALLATION") + .bold().frame(width: 114) } .keyboardShortcut(.defaultAction) .disabled(!isCancelButtonEnabled) @@ -136,10 +138,13 @@ public struct MainView: View { } } // OTHER - .padding([.horizontal, .bottom], 12) + .padding(12) .frame(width: 533, alignment: .topLeading) .navigationTitle(mainWindowTitle) .fixedSize() + .foregroundStyle(Color(nsColor: NSColor.textColor)) + .background(Color(nsColor: NSColor.windowBackgroundColor)) + .clipShape(RoundedRectangle(cornerRadius: 16)) .frame(minWidth: 533, idealWidth: 533, maxWidth: 533, minHeight: 386, idealHeight: 386, maxHeight: 386, alignment: .top) diff --git a/Installer/vChewingInstallerApp.swift b/Installer/vChewingInstallerApp.swift index 657b741d..125a353b 100644 --- a/Installer/vChewingInstallerApp.swift +++ b/Installer/vChewingInstallerApp.swift @@ -13,12 +13,31 @@ import SwiftUI struct vChewingInstallerApp: App { var body: some Scene { WindowGroup { - MainView() + ZStack(alignment: .center) { + LinearGradient( + gradient: Gradient( + colors: [ + Color(red: 0, green: 0, blue: 0xF4 / 255), + .black, + ] + ), + startPoint: .top, endPoint: .bottom + ).overlay(alignment: .topLeading) { + Text("vChewing Input Method") + .font(.system(size: 30)) + .italic().bold() + .padding() + .foregroundStyle(Color.white) + .shadow(color: .black, radius: 0, x: 5, y: 5) + } + MainView() + .shadow(color: .black, radius: 3, x: 0, y: 0) + }.frame(width: 1000, height: 630) .onAppear { NSWindow.allowsAutomaticWindowTabbing = false NSApp.windows.forEach { window in window.titlebarAppearsTransparent = true - window.setContentSize(.init(width: 533, height: 386)) + window.setContentSize(.init(width: 1000, height: 630)) window.standardWindowButton(.closeButton)?.isHidden = true window.standardWindowButton(.miniaturizeButton)?.isHidden = true window.standardWindowButton(.zoomButton)?.isHidden = true