From bb1a7c92d8bb194e7e415f4348b7428f1b8ef436 Mon Sep 17 00:00:00 2001 From: rathnor Date: Thu, 2 Oct 2003 14:14:46 +0000 Subject: fix rendering of grips for parent relative textures - make them children of the handle --- ChangeLog | 3 +++ src/FbWinFrame.cc | 44 +++++++++++++++++++++++--------------------- src/FbWinFrame.hh | 4 ++-- 3 files changed, 28 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index 69b8c94..cacb377 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@ (Format: Year/Month/Day) Changes for 0.9.6: *03/10/02: + * Make grips children of handle (Simon) + - Fixes parentrelative grip texture + FbWinFrame.hh/cc * Fix updating of window on focus change (Simon) FbWinFrame.cc *03/09/29: diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc index 77e94ec..ce92813 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.55 2003/10/02 13:09:24 rathnor Exp $ +// $Id: FbWinFrame.cc,v 1.56 2003/10/02 14:14:45 rathnor Exp $ #include "FbWinFrame.hh" @@ -57,18 +57,18 @@ FbWinFrame::FbWinFrame(FbWinFrameTheme &theme, FbTk::ImageControl &imgctrl, ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | ExposureMask | EnterWindowMask | LeaveWindowMask), - m_grip_right(m_window, 0, 0, 10, 4, + m_handle(m_window, 0, 0, 100, 5, + ButtonPressMask | ButtonReleaseMask | + ButtonMotionMask | ExposureMask | + EnterWindowMask | LeaveWindowMask), + m_grip_right(m_handle, 0, 0, 10, 4, ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | ExposureMask | EnterWindowMask | LeaveWindowMask), - m_grip_left(m_window, 0, 0, 10, 4, + m_grip_left(m_handle, 0, 0, 10, 4, ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | ExposureMask | EnterWindowMask | LeaveWindowMask), - m_handle(m_window, 0, 0, 100, 5, - ButtonPressMask | ButtonReleaseMask | - ButtonMotionMask | ExposureMask | - EnterWindowMask | LeaveWindowMask), m_clientarea(m_window, 0, 0, 100, 100, ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | ExposureMask | @@ -432,9 +432,10 @@ void FbWinFrame::hideHandle() { void FbWinFrame::showHandle() { if (m_use_handle) return; + m_handle.show(); - m_grip_left.show(); - m_grip_right.show(); + m_handle.showSubwindows(); // shows grips + m_use_handle = true; m_window.resize(m_window.width(), m_window.height() + m_handle.height() + m_handle.borderWidth()); @@ -640,17 +641,16 @@ void FbWinFrame::reconfigure() { // align handle and grips const int grip_height = m_handle.height(); const int grip_width = 20; //TODO - + const int handle_bw = static_cast(m_handle.borderWidth()); + const int ypos = m_window.height() - grip_height - m_handle.borderWidth(); + m_handle.moveResize(-handle_bw, ypos, + m_window.width(), grip_height); - m_grip_left.moveResize(-m_handle.borderWidth(), ypos, + m_grip_left.moveResize(-handle_bw, -handle_bw, grip_width, grip_height); - - m_handle.moveResize(grip_width, ypos, - m_window.width() - grip_width*2 - m_handle.borderWidth()*2, - grip_height); - - m_grip_right.moveResize(m_window.width() - grip_width - m_handle.borderWidth(), ypos, + + m_grip_right.moveResize(m_handle.width() - grip_width - handle_bw, -handle_bw, grip_width, grip_height); } } @@ -881,6 +881,10 @@ void FbWinFrame::renderHandles() { } } + m_handle.setAlpha(theme().alpha()); + m_handle.clear(); + m_handle.updateTransparent(); + m_grip_left.setAlpha(theme().alpha()); m_grip_left.clear(); m_grip_left.updateTransparent(); @@ -889,10 +893,6 @@ void FbWinFrame::renderHandles() { m_grip_right.clear(); m_grip_right.updateTransparent(); - m_handle.setAlpha(theme().alpha()); - m_handle.clear(); - m_handle.updateTransparent(); - } void FbWinFrame::renderButtons() { @@ -940,6 +940,8 @@ void FbWinFrame::init() { m_current_label = 0; // no focused button at first + m_handle.showSubwindows(); + // clear pixmaps m_title_focused_pm = m_title_unfocused_pm = 0; m_label_focused_pm = m_label_unfocused_pm = 0; diff --git a/src/FbWinFrame.hh b/src/FbWinFrame.hh index f57ce32..6d218d4 100644 --- a/src/FbWinFrame.hh +++ b/src/FbWinFrame.hh @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbWinFrame.hh,v 1.21 2003/09/24 14:02:25 rathnor Exp $ +// $Id: FbWinFrame.hh,v 1.22 2003/10/02 14:14:46 rathnor Exp $ #ifndef FBWINFRAME_HH #define FBWINFRAME_HH @@ -224,9 +224,9 @@ private: FbTk::FbWindow m_window; ///< base window that holds each decorations (ie titlebar, handles) FbTk::FbWindow m_titlebar; ///< titlebar window FbTk::FbWindow m_label; ///< holds title + FbTk::FbWindow m_handle; ///< handle between grips FbTk::FbWindow m_grip_right, ///< rightgrip m_grip_left; ///< left grip - FbTk::FbWindow m_handle; ///< handle between grips FbTk::FbWindow m_clientarea; ///< window that holds client window @see setClientWindow //@} typedef std::vector ButtonList; -- cgit v0.11.2