diff options
author | 2019-05-06 14:49:37 +0200 | |
---|---|---|
committer | 2019-05-06 14:49:37 +0200 | |
commit | bcb938ee1fcb27801ceda364da2d70ea3f4f66c0 (patch) | |
tree | 608f47909ccfa643aa6e4fc513f908479da42568 /toolbar.go | |
parent | Export some HIDPI related helpers (diff) | |
parent | Merge pull request #503 from zx2c4-forks/jd/notifyicon-icons (diff) | |
download | wireguard-windows-bcb938ee1fcb27801ceda364da2d70ea3f4f66c0.tar.xz wireguard-windows-bcb938ee1fcb27801ceda364da2d70ea3f4f66c0.zip |
Merge branch 'master' of github.com:lxn/walk
Diffstat (limited to 'toolbar.go')
-rw-r--r-- | toolbar.go | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -329,7 +329,7 @@ func (tb *ToolBar) initButtonForAction(action *Action, state, style *byte, image *style |= win.BTNS_GROUP } - if tb.buttonStyle != ToolBarButtonImageOnly { + if tb.buttonStyle != ToolBarButtonImageOnly && len(action.text) > 0 { *style |= win.BTNS_SHOWTEXT } @@ -358,7 +358,11 @@ func (tb *ToolBar) initButtonForAction(action *Action, state, style *byte, image actionText = action.Text() } - *text = uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(actionText))) + if len(actionText) != 0 { + *text = uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(actionText))) + } else if len(action.toolTip) != 0 { + *text = uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(action.toolTip))) + } return } |