adding thick separator to navigation bar and bottom panel
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"fyne.io/fyne/v2/app"
|
"fyne.io/fyne/v2/app"
|
||||||
|
"fyne.io/fyne/v2/theme"
|
||||||
"github.com/20after4/configdir"
|
"github.com/20after4/configdir"
|
||||||
"github.com/zalando/go-keyring"
|
"github.com/zalando/go-keyring"
|
||||||
)
|
)
|
||||||
@@ -28,6 +29,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fyneApp := app.New()
|
fyneApp := app.New()
|
||||||
|
fyneApp.Settings().SetTheme(theme.DarkTheme())
|
||||||
mainWindow := ui.NewMainWindow(fyneApp, appname, myApp)
|
mainWindow := ui.NewMainWindow(fyneApp, appname, myApp)
|
||||||
|
|
||||||
// TODO: There is some race condition with running this initial startup
|
// TODO: There is some race condition with running this initial startup
|
||||||
|
|||||||
+2
-1
@@ -100,8 +100,9 @@ func NewBottomPanel(p *player.Player) *BottomPanel {
|
|||||||
_ = p.SetVolume(v)
|
_ = 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.NowPlaying, bp.Controls, bp.AuxControls)
|
||||||
|
bp.container = container.NewBorder(widgets.NewThickSeparator(), nil, nil, nil, main)
|
||||||
return bp
|
return bp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+4
-1
@@ -57,7 +57,10 @@ func NewBrowsingPane(app *backend.App) *BrowsingPane {
|
|||||||
b.forward = widget.NewButtonWithIcon("", theme.NavigateNextIcon(), b.GoForward)
|
b.forward = widget.NewButtonWithIcon("", theme.NavigateNextIcon(), b.GoForward)
|
||||||
b.curPage = &blankPage{}
|
b.curPage = &blankPage{}
|
||||||
b.container = container.NewBorder(
|
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)
|
nil, nil, nil, b.curPage)
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user