gui: fix properties tab background colour for windows build
This commit is contained in:
parent
e5cbbb6822
commit
50cf207eae
5
main.go
5
main.go
@ -10,7 +10,6 @@ import (
|
||||
"github.com/pkg/browser"
|
||||
"github.com/ying32/govcl/vcl"
|
||||
"github.com/ying32/govcl/vcl/types"
|
||||
"github.com/ying32/govcl/vcl/types/colors"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -187,8 +186,8 @@ func (f *TMainForm) OnFormCreate(sender vcl.IObject) {
|
||||
f.propertiesBox.BorderSpacing().SetAround(MY_SPACING)
|
||||
f.propertiesBox.SetAlign(types.AlClient) // fill remaining space
|
||||
f.propertiesBox.SetReadOnly(true)
|
||||
f.propertiesBox.SetEnabled(true) // Need to leave it enabled so scrolling works
|
||||
f.propertiesBox.SetColor(colors.ClForm) // 0x00f0f0f0
|
||||
f.propertiesBox.SetEnabled(true) // Need to leave it enabled so scrolling works
|
||||
f.propertiesBox.SetColor(vcl_default_tab_background())
|
||||
|
||||
f.propertiesBox.SetBorderStyle(types.BsNone)
|
||||
f.propertiesBox.SetScrollBars(types.SsAutoVertical)
|
||||
|
13
util_vcl.go
13
util_vcl.go
@ -1,8 +1,11 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
|
||||
"github.com/ying32/govcl/vcl"
|
||||
"github.com/ying32/govcl/vcl/types"
|
||||
"github.com/ying32/govcl/vcl/types/colors"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -49,3 +52,13 @@ func vcl_menuseparator(parent *vcl.TMenuItem) *vcl.TMenuItem {
|
||||
|
||||
return s
|
||||
}
|
||||
|
||||
func vcl_default_tab_background() types.TColor {
|
||||
if runtime.GOOS == "windows" {
|
||||
// Assuming that uxtheme is loaded
|
||||
// @ref https://stackoverflow.com/a/20332712
|
||||
return colors.ClBtnHighlight
|
||||
} else {
|
||||
return colors.ClBtnFace // 0x00f0f0f0
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user