diff options
author | fluxgen <fluxgen> | 2003-02-20 23:21:23 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2003-02-20 23:21:23 (GMT) |
commit | 8c67f63d44c018660e3dd0b9b64a8b8fdf1aec17 (patch) | |
tree | dfb30c88d317ec5c7739836f7f44d715f84430e1 | |
parent | 6e1f30c308dd2ad7f1794fa3f6ecfc4be7997152 (diff) | |
download | fluxbox_paul-8c67f63d44c018660e3dd0b9b64a8b8fdf1aec17.zip fluxbox_paul-8c67f63d44c018660e3dd0b9b64a8b8fdf1aec17.tar.bz2 |
fixed bug in titlebar toggle
-rw-r--r-- | src/FbWinFrame.cc | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc index e9a3312..67b5fe4 100644 --- a/src/FbWinFrame.cc +++ b/src/FbWinFrame.cc | |||
@@ -19,7 +19,7 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: FbWinFrame.cc,v 1.9 2003/02/18 21:41:09 fluxgen Exp $ | 22 | // $Id: FbWinFrame.cc,v 1.10 2003/02/20 23:21:23 fluxgen Exp $ |
23 | 23 | ||
24 | #include "FbWinFrame.hh" | 24 | #include "FbWinFrame.hh" |
25 | #include "ImageControl.hh" | 25 | #include "ImageControl.hh" |
@@ -134,6 +134,9 @@ void FbWinFrame::show() { | |||
134 | Toggle shade state, and resize window | 134 | Toggle shade state, and resize window |
135 | */ | 135 | */ |
136 | void FbWinFrame::shade() { | 136 | void FbWinFrame::shade() { |
137 | if (!m_use_titlebar) | ||
138 | return; | ||
139 | |||
137 | if (!m_shaded) { | 140 | if (!m_shaded) { |
138 | m_width_before_shade = m_window.width(); | 141 | m_width_before_shade = m_window.width(); |
139 | m_height_before_shade = m_window.height(); | 142 | m_height_before_shade = m_window.height(); |
@@ -168,12 +171,13 @@ void FbWinFrame::resize(unsigned int width, unsigned int height) { | |||
168 | 171 | ||
169 | void FbWinFrame::resizeForClient(unsigned int width, unsigned int height) { | 172 | void FbWinFrame::resizeForClient(unsigned int width, unsigned int height) { |
170 | // total height for frame without client | 173 | // total height for frame without client |
171 | unsigned int total_height = m_handle.height() + m_titlebar.height(); | 174 | unsigned int total_height = m_handle.height() + m_handle.borderWidth() + |
175 | m_titlebar.height() + m_titlebar.borderWidth(); | ||
172 | // resize frame height with total height + specified height | 176 | // resize frame height with total height + specified height |
173 | if (!m_use_titlebar) | 177 | if (!m_use_titlebar) |
174 | total_height -= m_titlebar.height(); | 178 | total_height -= m_titlebar.height() + m_titlebar.borderWidth(); |
175 | if (!m_use_handle) | 179 | if (!m_use_handle) |
176 | total_height -= m_handle.height(); | 180 | total_height -= m_handle.height() + m_handle.borderWidth(); |
177 | resize(width, total_height + height); | 181 | resize(width, total_height + height); |
178 | } | 182 | } |
179 | 183 | ||
@@ -269,13 +273,27 @@ void FbWinFrame::removeClient() { | |||
269 | } | 273 | } |
270 | 274 | ||
271 | void FbWinFrame::hideTitlebar() { | 275 | void FbWinFrame::hideTitlebar() { |
276 | if (!m_use_titlebar) | ||
277 | return; | ||
278 | |||
272 | m_titlebar.hide(); | 279 | m_titlebar.hide(); |
273 | m_use_titlebar = false; | 280 | m_use_titlebar = false; |
281 | m_clientarea.raise(); | ||
282 | m_window.resize(m_window.width(), m_window.height() - m_titlebar.height()); | ||
283 | #ifdef DEBUG | ||
284 | cerr<<__FILE__<<": Hide Titlebar"<<endl; | ||
285 | #endif // DEBUG | ||
274 | } | 286 | } |
275 | 287 | ||
276 | void FbWinFrame::showTitlebar() { | 288 | void FbWinFrame::showTitlebar() { |
289 | if (m_use_titlebar) | ||
290 | return; | ||
291 | |||
277 | m_titlebar.show(); | 292 | m_titlebar.show(); |
278 | m_use_titlebar = true; | 293 | m_use_titlebar = true; |
294 | #ifdef DEBUG | ||
295 | cerr<<__FILE__<<": Show Titlebar"<<endl; | ||
296 | #endif // DEBUG | ||
279 | } | 297 | } |
280 | 298 | ||
281 | void FbWinFrame::hideHandle() { | 299 | void FbWinFrame::hideHandle() { |
@@ -392,12 +410,13 @@ void FbWinFrame::reconfigure() { | |||
392 | // align titlebar and render it | 410 | // align titlebar and render it |
393 | if (m_use_titlebar) | 411 | if (m_use_titlebar) |
394 | reconfigureTitlebar(); | 412 | reconfigureTitlebar(); |
413 | |||
395 | // setup client area size/pos | 414 | // setup client area size/pos |
396 | int next_y = m_titlebar.height() + 2*m_titlebar.borderWidth(); | 415 | int next_y = m_titlebar.height() + 2*m_titlebar.borderWidth(); |
397 | unsigned int client_height = m_window.height() - m_titlebar.height() - m_handle.height(); | 416 | unsigned int client_height = m_window.height() - m_titlebar.height() - m_handle.height(); |
398 | 417 | ||
399 | if (!m_use_titlebar) { | 418 | if (!m_use_titlebar) { |
400 | next_y = 0; | 419 | next_y = -m_titlebar.y(); |
401 | if (!m_use_handle) | 420 | if (!m_use_handle) |
402 | client_height = m_window.height(); | 421 | client_height = m_window.height(); |
403 | else | 422 | else |
@@ -475,6 +494,8 @@ void FbWinFrame::redrawTitle() { | |||
475 | } | 494 | } |
476 | 495 | ||
477 | void FbWinFrame::redrawTitlebar() { | 496 | void FbWinFrame::redrawTitlebar() { |
497 | if (!m_use_titlebar) | ||
498 | return; | ||
478 | m_titlebar.clear(); | 499 | m_titlebar.clear(); |
479 | m_label.clear(); | 500 | m_label.clear(); |
480 | redrawTitle(); | 501 | redrawTitle(); |
@@ -484,6 +505,9 @@ void FbWinFrame::redrawTitlebar() { | |||
484 | Align buttons with title text window | 505 | Align buttons with title text window |
485 | */ | 506 | */ |
486 | void FbWinFrame::reconfigureTitlebar() { | 507 | void FbWinFrame::reconfigureTitlebar() { |
508 | if (!m_use_titlebar) | ||
509 | return; | ||
510 | |||
487 | // resize titlebar to window size with font height | 511 | // resize titlebar to window size with font height |
488 | m_titlebar.moveResize(-m_titlebar.borderWidth(), -m_titlebar.borderWidth(), | 512 | m_titlebar.moveResize(-m_titlebar.borderWidth(), -m_titlebar.borderWidth(), |
489 | m_window.width(), | 513 | m_window.width(), |