add disable bubble customization

This commit is contained in:
cheykrym 2025-12-12 00:32:26 +03:00
parent 11710263e0
commit beb7af003b
2 changed files with 16 additions and 4 deletions

View File

@ -285,8 +285,8 @@ struct PrivateChatView: View {
.padding(.horizontal, 12) .padding(.horizontal, 12)
.background( .background(
MessageBubbleShape( MessageBubbleShape(
showHorns: decorations.showHorns, showHornsRaw: decorations.showHorns,
showLegs: decorations.showLegs showLegsRaw: decorations.showLegs
) )
.fill(bubbleColor) .fill(bubbleColor)
) )
@ -831,8 +831,18 @@ private struct MessageBubbleShape: Shape {
var legHeight: CGFloat = 6 var legHeight: CGFloat = 6
var legWidth: CGFloat = 18 var legWidth: CGFloat = 18
var legSpacing: CGFloat = 14 var legSpacing: CGFloat = 14
var showHorns: Bool = true
var showLegs: Bool = true var showHornsRaw: Bool = true
var showLegsRaw: Bool = true
// Фактические флаги отрисовки
var showHorns: Bool {
AppConfig.ENABLE_CHAT_BUBBLE_DECORATIONS && showHornsRaw
}
var showLegs: Bool {
AppConfig.ENABLE_CHAT_BUBBLE_DECORATIONS && showLegsRaw
}
func path(in rect: CGRect) -> Path { func path(in rect: CGRect) -> Path {
var path = Path() var path = Path()

View File

@ -13,6 +13,8 @@ struct AppConfig {
static let APP_VERSION = "0.1" static let APP_VERSION = "0.1"
static let DISABLE_DB = false static let DISABLE_DB = false
/// Temporary flag to toggle whimsical chat bubble horns/legs rendering.
static let ENABLE_CHAT_BUBBLE_DECORATIONS = true
/// Controls whether incoming chat opens as a modal sheet (`true`) or navigates to Chats tab (`false`). /// Controls whether incoming chat opens as a modal sheet (`true`) or navigates to Chats tab (`false`).
static let PRESENT_CHAT_AS_SHEET = false static let PRESENT_CHAT_AS_SHEET = false
/// Fallback SQLCipher key used until the user sets an application password. /// Fallback SQLCipher key used until the user sets an application password.