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:
2025-06-07 23:44:47 +05:00
parent 6e8b148c81
commit 394824ce88
7 changed files with 381 additions and 145 deletions

View File

@@ -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()

View File

@@ -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,
),
}
}