diff options
author | Alexander Neumann <an2048@gmail.com> | 2019-05-06 10:53:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-06 10:53:00 +0200 |
commit | 8028e67d18ca07a71cedc373720037e913789f47 (patch) | |
tree | d2df8f61d68aab1f49f1ba72070f4937701e25d0 | |
parent | Merge pull request #506 from zx2c4-forks/jd/shortcutaction (diff) | |
parent | ui: show tooltips for buttons with no text (diff) | |
download | wireguard-windows-8028e67d18ca07a71cedc373720037e913789f47.tar.xz wireguard-windows-8028e67d18ca07a71cedc373720037e913789f47.zip |
Merge pull request #507 from zx2c4-forks/jd/tooltip-mixed-toolbutton
ui: show tooltips for buttons with no text
-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 } |