aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/TextDialog.cc19
-rw-r--r--src/TooltipWindow.cc9
2 files changed, 17 insertions, 11 deletions
diff --git a/src/TextDialog.cc b/src/TextDialog.cc
index 5e9ce82..dc35dbe 100644
--- a/src/TextDialog.cc
+++ b/src/TextDialog.cc
@@ -44,7 +44,7 @@ TextDialog::TextDialog(BScreen &screen,
44 const string &title) : 44 const string &title) :
45 FbTk::FbWindow(screen.rootWindow().screenNumber(), 0, 0, 200, 1, ExposureMask), 45 FbTk::FbWindow(screen.rootWindow().screenNumber(), 0, 0, 200, 1, ExposureMask),
46 m_textbox(*this, screen.focusedWinFrameTheme()->font(), ""), 46 m_textbox(*this, screen.focusedWinFrameTheme()->font(), ""),
47 m_label(*this, screen.focusedWinFrameTheme()->font(), title), 47 m_label(*this, screen.focusedWinFrameTheme()->iconbarTheme().text().font(), title),
48 m_gc(m_textbox), 48 m_gc(m_textbox),
49 m_screen(screen), 49 m_screen(screen),
50 m_move_x(0), 50 m_move_x(0),
@@ -156,6 +156,7 @@ void TextDialog::init() {
156 // we listen to motion notify too 156 // we listen to motion notify too
157 m_label.setEventMask(m_label.eventMask() | ButtonPressMask | ButtonMotionMask); 157 m_label.setEventMask(m_label.eventMask() | ButtonPressMask | ButtonMotionMask);
158 m_label.setGC(m_screen.focusedWinFrameTheme()->iconbarTheme().text().textGC()); 158 m_label.setGC(m_screen.focusedWinFrameTheme()->iconbarTheme().text().textGC());
159 m_label.setJustify(m_screen.focusedWinFrameTheme()->iconbarTheme().text().justify());
159 m_label.show(); 160 m_label.show();
160 161
161 // setup text box 162 // setup text box
@@ -167,10 +168,14 @@ void TextDialog::init() {
167 m_textbox.show(); 168 m_textbox.show();
168 169
169 // setup this window 170 // setup this window
170 setBorderWidth(1); 171 setBorderWidth(m_screen.focusedWinFrameTheme()->border().width());
171 setBackgroundColor(white); 172 setBorderColor(m_screen.focusedWinFrameTheme()->border().color());
172 // move to center of the screen 173
173 move((m_screen.width() - width())/2, (m_screen.height() - height())/2); 174 // move to center of the current head
175 unsigned int head = m_screen.getCurrHead();
176 move(m_screen.getHeadX(head) + (m_screen.getHeadWidth(head) - width()) / 2,
177 m_screen.getHeadY(head) + (m_screen.getHeadHeight(head) - height()) / 2);
178
174 179
175 updateSizes(); 180 updateSizes();
176 resize(width(), m_textbox.height() + m_label.height()); 181 resize(width(), m_textbox.height() + m_label.height());
@@ -185,6 +190,6 @@ void TextDialog::updateSizes() {
185 m_label.moveResize(0, 0, 190 m_label.moveResize(0, 0,
186 width(), m_textbox.font().height() + 2); 191 width(), m_textbox.font().height() + 2);
187 192
188 m_textbox.moveResize(2, m_label.height(), 193 m_textbox.moveResize(0, m_label.height(),
189 width() - 4, m_textbox.font().height() + 2); 194 width(), m_textbox.font().height() + 2);
190} 195}
diff --git a/src/TooltipWindow.cc b/src/TooltipWindow.cc
index 79d4163..0fb7273 100644
--- a/src/TooltipWindow.cc
+++ b/src/TooltipWindow.cc
@@ -55,8 +55,8 @@ void TooltipWindow::raiseTooltip() {
55 55
56 resize(m_lastText); 56 resize(m_lastText);
57 reconfigTheme(); 57 reconfigTheme();
58 int h = theme()->font().height() + theme()->bevelWidth() * 2; 58 int h = theme()->iconbarTheme().text().font().height() + theme()->bevelWidth() * 2;
59 int w = theme()->font().textWidth(m_lastText) + theme()->bevelWidth() * 2; 59 int w = theme()->iconbarTheme().text().font().textWidth(m_lastText) + theme()->bevelWidth() * 2;
60 60
61 Window root_ret; // not used 61 Window root_ret; // not used
62 Window window_ret; // not used 62 Window window_ret; // not used
@@ -90,11 +90,12 @@ void TooltipWindow::raiseTooltip() {
90 90
91 show(); 91 show();
92 clear(); 92 clear();
93 theme()->font().drawText(*this, screen().screenNumber(), 93 // TODO: make this use a TextButton like TextDialog does
94 theme()->iconbarTheme().text().font().drawText(*this, screen().screenNumber(),
94 theme()->iconbarTheme().text().textGC(), 95 theme()->iconbarTheme().text().textGC(),
95 m_lastText, 96 m_lastText,
96 theme()->bevelWidth(), 97 theme()->bevelWidth(),
97 theme()->bevelWidth() + theme()->font().ascent()); 98 theme()->bevelWidth() + theme()->iconbarTheme().text().font().ascent());
98} 99}
99 100
100void TooltipWindow::updateText(const FbTk::BiDiString& text) { 101void TooltipWindow::updateText(const FbTk::BiDiString& text) {