summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-07-28 02:12:32 +0300
committerAndrei Karas <akaras@inbox.ru>2012-07-28 02:12:32 +0300
commit7898fc26ca13913637bd84008df016763358d082 (patch)
tree13ffeeab17bebd8e79391bfc75cc3cd38d068cdc /src/gui/widgets
parentf60d54307c20d4150e630620dbe0be62b2a1b8a5 (diff)
downloadplus-7898fc26ca13913637bd84008df016763358d082.tar.gz
plus-7898fc26ca13913637bd84008df016763358d082.tar.bz2
plus-7898fc26ca13913637bd84008df016763358d082.tar.xz
plus-7898fc26ca13913637bd84008df016763358d082.zip
Simplify scrollarea opaque flag.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/chattab.cpp3
-rw-r--r--src/gui/widgets/scrollarea.cpp11
-rw-r--r--src/gui/widgets/scrollarea.h4
-rw-r--r--src/gui/widgets/setuptabscroll.cpp3
4 files changed, 9 insertions, 12 deletions
diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp
index f67b75107..1dd4e1fc8 100644
--- a/src/gui/widgets/chattab.cpp
+++ b/src/gui/widgets/chattab.cpp
@@ -55,7 +55,7 @@
ChatTab::ChatTab(const std::string &name) :
Tab(),
mTextOutput(new BrowserBox(BrowserBox::AUTO_WRAP)),
- mScrollArea(new ScrollArea(mTextOutput)),
+ mScrollArea(new ScrollArea(mTextOutput, false)),
mAllowHightlight(true),
mRemoveNames(false),
mNoAway(false)
@@ -71,7 +71,6 @@ ChatTab::ChatTab(const std::string &name) :
mScrollArea->setScrollPolicy(gcn::ScrollArea::SHOW_NEVER,
gcn::ScrollArea::SHOW_ALWAYS);
mScrollArea->setScrollAmount(0, 1);
- mScrollArea->setOpaque(false);
if (chatWindow)
chatWindow->addTab(this);
diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp
index 3635e5f4f..214874f69 100644
--- a/src/gui/widgets/scrollarea.cpp
+++ b/src/gui/widgets/scrollarea.cpp
@@ -49,14 +49,14 @@ static std::string const buttonFiles[2] =
"scrollbuttons_pressed.xml"
};
-ScrollArea::ScrollArea():
+ScrollArea::ScrollArea(bool opaque):
gcn::ScrollArea(),
mX(0),
mY(0),
mClickX(0),
mClickY(0),
mHasMouse(false),
- mOpaque(true),
+ mOpaque(opaque),
mVertexes(new GraphicsVertexes()),
mRedraw(true),
mXOffset(0),
@@ -68,14 +68,14 @@ ScrollArea::ScrollArea():
init();
}
-ScrollArea::ScrollArea(gcn::Widget *widget):
+ScrollArea::ScrollArea(gcn::Widget *widget, bool opaque):
gcn::ScrollArea(widget),
mX(0),
mY(0),
mClickX(0),
mClickY(0),
mHasMouse(false),
- mOpaque(true),
+ mOpaque(opaque),
mVertexes(new GraphicsVertexes()),
mRedraw(true),
mXOffset(0),
@@ -114,8 +114,7 @@ ScrollArea::~ScrollArea()
void ScrollArea::init()
{
- // Draw background by default
- setOpaque(true);
+ setOpaque(mOpaque);
setUpButtonScrollAmount(2);
setDownButtonScrollAmount(2);
diff --git a/src/gui/widgets/scrollarea.h b/src/gui/widgets/scrollarea.h
index 53a79d20f..335d810b2 100644
--- a/src/gui/widgets/scrollarea.h
+++ b/src/gui/widgets/scrollarea.h
@@ -46,14 +46,14 @@ class ScrollArea : public gcn::ScrollArea, public gcn::WidgetListener
* Constructor that takes no content. Needed for use with the DropDown
* class.
*/
- ScrollArea();
+ ScrollArea(bool opaque = true);
/**
* Constructor.
*
* @param content the initial content to show in the scroll area
*/
- ScrollArea(gcn::Widget *content);
+ ScrollArea(gcn::Widget *content, bool opaque = true);
/**
* Destructor. Also deletes the content.
diff --git a/src/gui/widgets/setuptabscroll.cpp b/src/gui/widgets/setuptabscroll.cpp
index d7ff749d2..6bf627cdd 100644
--- a/src/gui/widgets/setuptabscroll.cpp
+++ b/src/gui/widgets/setuptabscroll.cpp
@@ -30,10 +30,9 @@
SetupTabScroll::SetupTabScroll() :
SetupTab(),
mContainer(new VertContainer(25, false, 8)),
- mScroll(new ScrollArea(mContainer)),
+ mScroll(new ScrollArea(mContainer, false)),
mPreferredFirstItemSize(200)
{
- mScroll->setOpaque(false);
mScroll->setHorizontalScrollPolicy(ScrollArea::SHOW_NEVER);
mScroll->setVerticalScrollPolicy(ScrollArea::SHOW_AUTO);
}