From 8c67f63d44c018660e3dd0b9b64a8b8fdf1aec17 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Thu, 20 Feb 2003 23:21:23 +0000 Subject: fixed bug in titlebar toggle --- src/FbWinFrame.cc | 36 ++++++++++++++++++++++++++++++------ 1 file 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 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbWinFrame.cc,v 1.9 2003/02/18 21:41:09 fluxgen Exp $ +// $Id: FbWinFrame.cc,v 1.10 2003/02/20 23:21:23 fluxgen Exp $ #include "FbWinFrame.hh" #include "ImageControl.hh" @@ -134,6 +134,9 @@ void FbWinFrame::show() { Toggle shade state, and resize window */ void FbWinFrame::shade() { + if (!m_use_titlebar) + return; + if (!m_shaded) { m_width_before_shade = m_window.width(); m_height_before_shade = m_window.height(); @@ -168,12 +171,13 @@ void FbWinFrame::resize(unsigned int width, unsigned int height) { void FbWinFrame::resizeForClient(unsigned int width, unsigned int height) { // total height for frame without client - unsigned int total_height = m_handle.height() + m_titlebar.height(); + unsigned int total_height = m_handle.height() + m_handle.borderWidth() + + m_titlebar.height() + m_titlebar.borderWidth(); // resize frame height with total height + specified height if (!m_use_titlebar) - total_height -= m_titlebar.height(); + total_height -= m_titlebar.height() + m_titlebar.borderWidth(); if (!m_use_handle) - total_height -= m_handle.height(); + total_height -= m_handle.height() + m_handle.borderWidth(); resize(width, total_height + height); } @@ -269,13 +273,27 @@ void FbWinFrame::removeClient() { } void FbWinFrame::hideTitlebar() { + if (!m_use_titlebar) + return; + m_titlebar.hide(); m_use_titlebar = false; + m_clientarea.raise(); + m_window.resize(m_window.width(), m_window.height() - m_titlebar.height()); +#ifdef DEBUG + cerr<<__FILE__<<": Hide Titlebar"<