adding thick separator to navigation bar and bottom panel

This commit is contained in:
Drew Weymouth
2023-01-03 15:57:35 -08:00
parent ede625f33a
commit 44536b8bef
4 changed files with 36 additions and 2 deletions
+2
View File
@@ -8,6 +8,7 @@ import (
"time"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/theme"
"github.com/20after4/configdir"
"github.com/zalando/go-keyring"
)
@@ -28,6 +29,7 @@ func main() {
}
fyneApp := app.New()
fyneApp.Settings().SetTheme(theme.DarkTheme())
mainWindow := ui.NewMainWindow(fyneApp, appname, myApp)
// TODO: There is some race condition with running this initial startup
+2 -1
View File
@@ -100,8 +100,9 @@ func NewBottomPanel(p *player.Player) *BottomPanel {
_ = p.SetVolume(v)
}
bp.container = container.New(newBottomPanelLayout(500, bp.NowPlaying, bp.Controls, bp.AuxControls),
main := container.New(newBottomPanelLayout(500, bp.NowPlaying, bp.Controls, bp.AuxControls),
bp.NowPlaying, bp.Controls, bp.AuxControls)
bp.container = container.NewBorder(widgets.NewThickSeparator(), nil, nil, nil, main)
return bp
}
+4 -1
View File
@@ -57,7 +57,10 @@ func NewBrowsingPane(app *backend.App) *BrowsingPane {
b.forward = widget.NewButtonWithIcon("", theme.NavigateNextIcon(), b.GoForward)
b.curPage = &blankPage{}
b.container = container.NewBorder(
container.NewHBox(b.back, b.forward, b.searchBar),
container.NewVBox(
container.NewHBox(b.back, b.forward, b.searchBar),
widgets.NewThickSeparator(),
),
nil, nil, nil, b.curPage)
return b
}
+28
View File
@@ -0,0 +1,28 @@
package widgets
import (
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/canvas"
"fyne.io/fyne/v2/theme"
"fyne.io/fyne/v2/widget"
)
type ThickSeparator struct {
widget.BaseWidget
line canvas.Line
}
func NewThickSeparator() *ThickSeparator {
t := &ThickSeparator{
line: canvas.Line{
StrokeWidth: 3,
StrokeColor: theme.DisabledColor(),
},
}
t.ExtendBaseWidget(t)
return t
}
func (t *ThickSeparator) CreateRenderer() fyne.WidgetRenderer {
return widget.NewSimpleRenderer(&t.line)
}