From e208428e8a58e3d2e88512803b1fda6adf0c5e54 Mon Sep 17 00:00:00 2001 From: eeeXun Date: Mon, 24 Oct 2022 16:57:33 +0800 Subject: [PATCH] feat: enable select borderColor --- ui.go | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/ui.go b/ui.go index 980601f..e72cb69 100644 --- a/ui.go +++ b/ui.go @@ -197,11 +197,13 @@ func uiInit() { IndexOf(strconv.FormatBool(transparent), []string{"true", "false"})) srcBorderDropDown.SetLabel("Border Color: "). - SetOptions(Palette, nil) + SetOptions(Palette, nil). + SetCurrentOption(IndexOf(style.SrcBorderStr(), Palette)) srcBorderDropDown.SetBorder(true). SetTitle("Source") dstBorderDropDown.SetLabel("Border Color: "). - SetOptions(Palette, nil) + SetOptions(Palette, nil). + SetCurrentOption(IndexOf(style.DstBorderStr(), Palette)) dstBorderDropDown.SetBorder(true). SetTitle("Destination") @@ -258,8 +260,16 @@ func uiInit() { SetSelectedFunc(themeSelected) transparentDropDown.SetDoneFunc(styleDropDownHandler). SetSelectedFunc(transparentSelected) - srcBorderDropDown.SetDoneFunc(styleDropDownHandler) - dstBorderDropDown.SetDoneFunc(styleDropDownHandler) + srcBorderDropDown.SetDoneFunc(styleDropDownHandler). + SetSelectedFunc(func(text string, index int) { + style.SetSrcBorderColor(text) + updateBorderColor() + }) + dstBorderDropDown.SetDoneFunc(styleDropDownHandler). + SetSelectedFunc(func(text string, index int) { + style.SetDstBorderColor(text) + updateBorderColor() + }) langButton.SetSelectedFunc(func() { mainPage.HidePage("stylePage") mainPage.ShowPage("langPage")