Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,7 @@ struct LoginButton: View {
}
.frame(maxWidth: .infinity, minHeight: isiOSAppOnMac ? 40 * AdaptiveSize.boardScale : 52)
.contentShape(.rect(cornerRadius: CornerRadius.control))
.background {
RoundedRectangle(cornerRadius: CornerRadius.control)
.fill(Color.secondaryBackground)
.stroke(Color.separator, lineWidth: 1)
}
.outlineButtonBackground()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,7 @@ struct CategoryManageView: View {
.frame(maxWidth: usesDesktopLayout ? nil : .infinity)
.frame(height: isiOSAppOnMac ? 32 * AdaptiveSize.boardScale : 44)
.padding(.horizontal, 16 * AdaptiveSize.boardScale)
.background(Color.tertiaryBackground, in: .rect(cornerRadius: CornerRadius.control))
.overlay {
RoundedRectangle(cornerRadius: CornerRadius.control)
.strokeBorder(Color.secondarySeparator)
}
.outlineButtonBackground()
}
.buttonStyle(.plain)
.frame(maxWidth: .infinity, alignment: .leading)
Expand Down
8 changes: 2 additions & 6 deletions Application/Presentation/HomeTab/Sources/Home/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -543,17 +543,13 @@ private struct HomeTodoSection: View {
Button {
store.send(.view(.tapManageTodoCategory))
} label: {
// Todo 타일과 같은 바탕·테두리의 작은 버튼
// 테두리 버튼 모양의 작은 버튼
Text("todo_edit", bundle: PresentationResources.bundle)
.font(.adaptive(.footnote).weight(.medium))
.foregroundStyle(Color.label)
.padding(.horizontal, isiOSAppOnMac ? 8 * AdaptiveSize.boardScale : 10)
.frame(minHeight: isiOSAppOnMac ? 24 * AdaptiveSize.boardScale : 28)
.background(Color.secondaryBackground, in: .rect(cornerRadius: CornerRadius.control))
.overlay {
RoundedRectangle(cornerRadius: CornerRadius.control)
.strokeBorder(Color.secondarySeparator)
}
.outlineButtonBackground()
.contentShape(.rect)
}
.buttonStyle(.plain)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ struct RecordTopBarTextButton: View {
}

// 반경 6의 높이 44 버튼, Mac은 높이 32
// 강조 버튼은 흑백 채움 바탕, 보조 버튼은 회색 바탕과 테두리
// 강조 버튼은 흑백 채움 바탕, 보조 버튼은 테두리 버튼 모양
struct RecordButtonStyle: ButtonStyle {
@Environment(\.isEnabled) private var isEnabled
@Environment(\.isiOSAppOnMac) private var isiOSAppOnMac
Expand All @@ -105,18 +105,25 @@ struct RecordButtonStyle: ButtonStyle {

func makeBody(configuration: Configuration) -> some View {
let shape = RoundedRectangle(cornerRadius: CornerRadius.control)

configuration.label
let label = configuration.label
.font(.adaptive(isiOSAppOnMac ? .body : .subheadline).weight(.semibold))
.foregroundStyle(isProminent ? Color.background : .label)
.lineLimit(1)
.padding(.horizontal, 16 * AdaptiveSize.boardScale)
.frame(maxWidth: fillsWidth ? .infinity : nil)
.frame(height: isiOSAppOnMac ? 32 * AdaptiveSize.boardScale : 44)
.background(isProminent ? Color.label : .tertiaryBackground, in: shape)
.overlay { shape.strokeBorder(isProminent ? Color.label : .secondarySeparator) }
.opacity(isEnabled ? configuration.isPressed ? 0.7 : 1 : 0.4)
.contentShape(shape)

Group {
if isProminent {
label
.background(Color.label, in: shape)
.overlay { shape.strokeBorder(Color.label) }
} else {
label.outlineButtonBackground()
}
}
.opacity(isEnabled ? configuration.isPressed ? 0.7 : 1 : 0.4)
.contentShape(shape)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public extension Color {
bundle: PresentationResources.bundle
)
static let multilineInputBorder = Color("MultilineInputBorder", bundle: PresentationResources.bundle)
static let outlineButtonFill = Color("OutlineButtonFill", bundle: PresentationResources.bundle)
static let secondaryBackground = Color("SecondaryBackground", bundle: PresentationResources.bundle)
static let secondaryLabel = Color("SecondaryLabel", bundle: PresentationResources.bundle)
static let secondarySeparator = Color("SecondarySeparator", bundle: PresentationResources.bundle)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,7 @@ where State: ObservableState {
maxWidth: usesDesktopLayout ? nil : .infinity,
minHeight: isiOSAppOnMac ? 32 * AdaptiveSize.boardScale : 44
)
.background(
usesDefaultAction ? Color.clear : .tertiaryBackground,
in: .rect(cornerRadius: CornerRadius.control)
)
.overlay {
RoundedRectangle(cornerRadius: CornerRadius.control)
.strokeBorder(Color.secondarySeparator)
}
.outlineButtonBackground()
.contentShape(.rect)
}
.buttonStyle(.plain)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// View+OutlineButtonBackground.swift
// PresentationShared
//
// Created by opfic on 11/23/26.
//

import SwiftUI

public extension View {
// 채우지 않은 버튼의 테두리 버튼 모양
// Orca outline 버튼처럼 옅은 바탕, 테두리와 옅은 그림자
func outlineButtonBackground() -> some View {
background {
RoundedRectangle(cornerRadius: CornerRadius.control)
.fill(Color.outlineButtonFill)
.strokeBorder(Color.inputBorder)
.shadow(color: .black.opacity(0.05), radius: 1, y: 1)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -189,32 +189,37 @@ struct DesktopSettingsButton: View {
case .prominent: .background
case .destructive: .danger
}
let border: Color = switch role {
case .normal: .separator
case .prominent: .label
case .destructive: .danger
let label = ZStack {
Text(title)
.opacity(showsProgress ? 0 : 1)

if showsProgress {
ProgressView()
.controlSize(.small)
.tint(color)
}
}
.font(.adaptive(.footnote).weight(.semibold))
.foregroundStyle(color)
.padding(.horizontal, 12 * AdaptiveSize.boardScale)
.frame(minHeight: isiOSAppOnMac ? 22 * AdaptiveSize.boardScale : 34)

Button(action: action) {
ZStack {
Text(title)
.opacity(showsProgress ? 0 : 1)

if showsProgress {
ProgressView()
.controlSize(.small)
.tint(color)
// 일반 버튼은 테두리 버튼 모양, 강조와 삭제 버튼은 역할 색 테두리
Group {
if role == .normal {
label.outlineButtonBackground()
} else {
let border = role == .prominent ? Color.label : .danger

label
.background(role == .prominent ? Color.label : .clear, in: .rect(cornerRadius: CornerRadius.control))
.overlay {
RoundedRectangle(cornerRadius: CornerRadius.control)
.strokeBorder(border)
}
}
}
.font(.adaptive(.footnote).weight(.semibold))
.foregroundStyle(color)
.padding(.horizontal, 12 * AdaptiveSize.boardScale)
.frame(minHeight: isiOSAppOnMac ? 22 * AdaptiveSize.boardScale : 34)
.background(role == .prominent ? Color.label : .clear, in: .rect(cornerRadius: CornerRadius.control))
.overlay {
RoundedRectangle(cornerRadius: CornerRadius.control)
.strokeBorder(border)
}
.contentShape(.rect)
}
.buttonStyle(.plain)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors": [
{
"color": {
"color-space": "srgb",
"components": {
"alpha": "1.000",
"blue": "0xFF",
"green": "0xFF",
"red": "0xFF"
}
},
"idiom": "universal"
},
{
"appearances": [
{
"appearance": "luminosity",
"value": "dark"
}
],
"color": {
"color-space": "srgb",
"components": {
"alpha": "0.045",
"blue": "0xFF",
"green": "0xFF",
"red": "0xFF"
}
},
"idiom": "universal"
}
],
"info": {
"author": "xcode",
"version": 1
}
}