fixed theme selection from menu, centralized theme def to 1 place

This commit is contained in:
2024-06-09 18:00:06 +02:00
parent 01cfaf3b78
commit 3a743a65e5
4 changed files with 72 additions and 65 deletions

View File

@@ -129,7 +129,9 @@ func NewCombobox(items []string, selected string,
),
widget.ListComboButtonOpts.ListOpts(
//Set how wide the dropdown list should be
widget.ListOpts.ContainerOpts(widget.ContainerOpts.WidgetOpts(widget.WidgetOpts.MinSize(50, 0))),
widget.ListOpts.ContainerOpts(
widget.ContainerOpts.WidgetOpts(widget.WidgetOpts.MinSize(50, 0)),
),
//Set the entries in the list
widget.ListOpts.Entries(entries),
widget.ListOpts.ScrollContainerOpts(
@@ -152,16 +154,15 @@ func NewCombobox(items []string, selected string,
//Set the font for the list options
widget.ListOpts.EntryFontFace(*FontRenderer.FontSmall),
//Set the colors for the list
// FIXME: Change to our own color set
widget.ListOpts.EntryColor(&widget.ListEntryColor{
Selected: color.NRGBA{254, 255, 255, 255}, //Foreground color for the unfocused selected entry
Unselected: color.NRGBA{254, 255, 255, 255}, //Foreground color for the unfocused unselected entry
SelectedBackground: color.NRGBA{R: 130, G: 130, B: 200, A: 255}, //Background color for the unfocused selected entry
SelectedFocusedBackground: color.NRGBA{R: 130, G: 130, B: 170, A: 255}, //Background color for the focused selected entry
FocusedBackground: color.NRGBA{R: 170, G: 170, B: 180, A: 255}, //Background color for the focused unselected entry
DisabledUnselected: color.NRGBA{100, 100, 100, 255}, //Foreground color for the disabled unselected entry
DisabledSelected: color.NRGBA{100, 100, 100, 255}, //Foreground color for the disabled selected entry
DisabledSelectedBackground: color.NRGBA{100, 100, 100, 255}, //Background color for the disabled selected entry
Selected: color.NRGBA{254, 255, 255, 255},
Unselected: color.NRGBA{254, 255, 255, 255},
SelectedBackground: HexColor2RGBA(THEMES["standard"].life),
SelectedFocusedBackground: HexColor2RGBA(THEMES["standard"].old),
FocusedBackground: HexColor2RGBA(THEMES["standard"].old),
DisabledUnselected: HexColor2RGBA(THEMES["standard"].grid),
DisabledSelected: HexColor2RGBA(THEMES["standard"].grid),
DisabledSelectedBackground: HexColor2RGBA(THEMES["standard"].grid),
}),
//Padding for each entry
widget.ListOpts.EntryTextPadding(widget.NewInsetsSimple(5)),