mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 13:26:16 +00:00
try to fix real time preview
This commit is contained in:
@@ -43,7 +43,7 @@ struct ThemeButton: View {
|
||||
)
|
||||
.padding(isSelected ? innerPadding : 0)
|
||||
|
||||
ThemePreview(theme: theme, padding: padding, paletteR: paletteR)
|
||||
ThemePreview(theme: $theme, padding: padding, paletteR: paletteR)
|
||||
}
|
||||
.onTapGesture {
|
||||
hostsManager.selectTheme(theme)
|
||||
|
||||
@@ -20,7 +20,7 @@ struct ThemeEditorView: View {
|
||||
hostsManager.selectedTheme.background.suiColor.opacity(0.7)
|
||||
.ignoresSafeArea(.all)
|
||||
NavigationStack {
|
||||
ThemePreview(theme: theme, padding: 10, paletteR: 20)
|
||||
ThemePreview(theme: $theme, padding: 10, paletteR: 20)
|
||||
.id(theme)
|
||||
.padding(.bottom)
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
@@ -32,7 +32,6 @@ struct ThemeEditorView: View {
|
||||
}
|
||||
|
||||
Section("Main Colors") {
|
||||
|
||||
ColorPicker("Text", selection: $theme.foreground.suiColor, supportsOpacity: false)
|
||||
ColorPicker("Background", selection: $theme.background.suiColor, supportsOpacity: false)
|
||||
ColorPicker("Cursor", selection: $theme.cursor.suiColor, supportsOpacity: false)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import SwiftUI
|
||||
|
||||
struct ThemePreview: View {
|
||||
@State var theme: Theme
|
||||
@Binding var theme: Theme
|
||||
@State var padding: CGFloat
|
||||
@State var paletteR: CGFloat
|
||||
|
||||
@@ -45,5 +45,5 @@ struct ThemePreview: View {
|
||||
}
|
||||
|
||||
#Preview {
|
||||
ThemePreview(theme: Theme.defaultTheme, padding: 5, paletteR: 10)
|
||||
ThemePreview(theme: .constant(Theme.defaultTheme), padding: 5, paletteR: 10)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user