summaryrefslogtreecommitdiffstatshomepage
path: root/toolbar.go
diff options
context:
space:
mode:
authorAlexander Neumann <alexander.neumann@picos-software.com>2019-05-06 14:49:37 +0200
committerAlexander Neumann <alexander.neumann@picos-software.com>2019-05-06 14:49:37 +0200
commitbcb938ee1fcb27801ceda364da2d70ea3f4f66c0 (patch)
tree608f47909ccfa643aa6e4fc513f908479da42568 /toolbar.go
parentExport some HIDPI related helpers (diff)
parentMerge pull request #503 from zx2c4-forks/jd/notifyicon-icons (diff)
downloadwireguard-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.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/toolbar.go b/toolbar.go
index 76e60900..2ccf2c8e 100644
--- a/toolbar.go
+++ b/toolbar.go
@@ -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
}