add bg color to theme

fix tapping on main view empty space not working
update charts
This commit is contained in:
Trey t
2022-02-23 10:26:49 -06:00
parent d88c4e7a05
commit 7ecd104871
4 changed files with 46 additions and 18 deletions

View File

@@ -6,7 +6,7 @@
"repositoryURL": "https://github.com/akatreyt/ChartsPackage",
"state": {
"branch": "master",
"revision": "e55fef3e8c294d5c2b25014d6d0734760b3ca6fa",
"revision": "ab1aa4f8ade9540e9d2f19f7cb8b8e6ac0c2a8fd",
"version": null
}
},

View File

@@ -48,12 +48,17 @@ enum Theme: Int, CaseIterable {
protocol Themeable {
static var title: String { get }
var secondaryBGColor: Color { get }
var bgColor: Color { get }
var bg: AnyView { get }
var preview: AnyView { get }
var labelColor: Color { get }
}
struct IFeelTheme: Themeable {
var bgColor: Color {
return Color(uiColor: UIColor.systemBackground)
}
var labelColor: Color {
return Color(uiColor: UIColor.label)
}
@@ -63,7 +68,7 @@ struct IFeelTheme: Themeable {
}
var secondaryBGColor: Color {
return Color(uiColor: UIColor.systemBackground)
return Color(uiColor: UIColor.secondarySystemBackground)
}
var bg: AnyView {
@@ -84,6 +89,10 @@ struct IFeelTheme: Themeable {
}
struct SystemTheme: Themeable {
var bgColor: Color {
return Color(uiColor: UIColor.systemBackground)
}
var labelColor: Color {
return Color(uiColor: UIColor.label)
}
@@ -118,6 +127,10 @@ struct SystemTheme: Themeable {
}
struct AlwaysDark: Themeable {
var bgColor: Color {
return Color(uiColor: UIColor.systemBackground.resolvedColor(with: .init(userInterfaceStyle: .dark)))
}
var labelColor: Color {
return .white
}
@@ -152,6 +165,10 @@ struct AlwaysDark: Themeable {
}
struct AlwaysLight: Themeable {
var bgColor: Color {
return Color(uiColor: UIColor.systemBackground)
}
var labelColor: Color {
return .black
}

View File

@@ -61,31 +61,37 @@ struct CustomizeView: View {
Text(String(localized: "settings_view_change_icon"))
.font(.body)
.foregroundColor(theme.currentTheme.labelColor)
.padding(.top)
HStack {
Button(action: {
UIApplication.shared.setAlternateIconName(nil)
}, label: {
Image("FeelsAppIcon", bundle: .main)
.resizable()
.frame(width: 50, height:50)
.cornerRadius(10)
})
ForEach(iconSets, id: \.self.0){ iconSet in
ScrollView(.horizontal) {
HStack {
Button(action: {
UIApplication.shared.setAlternateIconName(iconSet.1) { (error) in
// FIXME: Handle error
}
UIApplication.shared.setAlternateIconName(nil)
}, label: {
Image(iconSet.0, bundle: .main)
Image("FeelsAppIcon", bundle: .main)
.resizable()
.frame(width: 50, height:50)
.cornerRadius(10)
})
ForEach(iconSets, id: \.self.0){ iconSet in
Button(action: {
UIApplication.shared.setAlternateIconName(iconSet.1) { (error) in
// FIXME: Handle error
}
}, label: {
Image(iconSet.0, bundle: .main)
.resizable()
.frame(width: 50, height:50)
.cornerRadius(10)
})
}
}
.padding()
}
.background(RoundedRectangle(cornerRadius: 10).fill().foregroundColor(theme.currentTheme.bgColor))
.padding()
.cornerRadius(10)
}
}
.fixedSize(horizontal: false, vertical: true)
@@ -137,7 +143,7 @@ struct CustomizeView: View {
selectedWidget.fuckingWrapped = CustomWidgetModel.randomWidget
selectedWidget.showFuckingSheet = true
}
.padding()
.padding(.top)
ScrollView(.horizontal) {
HStack {
ForEach(UserDefaultsStore.getCustomWidgets(), id: \.uuid) { widget in
@@ -149,9 +155,13 @@ struct CustomizeView: View {
selectedWidget.showFuckingSheet = true
}
}
}
.padding()
}
.background(RoundedRectangle(cornerRadius: 10).fill().foregroundColor(theme.currentTheme.bgColor))
.padding()
.cornerRadius(10)
}
}
.fixedSize(horizontal: false, vertical: true)

View File

@@ -152,6 +152,7 @@ extension HomeViewTwo {
}
}
}
.contentShape(Rectangle())
.onTapGesture{
let deailView = MonthDetailView(monthInt: month,
yearInt: year,