-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* refactor: VisualEffect is now VisualEffectView * feat: vastly improved how incoming message bubbles are rendered * cleanup: remove MockChatPhoto which was here from really old times of the app * Revert "cleanup: remove MockChatPhoto which was here from really old times of the app" This reverts commit e1438ac. * fix: button design for the about window * fix: about window styling * fix: message bubble internal padding * fix: spacing inside of items in the chat list * fix: coloring of the message sender
- Loading branch information
Showing
12 changed files
with
130 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 0 additions & 26 deletions
26
Shared/Assets.xcassets/MessageAssets/ChatMessageBubbleRecipient.imageset/Contents.json
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-669 Bytes
Shared/Assets.xcassets/MessageAssets/ChatMessageBubbleRecipient.imageset/Union.png
Binary file not shown.
Binary file removed
BIN
-930 Bytes
.../Assets.xcassets/MessageAssets/ChatMessageBubbleRecipient.imageset/Union@2x.png
Binary file not shown.
Binary file removed
BIN
-1.23 KB
.../Assets.xcassets/MessageAssets/ChatMessageBubbleRecipient.imageset/Union@3x.png
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// | ||
// MessageBubbleShape.swift | ||
// Moc | ||
// | ||
// Created by Егор Яковенко on 19.08.2022. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct MessageBubbleShape: Shape { | ||
func path(in rect: CGRect) -> Path { | ||
let width = rect.width | ||
let height = rect.height | ||
let path = Path { p in | ||
p.move(to: CGPoint(x: 25, y: height)) | ||
p.addLine(to: CGPoint(x: 20, y: height)) | ||
p.addCurve(to: CGPoint(x: 0, y: height - 20), | ||
control1: CGPoint(x: 8, y: height), | ||
control2: CGPoint(x: 0, y: height - 8)) | ||
p.addLine(to: CGPoint(x: 0, y: 20)) | ||
p.addCurve(to: CGPoint(x: 20, y: 0), | ||
control1: CGPoint(x: 0, y: 8), | ||
control2: CGPoint(x: 8, y: 0)) | ||
p.addLine(to: CGPoint(x: width - 21, y: 0)) | ||
p.addCurve(to: CGPoint(x: width - 4, y: 20), | ||
control1: CGPoint(x: width - 12, y: 0), | ||
control2: CGPoint(x: width - 4, y: 8)) | ||
p.addLine(to: CGPoint(x: width - 4, y: height - 11)) | ||
p.addCurve(to: CGPoint(x: width, y: height), | ||
control1: CGPoint(x: width - 4, y: height - 1), | ||
control2: CGPoint(x: width, y: height)) | ||
p.addLine(to: CGPoint(x: width + 0.05, y: height - 0.01)) | ||
p.addCurve(to: CGPoint(x: width - 11, y: height - 4), | ||
control1: CGPoint(x: width - 4, y: height + 0.5), | ||
control2: CGPoint(x: width - 8, y: height - 1)) | ||
p.addCurve(to: CGPoint(x: width - 25, y: height), | ||
control1: CGPoint(x: width - 16, y: height), | ||
control2: CGPoint(x: width - 20, y: height)) | ||
} | ||
|
||
let flip = CGAffineTransform(scaleX: -1, y: 1) | ||
let position = flip.concatenating(CGAffineTransform(translationX: rect.width, y: 0)) | ||
|
||
return path.applying(position) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// VisualEffect.swift | ||
// Moc | ||
// | ||
// Created by Егор Яковенко on 19.08.2022. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct VisualEffectView: NSViewRepresentable { | ||
let material: NSVisualEffectView.Material? | ||
|
||
func makeNSView(context: Self.Context) -> NSVisualEffectView { | ||
let view = NSVisualEffectView() | ||
if let material { | ||
view.material = material | ||
} | ||
|
||
return view | ||
} | ||
|
||
func updateNSView(_ nsView: NSVisualEffectView, context: Context) { | ||
if let material { | ||
nsView.material = material | ||
} | ||
} | ||
} |