mgsmartflow

package module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 11, 2026 License: MIT Imports: 2 Imported by: 1

README

MGSmartFlow

MGSmartFlow é um layout customizado para Fyne que facilita a criação de interfaces dinâmicas baseadas em linhas e colunas, com controle inteligente de espaçamento, redimensionamento e posicionamento de widgets.

Ele foi projetado para simplificar layouts complexos sem depender apenas dos layouts padrões do Fyne.


✨ Recursos

  • 📐 Layout por linhas e colunas
  • 📏 Redimensionamento automático ou fixo por widget
  • 🧭 Posicionamento manual opcional
  • ↔️ Espaçamento global ou individual
  • 🔄 Atualização dinâmica do layout
  • 🧩 Wrapper simples para uso direto

📦 Instalação

go get github.com/mugomes/mgsmartflow

🚀 Uso Básico

Criando o SmartFlow
flow := mgsmartflow.New()
Adicionando uma linha
flow.AddRow(widget.NewLabel("Linha única"))
Adicionando colunas na mesma linha
flow.AddColumn(
	widget.NewButton("Botão 1", nil),
	widget.NewButton("Botão 2", nil),
)

📐 Controle de Layout

Redimensionar um widget
flow.Resize(btn, 120, 40)
Mover manualmente um widget
flow.Move(btn, 10, 20)
Espaçamento individual entre widgets
flow.Gap(btn, 15, 10)
Espaçamento global do layout
flow.GlobalGap(10, 10)

⚠️ Funções Depreciadas

As funções abaixo ainda funcionam, mas foram mantidas apenas por compatibilidade:

  • SetResize → use Resize
  • SetMove → use Move
  • SetGap → use Gap
  • SetGlobalGap → use GlobalGap

Essas funções serão removidas na versão 1.2.0


🧩 Compatibilidade

  • Go 1.25.5+
  • Fyne 2.7.1

👤 Autor

Murilo Gomes Julio

🔗 https://mugomes.github.io

📺 https://youtube.com/@mugomesoficial


License

Copyright (c) 2025-2026 Murilo Gomes Julio

Licensed under the MIT license.

All contributions to the MGSmartFlow are subject to this license.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SmartFlow

type SmartFlow struct {
	Container *fyne.Container
	Layout    *SmartFlowLayout
}

func New

func New() *SmartFlow

func (*SmartFlow) AddColumn

func (s *SmartFlow) AddColumn(objs ...fyne.CanvasObject)

func (*SmartFlow) AddRow

func (s *SmartFlow) AddRow(obj fyne.CanvasObject)

Publico

func (*SmartFlow) Gap added in v1.1.0

func (s *SmartFlow) Gap(obj fyne.CanvasObject, x, y float32)

Nova Função

func (*SmartFlow) GlobalGap added in v1.1.0

func (s *SmartFlow) GlobalGap(x, y float32)

Nova Função

func (*SmartFlow) Move added in v1.1.0

func (s *SmartFlow) Move(obj fyne.CanvasObject, x, y float32)

Nova Função

func (*SmartFlow) Resize added in v1.1.0

func (s *SmartFlow) Resize(obj fyne.CanvasObject, width, height float32)

Nova Função

func (*SmartFlow) SetGap deprecated

func (s *SmartFlow) SetGap(obj fyne.CanvasObject, gap fyne.Position)

Deprecated: Use Gap

func (*SmartFlow) SetGlobalGap deprecated

func (s *SmartFlow) SetGlobalGap(x, y float32)

Deprecated: Use GlobalGap

func (*SmartFlow) SetMove deprecated

func (s *SmartFlow) SetMove(obj fyne.CanvasObject, pos fyne.Position)

Deprecated: Use Move

func (*SmartFlow) SetResize deprecated

func (s *SmartFlow) SetResize(obj fyne.CanvasObject, size fyne.Size)

Deprecated: Use Resize

type SmartFlowLayout

type SmartFlowLayout struct {
	// contains filtered or unexported fields
}

func (*SmartFlowLayout) AddColumn

func (l *SmartFlowLayout) AddColumn(objs ...fyne.CanvasObject)

func (*SmartFlowLayout) AddRow

func (l *SmartFlowLayout) AddRow(obj fyne.CanvasObject)

func (*SmartFlowLayout) Layout

func (l *SmartFlowLayout) Layout(objects []fyne.CanvasObject, size fyne.Size)

func (*SmartFlowLayout) MinSize

func (l *SmartFlowLayout) MinSize(objects []fyne.CanvasObject) fyne.Size

MinSize

func (*SmartFlowLayout) SetGap

func (l *SmartFlowLayout) SetGap(obj fyne.CanvasObject, gap fyne.Position)

func (*SmartFlowLayout) SetGlobalGap

func (l *SmartFlowLayout) SetGlobalGap(x, y float32)

func (*SmartFlowLayout) SetMove

func (l *SmartFlowLayout) SetMove(obj fyne.CanvasObject, pos fyne.Position)

func (*SmartFlowLayout) SetResize

func (l *SmartFlowLayout) SetResize(obj fyne.CanvasObject, size fyne.Size)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL