Make it possible to drag and drop multiple files
It is now possible to add multiple files before sending them to the processing queue.
This commit is contained in:
76
kernel/right_tabs.go
Normal file
76
kernel/right_tabs.go
Normal file
@@ -0,0 +1,76 @@
|
||||
package kernel
|
||||
|
||||
import (
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/container"
|
||||
"github.com/nicksnyder/go-i18n/v2/i18n"
|
||||
)
|
||||
|
||||
type RightTabsContract interface {
|
||||
GetTabs() *container.AppTabs
|
||||
GetAddedFilesContainer() *fyne.Container
|
||||
GetFileQueueContainer() *fyne.Container
|
||||
SelectFileQueueTab()
|
||||
SelectAddedFilesTab()
|
||||
}
|
||||
|
||||
type RightTabs struct {
|
||||
tabs *container.AppTabs
|
||||
|
||||
addedFilesContainer *fyne.Container
|
||||
addedFilesTab *container.TabItem
|
||||
|
||||
fileQueueContainer *fyne.Container
|
||||
fileQueueTab *container.TabItem
|
||||
}
|
||||
|
||||
func NewRightTabs(localizerService LocalizerContract) *RightTabs {
|
||||
addedFilesContainer := container.NewVBox()
|
||||
addedFilesTab := container.NewTabItem(localizerService.GetMessage(&i18n.LocalizeConfig{MessageID: "addedFilesTitle"}), addedFilesContainer)
|
||||
localizerService.AddChangeCallback("addedFilesTitle", func(text string) {
|
||||
addedFilesTab.Text = text
|
||||
})
|
||||
|
||||
fileQueueContainer := container.NewVBox()
|
||||
fileQueueTab := container.NewTabItem(localizerService.GetMessage(&i18n.LocalizeConfig{MessageID: "fileQueueTitle"}), fileQueueContainer)
|
||||
localizerService.AddChangeCallback("fileQueueTitle", func(text string) {
|
||||
fileQueueTab.Text = text
|
||||
})
|
||||
|
||||
tabs := container.NewAppTabs(
|
||||
addedFilesTab,
|
||||
fileQueueTab,
|
||||
)
|
||||
|
||||
return &RightTabs{
|
||||
tabs: tabs,
|
||||
addedFilesContainer: addedFilesContainer,
|
||||
addedFilesTab: addedFilesTab,
|
||||
fileQueueContainer: fileQueueContainer,
|
||||
fileQueueTab: fileQueueTab,
|
||||
}
|
||||
}
|
||||
|
||||
func (t RightTabs) GetTabs() *container.AppTabs {
|
||||
return t.tabs
|
||||
}
|
||||
|
||||
func (t RightTabs) GetAddedFilesContainer() *fyne.Container {
|
||||
return t.addedFilesContainer
|
||||
}
|
||||
|
||||
func (t RightTabs) GetFileQueueContainer() *fyne.Container {
|
||||
return t.fileQueueContainer
|
||||
}
|
||||
|
||||
func (t RightTabs) SelectFileQueueTab() {
|
||||
fyne.Do(func() {
|
||||
t.tabs.Select(t.fileQueueTab)
|
||||
})
|
||||
}
|
||||
|
||||
func (t RightTabs) SelectAddedFilesTab() {
|
||||
fyne.Do(func() {
|
||||
t.tabs.Select(t.addedFilesTab)
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user