Skip to content

Commit 4b29e2f

Browse files
committed
Merge branch 'main' into fix/#118
2 parents 54598cc + 469d1cb commit 4b29e2f

File tree

2 files changed

+62
-52
lines changed

2 files changed

+62
-52
lines changed

LabDuck/View/NodeView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ extension NodeView {
273273
.frame(width: 16, height: 16)
274274
.foregroundColor(.blue.opacity(node.colorTheme == colorTheme ? 1 : 0))
275275
}
276+
276277
.background(colorTheme.backgroundColor)
277278
.clipShape(RoundedRectangle(cornerRadius: 3))
278279
.buttonStyle(.borderless)

LabDuck/View/TagPopupView.swift

Lines changed: 61 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,32 @@ struct TagPopupView: View {
2121

2222
var body: some View {
2323
VStack (alignment:.leading,spacing: 0){
24+
HStack{
25+
Spacer()
26+
27+
Button {
28+
isEditingForTag = false
29+
} label: {
30+
Image(systemName: "xmark")
31+
.frame(width: 32, height: 32)
32+
}
33+
.buttonStyle(.borderless)
34+
.foregroundColor(.gray)
35+
.background(.gray.opacity(self.hovered ? 0.1 : 0.0))
36+
.clipShape(RoundedRectangle(cornerRadius: 10))
37+
.onHover { hover in
38+
self.hovered = hover
39+
} .padding(.leading, 10)
40+
.padding(.trailing, 10)
41+
42+
}.frame(width: 250, height: 36)
43+
.background(.white)
44+
2445
HStack {
2546
ZStack(alignment: .leading) {
2647
if textForTags.isEmpty {
27-
Text("텍스트 입력").font(.system(size:13))
48+
Text("텍스트 입력")
49+
.font(.system(size:13))
2850
.foregroundColor(.gray)
2951
.padding(.horizontal)
3052
}
@@ -36,27 +58,13 @@ struct TagPopupView: View {
3658
.background(Color.clear)
3759
.textFieldStyle(PlainTextFieldStyle())
3860
} .padding(.leading, 10)
39-
40-
Button {
41-
isEditingForTag = false
42-
} label: {
43-
Image(systemName: "xmark")
44-
.frame(width: 32, height: 32)
45-
}
46-
.buttonStyle(.borderless)
47-
.foregroundColor(.gray)
48-
.background(.gray.opacity(self.hovered ? 0.1 : 0.0))
49-
.clipShape(RoundedRectangle(cornerRadius: 10))
50-
.onHover { hover in
51-
self.hovered = hover
52-
}
5361
.padding(.trailing, 10)
5462

55-
}.frame(width: 250, height: 50)
63+
}.frame(width: 250, height: 48)
5664
.background(Color(hex: 0xF0F0F0))
5765

5866

59-
VStack(alignment: .leading, spacing:10){
67+
VStack(alignment: .leading){
6068
if previewTag != nil {
6169
HStack(spacing: 20){
6270

@@ -93,38 +101,54 @@ struct TagPopupView: View {
93101
}
94102

95103
if !node.tags.isEmpty {
96-
Text("선택된 태그").foregroundColor(.gray).font(.system(size:11)).padding(5)
104+
Text("선택된 태그")
105+
.foregroundColor(.gray)
106+
.font(.system(size:12))
107+
.padding(5)
108+
.padding(.leading, 10)
97109
}
98110

99111
//태그 뷰의 태그 출력
100-
VStack(alignment: .leading, spacing: 10) {
101-
ForEach(node.tags, id: \.self) { tagID in
102-
if let tag = document.board.getTag(tagID) {
103-
HStack {
104-
Text("#\(tag.name)")
112+
VStack(alignment: .center){
113+
VStack(alignment: .leading, spacing: 10) {
114+
ForEach(node.tags, id: \.self) { tagID in
115+
if let tag = document.board.getTag(tagID) {
116+
HStack {
117+
HStack{
118+
Text("#\(tag.name)")
119+
Button {
120+
let filteredTags = node.tags.filter { $0 != tagID }
121+
document.updateNode(node.id, tags: filteredTags, undoManager: undoManager)
122+
} label: {
123+
Image(systemName: "x.circle")
124+
.foregroundColor(.white)
125+
}.buttonStyle(BorderlessButtonStyle())
126+
}
105127
.foregroundColor(.white)
106128
.padding(EdgeInsets(top: 6, leading: 8, bottom: 6, trailing: 8))
107129
.background(tag.colorTheme.backgroundColor)
108130
.cornerRadius(6)
109-
Spacer()
110-
Button {
111-
let filteredTags = node.tags.filter { $0 != tagID }
112-
document.updateNode(node.id, tags: filteredTags, undoManager: undoManager)
113-
} label: {
114-
Image(systemName: "trash")
115-
.foregroundColor(.gray)
131+
Spacer()
132+
133+
116134
}
117-
.buttonStyle(.borderless)
135+
.padding(.leading, 8)
136+
.padding(.trailing, 8)
118137

119138
}
120-
.padding(.leading, 8)
121-
.padding(.trailing, 8)
122139
}
123-
}
124-
}
140+
} .padding(.vertical, 8)
141+
}.background(Color(hex: 0xF0F0F0))
142+
.frame(width: 234)
143+
.cornerRadius(6)
144+
.padding(.horizontal, 10)
125145

126146
if !document.board.allTags.isEmpty{
127-
Text("태그 선택").foregroundColor(.gray).font(.system(size:11)).padding(5)
147+
Text("전체 태그")
148+
.foregroundColor(.gray)
149+
.font(.system(size:12))
150+
.padding(5)
151+
.padding(.leading, 10)
128152
}
129153
// 중복 제거된 태그 표시
130154
ForEach(document.board.allTags) { tag in
@@ -138,16 +162,13 @@ struct TagPopupView: View {
138162
Button{
139163
document.addTag(node.id, tagID: tag.id, undoManager: undoManager)
140164
}label: {
141-
Image(systemName: document.board.hasTag(node.id, tag.id) ? "checkmark.seal.fill" : "plus.circle").foregroundColor(.gray)
165+
Image(systemName: document.board.hasTag(node.id, tag.id) ? "checkmark.square.fill" : "checkmark.square").foregroundColor(.gray)
142166
}.buttonStyle(BorderlessButtonStyle())
143167
}
144168
.padding(.leading, 8)
145169
.padding(.trailing, 8)
146170

147171
}
148-
149-
150-
151172
}
152173
.padding(.bottom, 7)
153174
.padding(.top, 7)
@@ -178,18 +199,6 @@ struct TagPopupView: View {
178199
self.previewTag = nil
179200
self.textForTags = ""
180201
}
181-
//
182-
// private func deleteTag(_ tag: KPTag) {
183-
// document.deleteTag(node.id, tagID: tag.id, undoManager: undoManager, animation: .default)
184-
// }
185-
//
186-
// private func updateUniqueTags(with tag: KPTag) {
187-
// let existingTagNames = uniqueTags.map { $0.name }
188-
// if !existingTagNames.contains(tag.name) {
189-
// uniqueTags.append(tag)
190-
// }
191-
// }
192-
193202
}
194203

195204
#Preview {

0 commit comments

Comments
 (0)