aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-02-22 18:31:00 (GMT)
committerfluxgen <fluxgen>2003-02-22 18:31:00 (GMT)
commit6cafb55bb99c5f8c192bd01d61947a3cc82c0690 (patch)
tree8ad5e64e6a06addc98f8cfc2b476294be40f72c4
parentf3879a838724360b81ec8d0f2d9ca07ca88300ce (diff)
downloadfluxbox-6cafb55bb99c5f8c192bd01d61947a3cc82c0690.zip
fluxbox-6cafb55bb99c5f8c192bd01d61947a3cc82c0690.tar.bz2
fixed minor resize bug
-rw-r--r--src/FbWinFrame.cc29
1 files changed, 18 insertions, 11 deletions
diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc
index 67b5fe4..bef8f9f 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.10 2003/02/20 23:21:23 fluxgen Exp $ 22// $Id: FbWinFrame.cc,v 1.11 2003/02/22 18:31:00 fluxgen Exp $
23 23
24#include "FbWinFrame.hh" 24#include "FbWinFrame.hh"
25#include "ImageControl.hh" 25#include "ImageControl.hh"
@@ -171,13 +171,14 @@ void FbWinFrame::resize(unsigned int width, unsigned int height) {
171 171
172void FbWinFrame::resizeForClient(unsigned int width, unsigned int height) { 172void FbWinFrame::resizeForClient(unsigned int width, unsigned int height) {
173 // total height for frame without client 173 // total height for frame without client
174 unsigned int total_height = m_handle.height() + m_handle.borderWidth() + 174 int handle_height = m_handle.height() + m_handle.borderWidth();
175 m_titlebar.height() + m_titlebar.borderWidth(); 175 int titlebar_height = m_titlebar.height() + m_titlebar.borderWidth();
176 unsigned int total_height = handle_height + titlebar_height;
176 // resize frame height with total height + specified height 177 // resize frame height with total height + specified height
177 if (!m_use_titlebar) 178 if (!m_use_titlebar)
178 total_height -= m_titlebar.height() + m_titlebar.borderWidth(); 179 total_height -= titlebar_height;
179 if (!m_use_handle) 180 if (!m_use_handle)
180 total_height -= m_handle.height() + m_handle.borderWidth(); 181 total_height -= handle_height;
181 resize(width, total_height + height); 182 resize(width, total_height + height);
182} 183}
183 184
@@ -279,7 +280,8 @@ void FbWinFrame::hideTitlebar() {
279 m_titlebar.hide(); 280 m_titlebar.hide();
280 m_use_titlebar = false; 281 m_use_titlebar = false;
281 m_clientarea.raise(); 282 m_clientarea.raise();
282 m_window.resize(m_window.width(), m_window.height() - m_titlebar.height()); 283 m_window.resize(m_window.width(), m_window.height() - m_titlebar.height() -
284 m_titlebar.borderWidth()*2);
283#ifdef DEBUG 285#ifdef DEBUG
284 cerr<<__FILE__<<": Hide Titlebar"<<endl; 286 cerr<<__FILE__<<": Hide Titlebar"<<endl;
285#endif // DEBUG 287#endif // DEBUG
@@ -313,7 +315,8 @@ void FbWinFrame::showHandle() {
313void FbWinFrame::hideAllDecorations() { 315void FbWinFrame::hideAllDecorations() {
314 hideHandle(); 316 hideHandle();
315 hideTitlebar(); 317 hideTitlebar();
316 resizeForClient(m_clientarea.width(), m_clientarea.height() - m_window.borderWidth()); 318 m_window.setBorderWidth(0);
319 m_window.resize(m_clientarea.width(), m_clientarea.height());
317 reconfigure(); 320 reconfigure();
318} 321}
319 322
@@ -322,7 +325,8 @@ void FbWinFrame::showAllDecorations() {
322 showHandle(); 325 showHandle();
323 if (!m_use_titlebar) 326 if (!m_use_titlebar)
324 showTitlebar(); 327 showTitlebar();
325 resizeForClient(m_clientarea.width(), m_clientarea.height() - m_window.borderWidth()); 328 resizeForClient(m_clientarea.width(), m_clientarea.height());
329 reconfigure();
326} 330}
327 331
328/** 332/**
@@ -412,8 +416,10 @@ void FbWinFrame::reconfigure() {
412 reconfigureTitlebar(); 416 reconfigureTitlebar();
413 417
414 // setup client area size/pos 418 // setup client area size/pos
415 int next_y = m_titlebar.height() + 2*m_titlebar.borderWidth(); 419 int next_y = m_titlebar.height() + m_titlebar.borderWidth();
416 unsigned int client_height = m_window.height() - m_titlebar.height() - m_handle.height(); 420 unsigned int client_height =
421 m_window.height() - next_y;
422 /*- m_titlebar.height() - m_titlebar.y() - m_handle.height();*/
417 423
418 if (!m_use_titlebar) { 424 if (!m_use_titlebar) {
419 next_y = -m_titlebar.y(); 425 next_y = -m_titlebar.y();
@@ -511,7 +517,8 @@ void FbWinFrame::reconfigureTitlebar() {
511 // resize titlebar to window size with font height 517 // resize titlebar to window size with font height
512 m_titlebar.moveResize(-m_titlebar.borderWidth(), -m_titlebar.borderWidth(), 518 m_titlebar.moveResize(-m_titlebar.borderWidth(), -m_titlebar.borderWidth(),
513 m_window.width(), 519 m_window.width(),
514 m_theme.font().height() == 0 ? 16 : m_theme.font().height() + m_bevel*2 + 2); 520 m_theme.font().height() == 0 ? 16 :
521 m_theme.font().height() + m_bevel*2 + 2);
515 522
516 // draw left buttons first 523 // draw left buttons first
517 unsigned int next_x = m_bevel; 524 unsigned int next_x = m_bevel;