From c1eb6af06cb3453eea7a5242bc603af716c58990 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 7 Jul 2013 14:42:58 +0300 Subject: extent tab to follow different resize policy. --- src/gui/chatwindow.cpp | 1 + src/gui/widgets/tabbedarea.cpp | 15 ++++++++++++--- src/gui/widgets/tabbedarea.h | 4 ++++ 3 files changed, 17 insertions(+), 3 deletions(-) (limited to 'src/gui') diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp index 078164518..fe6194b23 100644 --- a/src/gui/chatwindow.cpp +++ b/src/gui/chatwindow.cpp @@ -253,6 +253,7 @@ ChatWindow::ChatWindow(): mChatTabs->enableScrollButtons(true); mChatTabs->setFollowDownScroll(true); + mChatTabs->setResizeHeight(false); mChatInput->setActionEventId("chatinput"); mChatInput->addActionListener(this); diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp index de88a3e50..3a9ded199 100644 --- a/src/gui/widgets/tabbedarea.cpp +++ b/src/gui/widgets/tabbedarea.cpp @@ -51,7 +51,8 @@ TabbedArea::TabbedArea(const Widget2 *const widget) : mEnableScrollButtons(false), mRightMargin(0), mFollowDownScroll(false), - mBlockSwitching(true) + mBlockSwitching(true), + mResizeHeight(true) { setFocusable(true); addKeyListener(this); @@ -478,8 +479,16 @@ void TabbedArea::adjustSize() const int frame2 = 2 * wFrameSize; w->setPosition(wFrameSize, wFrameSize); - w->setSize(mWidgetContainer->getWidth() - frame2, - mWidgetContainer->getHeight() - frame2); + if (mResizeHeight) + { + w->setSize(mWidgetContainer->getWidth() - frame2, + mWidgetContainer->getHeight() - frame2); + } + else + { + w->setSize(mWidgetContainer->getWidth() - frame2, + w->getHeight()); + } } } diff --git a/src/gui/widgets/tabbedarea.h b/src/gui/widgets/tabbedarea.h index 3301ad2a8..114d549ff 100644 --- a/src/gui/widgets/tabbedarea.h +++ b/src/gui/widgets/tabbedarea.h @@ -182,6 +182,9 @@ class TabbedArea final : public Widget2, void death(const gcn::Event &event); + void setResizeHeight(bool b) + { mResizeHeight = b; } + private: typedef std::vector > TabContainer; @@ -237,6 +240,7 @@ class TabbedArea final : public Widget2, int mRightMargin; bool mFollowDownScroll; bool mBlockSwitching; + bool mResizeHeight; }; #endif // GUI_WIDGETS_TABBEDAREA_H -- cgit v1.2.3-70-g09d2