fixed roll button dissappearing in windows build
This commit is contained in:
@@ -106,7 +106,7 @@ func main() {
|
|||||||
newCustomButton2("*", func() {
|
newCustomButton2("*", func() {
|
||||||
diceInputEntry.SetText(diceInputEntry.Text + "*")
|
diceInputEntry.SetText(diceInputEntry.Text + "*")
|
||||||
}),
|
}),
|
||||||
newCustomButton2("⌫", func() {
|
newCustomButton2("BKSP", func() {
|
||||||
text := diceInputEntry.Text
|
text := diceInputEntry.Text
|
||||||
if len(text) > 0 {
|
if len(text) > 0 {
|
||||||
diceInputEntry.SetText(text[:len(text)-1])
|
diceInputEntry.SetText(text[:len(text)-1])
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ type customButton2 struct {
|
|||||||
func (b *customButton2) CreateRenderer() fyne.WidgetRenderer {
|
func (b *customButton2) CreateRenderer() fyne.WidgetRenderer {
|
||||||
text := canvas.NewText(b.Text, b.textColor())
|
text := canvas.NewText(b.Text, b.textColor())
|
||||||
text.Alignment = fyne.TextAlignCenter
|
text.Alignment = fyne.TextAlignCenter
|
||||||
background := canvas.NewRectangle(color.Transparent)
|
background := canvas.NewRectangle(b.backgroundColor())
|
||||||
return &customButton2Renderer{
|
return &customButton2Renderer{
|
||||||
text: text,
|
text: text,
|
||||||
background: background,
|
background: background,
|
||||||
@@ -162,7 +162,7 @@ func (b *customButton2) textColor() color.Color {
|
|||||||
variant := fyne.CurrentApp().Settings().ThemeVariant()
|
variant := fyne.CurrentApp().Settings().ThemeVariant()
|
||||||
switch b.Importance {
|
switch b.Importance {
|
||||||
case widget.HighImportance:
|
case widget.HighImportance:
|
||||||
return fyne.CurrentApp().Settings().Theme().Color(theme.ColorNameBackground, variant)
|
return color.White
|
||||||
default:
|
default:
|
||||||
return fyne.CurrentApp().Settings().Theme().Color(theme.ColorNameForeground, variant)
|
return fyne.CurrentApp().Settings().Theme().Color(theme.ColorNameForeground, variant)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user