aboutsummaryrefslogtreecommitdiff
path: root/src/ButtonTool.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/ButtonTool.cc')
-rw-r--r--src/ButtonTool.cc17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/ButtonTool.cc b/src/ButtonTool.cc
index 746549f..5f9aec1 100644
--- a/src/ButtonTool.cc
+++ b/src/ButtonTool.cc
@@ -51,8 +51,15 @@ void ButtonTool::updateSizing() {
51 btn.setBorderWidth(bw); 51 btn.setBorderWidth(bw);
52 if (FbTk::TextButton *txtBtn = dynamic_cast<FbTk::TextButton*>(&btn)) { 52 if (FbTk::TextButton *txtBtn = dynamic_cast<FbTk::TextButton*>(&btn)) {
53 bw += 2; // extra padding, seems somehow required... 53 bw += 2; // extra padding, seems somehow required...
54 resize(theme()->font().textWidth(txtBtn->text()) + 2*bw, 54
55 theme()->font().height() + 2*bw); 55 unsigned int new_width = theme()->font().textWidth(txtBtn->text()) + 2*bw;
56 unsigned int new_height = theme()->font().height() + 2*bw;
57
58 if (orientation() == FbTk::ROT0 || orientation() == FbTk::ROT180) {
59 resize(new_width, new_height);
60 } else {
61 resize(new_height, new_width);
62 }
56 } 63 }
57} 64}
58 65
@@ -93,3 +100,9 @@ void ButtonTool::renderTheme(int alpha) {
93 btn.clear(); 100 btn.clear();
94} 101}
95 102
103void ButtonTool::setOrientation(FbTk::Orientation orient) {
104 FbTk::Button &btn = static_cast<FbTk::Button &>(window());
105 btn.setOrientation(orient);
106 ToolbarItem::setOrientation(orient);
107}
108