mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 03:05:19 +00:00
macOS: Focus message input on launch instead of nickname field
This commit is contained in:
@@ -137,6 +137,7 @@ struct ContentView: View {
|
|||||||
// MARK: - Body
|
// MARK: - Body
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
|
<<<<<<< HEAD
|
||||||
VStack(spacing: 0) {
|
VStack(spacing: 0) {
|
||||||
mainHeaderView
|
mainHeaderView
|
||||||
.onAppear { viewModel.currentColorScheme = colorScheme }
|
.onAppear { viewModel.currentColorScheme = colorScheme }
|
||||||
@@ -149,6 +150,30 @@ struct ContentView: View {
|
|||||||
GeometryReader { geometry in
|
GeometryReader { geometry in
|
||||||
VStack(spacing: 0) {
|
VStack(spacing: 0) {
|
||||||
messagesView(privatePeer: nil, isAtBottom: $isAtBottomPublic)
|
messagesView(privatePeer: nil, isAtBottom: $isAtBottomPublic)
|
||||||
|
=======
|
||||||
|
GeometryReader { geometry in
|
||||||
|
ZStack {
|
||||||
|
// Base layer - Main public chat (always visible)
|
||||||
|
mainChatView
|
||||||
|
.onAppear {
|
||||||
|
viewModel.currentColorScheme = colorScheme
|
||||||
|
#if os(macOS)
|
||||||
|
// Focus message input on macOS launch, not nickname field
|
||||||
|
DispatchQueue.main.async {
|
||||||
|
isNicknameFieldFocused = false
|
||||||
|
isTextFieldFocused = true
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
.onChange(of: colorScheme) { newValue in
|
||||||
|
viewModel.currentColorScheme = newValue
|
||||||
|
}
|
||||||
|
|
||||||
|
// Private chat slide-over
|
||||||
|
if viewModel.selectedPrivateChatPeer != nil {
|
||||||
|
privateChatView
|
||||||
|
.frame(width: geometry.size.width)
|
||||||
|
>>>>>>> 49a22aa9 (macOS: Focus message input on launch instead of nickname field)
|
||||||
.background(backgroundColor)
|
.background(backgroundColor)
|
||||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user