From 230e3d909340a3fb501ab1e67ae95a86eb58e2aa Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 20 Oct 2012 01:15:01 +0300 Subject: Add palette inheritance to shortcutcontainer class. --- src/gui/shortcutwindow.cpp | 2 ++ src/gui/widgets/widget2.h | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/shortcutwindow.cpp b/src/gui/shortcutwindow.cpp index 8f4374cba..3003392ca 100644 --- a/src/gui/shortcutwindow.cpp +++ b/src/gui/shortcutwindow.cpp @@ -74,6 +74,7 @@ ShortcutWindow::ShortcutWindow(const std::string &title, mDragOffsetX = 0; mDragOffsetY = 0; + content->setWidget2(this); setupWindow->registerWindowForReset(this); const int border = SCROLL_PADDING * 2 + getPadding() * 2; @@ -156,6 +157,7 @@ void ShortcutWindow::addTab(std::string name, ShortcutContainer *const content) ScrollArea *const scroll = new ScrollArea(content, false); scroll->setPosition(SCROLL_PADDING, SCROLL_PADDING); scroll->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER); + content->setWidget2(this); Tab *const tab = new ShortcutTab(this, name, content); mTabs->addTab(tab, scroll); } diff --git a/src/gui/widgets/widget2.h b/src/gui/widgets/widget2.h index 8a602be63..02107b3c1 100644 --- a/src/gui/widgets/widget2.h +++ b/src/gui/widgets/widget2.h @@ -56,10 +56,9 @@ class Widget2 return Palette::BLACK; } - void setPalette(int p) + void setWidget2(const Widget2 *const widget) { - if (p >= 1 && p <= THEME_PALETTES) - mPalette = p; + mPalette = widget ? widget->mPalette : 1; } private: -- cgit v1.2.3-70-g09d2