Add layout system and file selection logic
Introduce a new layout system for managing main window content and tabs. Integrate file selection and drag-and-drop functionality for adding files to the conversion list, with automatic tab switching to "Added Files". Refactor existing components to support these features.
This commit is contained in:
@@ -1,15 +1,21 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"git.kor-elf.net/kor-elf/gui-for-ffmpeg/internal/ffmpeg"
|
||||
"git.kor-elf.net/kor-elf/gui-for-ffmpeg/internal/ffmpeg/download/service"
|
||||
"git.kor-elf.net/kor-elf/gui-for-ffmpeg/internal/gui/view"
|
||||
)
|
||||
|
||||
func (c *controller) convertor() {
|
||||
content := view.Convertor()
|
||||
content := view.Convertor(c.window, c.addFileForConversion)
|
||||
c.window.SetContent(content)
|
||||
}
|
||||
|
||||
func (c *controller) addFileForConversion(file ffmpeg.File) {
|
||||
c.app.GetItemsToConvert().Add(&file)
|
||||
c.window.GetLayout().GetRContainer().SelectAddedFilesTab()
|
||||
}
|
||||
|
||||
func (c *controller) settingConvertor(isAllowCancellation bool) {
|
||||
ffmpegPath := c.app.GetFFmpegService().GetFFmpegPath()
|
||||
ffprobePath := c.app.GetFFmpegService().GetFFprobePath()
|
||||
|
@@ -22,8 +22,13 @@ func NewController(app application.AppContract) ControllerContract {
|
||||
app.GetQueueService().AddListener(queueLayout)
|
||||
|
||||
return &controller{
|
||||
app: app,
|
||||
window: window.NewMainWindow(fyneWindow, app.GetProgressBarService(), app.GetItemsToConvert(), queueLayout),
|
||||
app: app,
|
||||
window: window.NewMainWindow(
|
||||
fyneWindow,
|
||||
app.GetProgressBarService(),
|
||||
app.GetItemsToConvert(),
|
||||
queueLayout,
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user