-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathInputContainers.go
36 lines (34 loc) · 1.1 KB
/
InputContainers.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package main
import (
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/widget"
"log"
)
func bottomInputBox(chat *fyne.Container, tabs *container.AppTabs, aiGen *container.TabItem) *container.Split {
inputBox := widget.NewMultiLineEntry()
inputBox.Wrapping = fyne.TextWrapWord
//TODO: Edit InputBox OnChanged
inputBox.OnChanged = func(s string) {
log.Printf("Input changed to: %s", s)
kitchenLog(s)
}
//TODO: Edit InputBox Container
inputBox.PlaceHolder = "Enter your message here..."
sendButton := sendButton(inputBox, chat)
voiceNoteButton := voiceChatButton(inputBox, chat)
mediaUploadButton := imageUploadInput(inputBox, chat)
voiceNoteButton.Resize(fyne.NewSize(50, 100))
inputBoxContainer := container.NewHSplit(inputBox, sendButton)
inputBoxContainer = container.NewVSplit(inputBoxContainer, voiceNoteButton)
inputBoxContainer = container.NewVSplit(inputBoxContainer, mediaUploadButton)
tabs.OnSelected = func(tab *container.TabItem) {
if tab == aiGen {
//Show if tab is home
inputBoxContainer.Show()
} else {
inputBoxContainer.Hide()
}
}
return inputBoxContainer
}