osx: some minor fixes
This commit is contained in:
@@ -322,7 +322,7 @@
|
|||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
DEVELOPMENT_TEAM = DQQH5H6GBD;
|
DEVELOPMENT_TEAM = 3SJALV9BQ7;
|
||||||
ENABLE_HARDENED_RUNTIME = NO;
|
ENABLE_HARDENED_RUNTIME = NO;
|
||||||
ENABLE_PREVIEWS = YES;
|
ENABLE_PREVIEWS = YES;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
@@ -349,7 +349,7 @@
|
|||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
DEVELOPMENT_TEAM = DQQH5H6GBD;
|
DEVELOPMENT_TEAM = 3SJALV9BQ7;
|
||||||
ENABLE_HARDENED_RUNTIME = NO;
|
ENABLE_HARDENED_RUNTIME = NO;
|
||||||
ENABLE_PREVIEWS = YES;
|
ENABLE_PREVIEWS = YES;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
|
|||||||
@@ -14,7 +14,10 @@ struct KordophoneApp: App
|
|||||||
WindowGroup {
|
WindowGroup {
|
||||||
SplitView()
|
SplitView()
|
||||||
}
|
}
|
||||||
|
.commands {
|
||||||
|
TextEditingCommands()
|
||||||
|
}
|
||||||
|
|
||||||
Settings {
|
Settings {
|
||||||
PreferencesView()
|
PreferencesView()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ struct ConversationListView: View
|
|||||||
@Environment(\.xpcClient) private var xpcClient
|
@Environment(\.xpcClient) private var xpcClient
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
List($model.conversations, selection: $model.selectedConversations) { conv in
|
List($model.conversations, selection: $model.selectedConversation) { conv in
|
||||||
let isUnread = conv.wrappedValue.unreadCount > 0
|
let isUnread = conv.wrappedValue.unreadCount > 0
|
||||||
|
|
||||||
HStack(spacing: 0.0) {
|
HStack(spacing: 0.0) {
|
||||||
@@ -64,14 +64,14 @@ struct ConversationListView: View
|
|||||||
class ViewModel
|
class ViewModel
|
||||||
{
|
{
|
||||||
var conversations: [Display.Conversation]
|
var conversations: [Display.Conversation]
|
||||||
var selectedConversations: Set<Display.Conversation.ID>
|
var selectedConversation: Display.Conversation.ID?
|
||||||
|
|
||||||
private var needsReload: Bool = true
|
private var needsReload: Bool = true
|
||||||
private let client = XPCClient()
|
private let client = XPCClient()
|
||||||
|
|
||||||
public init(conversations: [Display.Conversation] = []) {
|
public init(conversations: [Display.Conversation] = []) {
|
||||||
self.conversations = conversations
|
self.conversations = conversations
|
||||||
self.selectedConversations = Set()
|
self.selectedConversation = nil
|
||||||
setNeedsReload()
|
setNeedsReload()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ struct MessageEntryView: View
|
|||||||
.font(.body)
|
.font(.body)
|
||||||
.scrollDisabled(true)
|
.scrollDisabled(true)
|
||||||
.disabled(selectedConversation == nil)
|
.disabled(selectedConversation == nil)
|
||||||
|
.id("messageEntry")
|
||||||
}
|
}
|
||||||
.padding(8.0)
|
.padding(8.0)
|
||||||
.background {
|
.background {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ struct SplitView: View
|
|||||||
|
|
||||||
private let xpcClient = XPCClient()
|
private let xpcClient = XPCClient()
|
||||||
private var selectedConversation: Display.Conversation? {
|
private var selectedConversation: Display.Conversation? {
|
||||||
guard let id = conversationListModel.selectedConversations.first else { return nil }
|
guard let id = conversationListModel.selectedConversation else { return nil }
|
||||||
return conversationListModel.conversations.first { $0.id == id }
|
return conversationListModel.conversations.first { $0.id == id }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -28,10 +28,10 @@ struct SplitView: View
|
|||||||
ConversationView(transcriptModel: $transcriptViewModel, entryModel: $entryViewModel)
|
ConversationView(transcriptModel: $transcriptViewModel, entryModel: $entryViewModel)
|
||||||
.xpcClient(xpcClient)
|
.xpcClient(xpcClient)
|
||||||
.selectedConversation(selectedConversation)
|
.selectedConversation(selectedConversation)
|
||||||
.navigationTitle("Kordophone")
|
.navigationTitle(selectedConversation?.displayName ?? "Kordophone")
|
||||||
.navigationSubtitle(selectedConversation?.displayName ?? "")
|
.navigationSubtitle(selectedConversation?.participants.joined(separator: ", ") ?? "")
|
||||||
.onChange(of: conversationListModel.selectedConversations) { oldValue, newValue in
|
.onChange(of: conversationListModel.selectedConversation) { oldValue, newValue in
|
||||||
transcriptViewModel.displayedConversation = conversationListModel.conversations.first { $0.id == newValue.first }
|
transcriptViewModel.displayedConversation = conversationListModel.conversations.first { $0.id == newValue }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user