We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image buton size is dynamically resized according to window size
Refer to this repository
package layout import ( "fyne.io/fyne/v2" "fyne.io/fyne/v2/canvas" "fyne.io/fyne/v2/container" "fyne.io/fyne/v2/layout" "fyne.io/fyne/v2/widget" xlayout "fyne.io/x/fyne/layout" "github.com/milkcoke/toolbox-gui/src/assets" "image/color" ) func (appConfig *AppConfig) LoadResizeLayout(win fyne.Window) (buttonContainer *fyne.Container) { // .. totalWidth := float32(1200) totalHeight := float32(800) hBox := container.NewHBox(downloadDirPathBtn, pathLabel) line := container.NewBorder(canvas.NewLine(color.White), nil, nil, nil) hBoxSize := hBox.MinSize() lineSize := line.MinSize() remainHeight := totalHeight - (hBoxSize.Height + lineSize.Height) buttonWidth := totalWidth / 3.08 buttonHeight := remainHeight / 3.08 // ✅ Responsive and resize the container responsiveContainer := xlayout.NewResponsiveLayout( container.NewMax(pythonImgBtn, container.NewCenter(pythonProgress)), container.NewMax(nodeImgBtn, container.NewCenter(nodeProgress)), container.NewMax(goImgBtn, container.NewCenter(goProgress)), container.NewMax(dockerImgBtn, container.NewCenter(dockerProgress)), container.NewMax(postmanImgBtn, container.NewCenter(postmanProgress)), container.NewMax(notionImgBtn, container.NewCenter(notionProgress)), ) buttonsContainer := container.New(layout.NewGridWrapLayout(fyne.NewSize(buttonWidth, buttonHeight)), container.NewMax(pythonImgBtn, container.NewCenter(pythonProgress)), container.NewMax(nodeImgBtn, container.NewCenter(nodeProgress)), container.NewMax(goImgBtn, container.NewCenter(goProgress)), container.NewMax(dockerImgBtn, container.NewCenter(dockerProgress)), container.NewMax(postmanImgBtn, container.NewCenter(postmanProgress)), container.NewMax(notionImgBtn, container.NewCenter(notionProgress)), ) buttonsContainer.Size() vboxContainer := container.NewVBox( hBox, line, container.NewMax(responsiveContainer), ) return vboxContainer }
The text was updated successfully, but these errors were encountered:
milkcoke
No branches or pull requests
Image buton size is dynamically resized according to window size
Refer to this repository
resize_layout.go
The text was updated successfully, but these errors were encountered: