@@ -11,8 +11,16 @@ struct ToastView: View {
1111
1212 @AppStorage ( SettingKey . popupTheme. name) private var selectedTheme : String = SettingKey . popupTheme. defaultValue
1313 @AppStorage ( SettingKey . popupThemeColor. name) private var themeColor : String = SettingKey . popupThemeColor. defaultValue
14+ @AppStorage ( SettingKey . popupScale. name) private var popupScale : Int = SettingKey . popupScale. defaultValue
1415 @Environment ( \. colorScheme) private var colorScheme
1516
17+ /// Visual multiplier derived from the user's Popup Scale level (1...5) so the toast keeps pace
18+ /// with the popup bar it attaches to — same scale factor `PopupView` applies to the bar.
19+ private var scale : CGFloat { PopupMetrics . scaleMultiplier ( for: popupScale) }
20+
21+ /// Corner radius for the toast bubble, scaled with the popup scale.
22+ private var cornerRadius : CGFloat { PopupMetrics . toastCornerRadius * scale }
23+
1624 private var isGlass : Bool {
1725 PopupThemeModel . category ( fromStored: selectedTheme) == . glass
1826 }
@@ -48,43 +56,47 @@ struct ToastView: View {
4856 }
4957
5058 var body : some View {
51- let content = HStack ( spacing: 6 ) {
59+ let content = HStack ( spacing: 6 * scale ) {
5260 if feedback. isLoading {
61+ // macOS `.small` spinner is 16pt; scale its frame AND rendering so both the panel
62+ // sizing (hostingView.fittingSize) and the visible spinner track the popup scale.
5363 ProgressView ( )
5464 . controlSize ( . small)
65+ . scaleEffect ( scale)
66+ . frame ( width: 16 * scale, height: 16 * scale)
5567 } else if let symbol = feedback. symbolName {
5668 Image ( systemName: symbol)
57- . font ( . system( size: 10 , weight: . medium) )
69+ . font ( . system( size: 10 * scale , weight: . medium) )
5870 . foregroundColor ( feedback. style == . error ? Color . red : ( feedback. style == . success ? Color . accentColor : textColor) )
5971 }
6072 Text ( feedback. message)
61- . font ( . system( size: 11 , weight: . regular) )
73+ . font ( . system( size: 11 * scale , weight: . regular) )
6274 . lineLimit ( 1 )
6375 . truncationMode ( . tail)
6476 }
6577 . foregroundColor ( textColor)
66- . padding ( . horizontal, 11 )
67- . padding ( . vertical, 5 )
78+ . padding ( . horizontal, 11 * scale )
79+ . padding ( . vertical, 5 * scale )
6880
6981 Group {
7082 if isGlass {
7183 content
7284 . background (
73- RoundedRectangle ( cornerRadius: PopupMetrics . toastCornerRadius , style: . continuous)
85+ RoundedRectangle ( cornerRadius: cornerRadius , style: . continuous)
7486 . fill ( . ultraThinMaterial)
7587 )
76- . clipShape ( RoundedRectangle ( cornerRadius: PopupMetrics . toastCornerRadius , style: . continuous) )
88+ . clipShape ( RoundedRectangle ( cornerRadius: cornerRadius , style: . continuous) )
7789 . overlay (
78- RoundedRectangle ( cornerRadius: PopupMetrics . toastCornerRadius , style: . continuous)
90+ RoundedRectangle ( cornerRadius: cornerRadius , style: . continuous)
7991 . stroke ( glassBorderColor, lineWidth: 1.0 )
8092 )
8193 . shadow ( color: Color . black. opacity ( 0.15 ) , radius: 4 , x: 0 , y: 1 )
8294 } else {
8395 content
8496 . background ( opaqueBackground)
85- . clipShape ( RoundedRectangle ( cornerRadius: PopupMetrics . toastCornerRadius , style: . continuous) )
97+ . clipShape ( RoundedRectangle ( cornerRadius: cornerRadius , style: . continuous) )
8698 . overlay (
87- RoundedRectangle ( cornerRadius: PopupMetrics . toastCornerRadius , style: . continuous)
99+ RoundedRectangle ( cornerRadius: cornerRadius , style: . continuous)
88100 . stroke ( opaqueBorder, lineWidth: 1.0 )
89101 )
90102 . shadow ( color: Color . black. opacity ( effectiveTheme == " light " ? 0.10 : 0.20 ) , radius: 4 , x: 0 , y: 1 )
0 commit comments