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)
|
.padding(isSelected ? innerPadding : 0)
|
||||||
|
|
||||||
ThemePreview(theme: theme, padding: padding, paletteR: paletteR)
|
ThemePreview(theme: $theme, padding: padding, paletteR: paletteR)
|
||||||
}
|
}
|
||||||
.onTapGesture {
|
.onTapGesture {
|
||||||
hostsManager.selectTheme(theme)
|
hostsManager.selectTheme(theme)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ struct ThemeEditorView: View {
|
|||||||
hostsManager.selectedTheme.background.suiColor.opacity(0.7)
|
hostsManager.selectedTheme.background.suiColor.opacity(0.7)
|
||||||
.ignoresSafeArea(.all)
|
.ignoresSafeArea(.all)
|
||||||
NavigationStack {
|
NavigationStack {
|
||||||
ThemePreview(theme: theme, padding: 10, paletteR: 20)
|
ThemePreview(theme: $theme, padding: 10, paletteR: 20)
|
||||||
.id(theme)
|
.id(theme)
|
||||||
.padding(.bottom)
|
.padding(.bottom)
|
||||||
.fixedSize(horizontal: false, vertical: true)
|
.fixedSize(horizontal: false, vertical: true)
|
||||||
@@ -32,7 +32,6 @@ struct ThemeEditorView: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Section("Main Colors") {
|
Section("Main Colors") {
|
||||||
|
|
||||||
ColorPicker("Text", selection: $theme.foreground.suiColor, supportsOpacity: false)
|
ColorPicker("Text", selection: $theme.foreground.suiColor, supportsOpacity: false)
|
||||||
ColorPicker("Background", selection: $theme.background.suiColor, supportsOpacity: false)
|
ColorPicker("Background", selection: $theme.background.suiColor, supportsOpacity: false)
|
||||||
ColorPicker("Cursor", selection: $theme.cursor.suiColor, supportsOpacity: false)
|
ColorPicker("Cursor", selection: $theme.cursor.suiColor, supportsOpacity: false)
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
struct ThemePreview: View {
|
struct ThemePreview: View {
|
||||||
@State var theme: Theme
|
@Binding var theme: Theme
|
||||||
@State var padding: CGFloat
|
@State var padding: CGFloat
|
||||||
@State var paletteR: CGFloat
|
@State var paletteR: CGFloat
|
||||||
|
|
||||||
@@ -45,5 +45,5 @@ struct ThemePreview: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#Preview {
|
#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