diff options
author | Thomas Lübking <thomas.luebking@gmail.com> | 2016-08-04 13:20:35 (GMT) |
---|---|---|
committer | Thomas Lübking <thomas.luebking@gmail.com> | 2016-08-06 15:09:30 (GMT) |
commit | cc80230bd85dbaf1036b4cf37259d3146229fb00 (patch) | |
tree | e990270246cf1b07bf5eb6c6ba1ebcd71c9dd8b9 /src/FbTk/TextButton.cc | |
parent | 59d9b0703ba8efb24893528f2eb9c84aaa8f5f83 (diff) | |
download | fluxbox-cc80230bd85dbaf1036b4cf37259d3146229fb00.zip fluxbox-cc80230bd85dbaf1036b4cf37259d3146229fb00.tar.bz2 |
expose a preferredWidth of *Button's
Diffstat (limited to 'src/FbTk/TextButton.cc')
-rw-r--r-- | src/FbTk/TextButton.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/FbTk/TextButton.cc b/src/FbTk/TextButton.cc index 4d05ecd..0cc1b51 100644 --- a/src/FbTk/TextButton.cc +++ b/src/FbTk/TextButton.cc | |||
@@ -112,6 +112,10 @@ unsigned int TextButton::textWidth() const { | |||
112 | return font().textWidth(text()); | 112 | return font().textWidth(text()); |
113 | } | 113 | } |
114 | 114 | ||
115 | unsigned int TextButton::preferredWidth() const { | ||
116 | return m_bevel + m_left_padding + m_right_padding + textWidth(); | ||
117 | } | ||
118 | |||
115 | void TextButton::renderForeground(FbWindow &win, FbDrawable &drawable) { | 119 | void TextButton::renderForeground(FbWindow &win, FbDrawable &drawable) { |
116 | // (win should always be *this, no need to check) | 120 | // (win should always be *this, no need to check) |
117 | drawText(0, 0, &drawable); | 121 | drawText(0, 0, &drawable); |