Skip to content

Commit

Permalink
Use simpler and correct fix for light mode
Browse files Browse the repository at this point in the history
Original fix introduced in c3a4610
  • Loading branch information
schmittner committed Mar 11, 2021
1 parent 1c6ef9f commit dda406b
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.000",
"green" : "0.000",
"red" : "0.000"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "1.000",
"green" : "1.000",
"red" : "1.000"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ struct AccessoryListEntry: View {
@Binding var accessoryColor: Color
@Binding var accessoryName: String
@Binding var alertType: OpenHaystackMainView.AlertType?
var isSelected: Bool
var delete: (Accessory) -> Void
var deployAccessoryToMicrobit: (Accessory) -> Void
var zoomOn: (Accessory) -> Void
Expand All @@ -40,7 +39,7 @@ struct AccessoryListEntry: View {
var body: some View {

HStack {
IconSelectionView(selectedImageName: $accessoryIcon, selectedColor: $accessoryColor, isSelected: self.isSelected)
IconSelectionView(selectedImageName: $accessoryIcon, selectedColor: $accessoryColor)

VStack(alignment: .leading) {
if self.editingName {
Expand Down Expand Up @@ -120,7 +119,6 @@ struct AccessoryListEntry: View {
set: { accessory.name = $0 }
),
alertType: self.$alertType,
isSelected: false,
delete: { _ in () },
deployAccessoryToMicrobit: { _ in () },
zoomOn: { _ in () })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ struct AccessoryMapView: NSViewControllerRepresentable {

nsViewController.zoom(on: focusedAccessory)
nsViewController.addLastLocations(from: accessories)

nsViewController.changeMapType(mapType)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ struct IconSelectionView: View {
@State var showImagePicker = false
@Binding var selectedImageName: String
@Binding var selectedColor: Color
var isSelected: Bool

var body: some View {

Expand All @@ -32,7 +31,7 @@ struct IconSelectionView: View {
ZStack {
Circle().fill(Color("PinColor"))
Image(systemName: self.selectedImageName)
.foregroundColor(self.isSelected ? Color.accentColor : nil)
.colorMultiply(Color("PinImageColor"))
}
)
.frame(width: 32, height: 32)
Expand All @@ -56,7 +55,7 @@ struct ColorSelectionView_Previews: PreviewProvider {

static var previews: some View {
Group {
IconSelectionView(selectedImageName: self.$selectedImageName, selectedColor: self.$selectedColor, isSelected: false)
IconSelectionView(selectedImageName: self.$selectedImageName, selectedColor: self.$selectedColor)
ImageSelectionList(selectedImageName: self.$selectedImageName, selectedColor: self.$selectedColor, dismiss: { () })
}

Expand All @@ -79,7 +78,10 @@ struct ImageSelectionList: View {

var body: some View {
VStack {
ColorPicker("Pick color", selection: $selectedColor)
ColorPicker(selection: $selectedColor, supportsOpacity: false) {
Text("Pick a color")
.colorMultiply(Color("PinImageColor"))
}
ScrollView {
LazyVGrid(columns: columns, alignment: .center, spacing: nil, pinnedViews: []) {
Section {
Expand All @@ -91,6 +93,7 @@ struct ImageSelectionList: View {
},
label: {
Image(systemName: iconName)
.colorMultiply(Color("PinImageColor"))
}
)
.frame(width: ImageSelectionList.boxSize, height: ImageSelectionList.boxSize, alignment: .center)
Expand All @@ -102,7 +105,5 @@ struct ImageSelectionList: View {
}
}
.padding(ImageSelectionList.boxSize / 2)

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ struct ManageAccessoriesView: View {
set: { accessory.name = $0 }
),
alertType: self.$alertType,
isSelected: self.focusedAccessory == accessory,
delete: self.delete(accessory:),
deployAccessoryToMicrobit: self.deploy(accessory:),
zoomOn: { self.focusedAccessory = $0 })
Expand Down

0 comments on commit dda406b

Please sign in to comment.