aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ClockTool.cc19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/ClockTool.cc b/src/ClockTool.cc
index 84ff7b3..57e6505 100644
--- a/src/ClockTool.cc
+++ b/src/ClockTool.cc
@@ -20,7 +20,7 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id: ClockTool.cc,v 1.2 2003/08/11 20:29:30 fluxgen Exp $ 23// $Id: ClockTool.cc,v 1.3 2003/08/13 10:08:18 fluxgen Exp $
24 24
25#include "ClockTool.hh" 25#include "ClockTool.hh"
26 26
@@ -94,8 +94,17 @@ void ClockTool::hide() {
94 94
95void ClockTool::update(FbTk::Subject *subj) { 95void ClockTool::update(FbTk::Subject *subj) {
96 updateTime(); 96 updateTime();
97 // + 3 to make the entire text fit inside 97
98 resize(m_button.textWidth() + 3, m_button.height()); 98 // + 4 to make the entire text fit inside
99 std::string text;
100 for (size_t i=0; i<m_button.text().size() + 4; ++i)
101 text += '0';
102
103 resize(m_theme.font().textWidth(text.c_str(), text.size()), m_button.height());
104}
105
106unsigned int ClockTool::borderWidth() const {
107 return m_button.borderWidth();
99} 108}
100 109
101unsigned int ClockTool::width() const { 110unsigned int ClockTool::width() const {
@@ -136,12 +145,14 @@ void ClockTool::renderTheme() {
136 m_button.setBackgroundColor(m_theme.texture().color()); 145 m_button.setBackgroundColor(m_theme.texture().color());
137 } else { 146 } else {
138 m_pixmap = m_screen.imageControl().renderImage(m_button.width(), m_button.height(), m_theme.texture()); 147 m_pixmap = m_screen.imageControl().renderImage(m_button.width(), m_button.height(), m_theme.texture());
139 m_button.setBackgroundPixmap(m_pixmap); 148 m_button.FbTk::FbWindow::setBackgroundPixmap(m_pixmap);
140 } 149 }
141 150
142 if (old_pm) 151 if (old_pm)
143 m_screen.imageControl().removeImage(old_pm); 152 m_screen.imageControl().removeImage(old_pm);
144 153
145 m_button.setJustify(m_theme.justify()); 154 m_button.setJustify(m_theme.justify());
155 m_button.setBorderWidth(m_theme.border().width());
156 m_button.setBorderColor(m_theme.border().color());
146 m_button.clear(); 157 m_button.clear();
147} 158}