aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/TextButton.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk/TextButton.cc')
-rw-r--r--src/FbTk/TextButton.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/FbTk/TextButton.cc b/src/FbTk/TextButton.cc
index 794acd5..30cc62a 100644
--- a/src/FbTk/TextButton.cc
+++ b/src/FbTk/TextButton.cc
@@ -29,8 +29,8 @@ using namespace std;
29 29
30namespace FbTk { 30namespace FbTk {
31 31
32TextButton::TextButton(const FbTk::FbWindow &parent, 32TextButton::TextButton(const FbTk::FbWindow &parent,
33 const FbTk::Font &font, 33 const FbTk::Font &font,
34 const std::string &text): 34 const std::string &text):
35 FbTk::Button(parent, 0, 0, 10, 10), 35 FbTk::Button(parent, 0, 0, 10, 10),
36 m_font(&font), 36 m_font(&font),
@@ -53,7 +53,7 @@ void TextButton::resize(unsigned int width, unsigned int height) {
53void TextButton::moveResize(int x, int y, 53void TextButton::moveResize(int x, int y,
54 unsigned int width, unsigned int height) { 54 unsigned int width, unsigned int height) {
55 m_buffer.resize(width, height); 55 m_buffer.resize(width, height);
56 56
57 if (backgroundPixmap() != ParentRelative) 57 if (backgroundPixmap() != ParentRelative)
58 FbWindow::setBackgroundPixmap(m_buffer.drawable()); 58 FbWindow::setBackgroundPixmap(m_buffer.drawable());
59 Button::moveResize(x, y, width, height); 59 Button::moveResize(x, y, width, height);
@@ -94,7 +94,7 @@ void TextButton::setTextPadding(unsigned int padding) {
94 setTextPaddingRight(padding/2); 94 setTextPaddingRight(padding/2);
95} 95}
96 96
97/// clear window and redraw text 97/// clear window and redraw text
98void TextButton::clear() { 98void TextButton::clear() {
99 TextButton::clearArea(0, 0, 99 TextButton::clearArea(0, 0,
100 width(), height()); 100 width(), height());
@@ -113,12 +113,12 @@ void TextButton::clearArea(int x, int y,
113 width, height); 113 width, height);
114 114
115 } else { // fill with background color 115 } else { // fill with background color
116 FbTk::GContext gc(m_buffer); 116 FbTk::GContext gc(m_buffer);
117 gc.setForeground(backgroundColor()); 117 gc.setForeground(backgroundColor());
118 m_buffer.fillRectangle(gc.gc(), 118 m_buffer.fillRectangle(gc.gc(),
119 x, y, 119 x, y,
120 width, height); 120 width, height);
121 121
122 } 122 }
123 123
124 drawText(); 124 drawText();
@@ -128,14 +128,14 @@ void TextButton::clearArea(int x, int y,
128 updateTransparent(x, y, width, height); 128 updateTransparent(x, y, width, height);
129 129
130 FbWindow::clearArea(x, y, width, height, exposure); 130 FbWindow::clearArea(x, y, width, height, exposure);
131 131
132 } else { // parent relative 132 } else { // parent relative
133 FbWindow::setBufferPixmap(0); 133 FbWindow::setBufferPixmap(0);
134 FbWindow::setBackgroundPixmap(backgroundPixmap()); 134 FbWindow::setBackgroundPixmap(backgroundPixmap());
135 Button::clearArea(x, y, width, height, exposure); 135 Button::clearArea(x, y, width, height, exposure);
136 updateTransparent(x, y, width, height); 136 updateTransparent(x, y, width, height);
137 drawText(); 137 drawText();
138 } 138 }
139} 139}
140 140
141unsigned int TextButton::textWidth() const { 141unsigned int TextButton::textWidth() const {