Skip to content

Commit

Permalink
ui: Improve collage/lut icons, add lut selection.
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmin42 committed Feb 11, 2025
1 parent 719931c commit ebef263
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
1 change: 1 addition & 0 deletions osx/PhotoBook/PhotoBook/Collages/CollagesGrid.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ struct CollagesGrid: View
.resizable()
.aspectRatio(contentMode: .fit)
.frame(height: 80)
.cornerRadius(10)
.overlay(
RoundedRectangle(cornerRadius: 10)
.stroke(model.selectedIndex == index ? Color.white : Color.clear, lineWidth: 1)
Expand Down
22 changes: 17 additions & 5 deletions osx/PhotoBook/PhotoBook/Lut/LutGrid.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,23 @@ struct LutGrid: View
if let fileName = self.model.images[index].path
{
if let nsImage = NSImage(contentsOfFile: fileName) {
Image(nsImage: nsImage)
.resizable()
.aspectRatio(contentMode: .fit)
.frame(height: 80)
Text(self.model.images[index].name)
VStack
{
Image(nsImage: nsImage)
.resizable()
.aspectRatio(contentMode: .fit)
.frame(height: 80)
.cornerRadius(10)
.overlay(
RoundedRectangle(cornerRadius: 10)
.stroke(model.selectedIndex == index ? Color.white : Color.clear, lineWidth: 1)
)
.padding(4)
.onTapGesture {
self.model.selectedIndex = index
}
Text(self.model.images[index].name)
}
} else {
Text("Image not found")
}
Expand Down
1 change: 1 addition & 0 deletions osx/PhotoBook/PhotoBook/Lut/LutGridModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import SwiftUI
class LutGridModel: ObservableObject
{
@Published public var images:[LutItem] = []
@Published public var selectedIndex: Int? = nil

// TODO: Do a flexible calculation here
@Published public var columns = [
Expand Down

0 comments on commit ebef263

Please sign in to comment.