aboutsummaryrefslogtreecommitdiff
path: root/src/TextDialog.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/TextDialog.cc')
-rw-r--r--src/TextDialog.cc19
1 files changed, 12 insertions, 7 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}