aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/TextButton.cc
diff options
context:
space:
mode:
authorThomas Lübking <thomas.luebking@gmail.com>2016-08-04 13:20:35 (GMT)
committerThomas Lübking <thomas.luebking@gmail.com>2016-08-06 15:09:30 (GMT)
commitcc80230bd85dbaf1036b4cf37259d3146229fb00 (patch)
treee990270246cf1b07bf5eb6c6ba1ebcd71c9dd8b9 /src/FbTk/TextButton.cc
parent59d9b0703ba8efb24893528f2eb9c84aaa8f5f83 (diff)
downloadfluxbox-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.cc4
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
115unsigned int TextButton::preferredWidth() const {
116 return m_bevel + m_left_padding + m_right_padding + textWidth();
117}
118
115void TextButton::renderForeground(FbWindow &win, FbDrawable &drawable) { 119void 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);