feat: update pen dock layout

This commit is contained in:
dscyrescotti
2024-05-18 12:41:18 +07:00
parent 5d38f33285
commit ce3a021569
13 changed files with 23 additions and 23 deletions
+7 -5
View File
@@ -27,11 +27,13 @@ struct MemoView: View {
CanvasView()
.ignoresSafeArea()
.overlay(alignment: .topTrailing) {
VStack(alignment: .trailing, spacing: 20) {
historyTool
PenToolView()
}
.padding()
historyTool
.padding()
}
.overlay(alignment: .trailing) {
PenDockView()
.frame(maxHeight: .infinity)
.padding()
}
.overlay(alignment: .topLeading) {
Button {
@@ -1,5 +1,5 @@
//
// PenToolView.swift
// PenDockView.swift
// Memola
//
// Created by Dscyre Scotti on 5/4/24.
@@ -7,12 +7,12 @@
import SwiftUI
struct PenToolView: View {
struct PenDockView: View {
@EnvironmentObject var tool: Tool
let width: CGFloat = 80
let width: CGFloat = 90
let height: CGFloat = 30
let factor: CGFloat = 1.22
let factor: CGFloat = 0.95
var body: some View {
ScrollViewReader { proxy in
@@ -40,12 +40,10 @@ struct PenToolView: View {
}
.frame(maxHeight:( (height * factor + 10) * 7) + 20)
.fixedSize()
.background {
HStack(spacing: 0) {
Spacer(minLength: 70)
RoundedRectangle(cornerRadius: 20)
.fill(.regularMaterial)
}
.background(alignment: .trailing) {
RoundedRectangle(cornerRadius: 20)
.fill(.regularMaterial)
.frame(width: width * factor - 15)
}
.clipShape(.rect(cornerRadii: .init(bottomTrailing: 20, topTrailing: 20)))
.overlay(alignment: .bottomLeading) {
@@ -112,7 +110,7 @@ struct PenToolView: View {
}
.onDrop(of: [.item], delegate: PenDropDelegate(id: pen.id, tool: tool))
.padding(.leading, 10)
.offset(x: tool.selectedPen === pen ? 0 : 28)
.offset(x: tool.selectedPen === pen ? 0 : 25)
}
var newPenButton: some View {
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 381 B

After

Width:  |  Height:  |  Size: 384 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 770 B

After

Width:  |  Height:  |  Size: 787 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB