diff options
author | Bastien Bouclet | 2018-11-14 20:16:34 +0100 |
---|---|---|
committer | Bastien Bouclet | 2018-11-14 20:27:41 +0100 |
commit | 7c570d9b253206e906fc9cc38c20083e043a0ed8 (patch) | |
tree | f0beafb4f44d3aaa941ba9f718e67bc8370115b9 | |
parent | 91c463184d9a2ed429baae343039f28c9671d523 (diff) | |
download | scummvm-rg350-7c570d9b253206e906fc9cc38c20083e043a0ed8.tar.gz scummvm-rg350-7c570d9b253206e906fc9cc38c20083e043a0ed8.tar.bz2 scummvm-rg350-7c570d9b253206e906fc9cc38c20083e043a0ed8.zip |
GUI: Don't display the ScrollContainer background inside tabs
Fixes #10645.
-rw-r--r-- | gui/editgamedialog.cpp | 1 | ||||
-rw-r--r-- | gui/options.cpp | 2 | ||||
-rw-r--r-- | gui/widgets/scrollcontainer.cpp | 8 | ||||
-rw-r--r-- | gui/widgets/scrollcontainer.h | 4 |
4 files changed, 13 insertions, 2 deletions
diff --git a/gui/editgamedialog.cpp b/gui/editgamedialog.cpp index 6c443998be..ac030d7678 100644 --- a/gui/editgamedialog.cpp +++ b/gui/editgamedialog.cpp @@ -187,6 +187,7 @@ EditGameDialog::EditGameDialog(const String &domain) // _graphicsTabId = tab->addTab(g_system->getOverlayWidth() > 320 ? _("Graphics") : _("GFX")); ScrollContainerWidget *graphicsContainer = new ScrollContainerWidget(tab, "GameOptions_Graphics.Container", kGraphicsTabContainerReflowCmd); + graphicsContainer->setBackgroundType(ThemeEngine::kDialogBackgroundNone); graphicsContainer->setTarget(this); if (g_system->getOverlayWidth() > 320) diff --git a/gui/options.cpp b/gui/options.cpp index 7c1a576c57..1bfe386ca4 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -1523,6 +1523,7 @@ void GlobalOptionsDialog::build() { _graphicsTabId = tab->addTab(g_system->getOverlayWidth() > 320 ? _("Graphics") : _("GFX")); ScrollContainerWidget *graphicsContainer = new ScrollContainerWidget(tab, "GlobalOptions_Graphics.Container", kGraphicsTabContainerReflowCmd); graphicsContainer->setTarget(this); + graphicsContainer->setBackgroundType(ThemeEngine::kDialogBackgroundNone); addGraphicControls(graphicsContainer, "GlobalOptions_Graphics_Container."); // @@ -1718,6 +1719,7 @@ void GlobalOptionsDialog::build() { ScrollContainerWidget *container = new ScrollContainerWidget(tab, "GlobalOptions_Cloud.Container", kCloudTabContainerReflowCmd); container->setTarget(this); + container->setBackgroundType(ThemeEngine::kDialogBackgroundNone); _storagePopUpDesc = new StaticTextWidget(container, "GlobalOptions_Cloud_Container.StoragePopupDesc", _("Storage:"), _("Active cloud storage")); _storagePopUp = new PopUpWidget(container, "GlobalOptions_Cloud_Container.StoragePopup"); diff --git a/gui/widgets/scrollcontainer.cpp b/gui/widgets/scrollcontainer.cpp index 6578d26feb..7e3f50d3bb 100644 --- a/gui/widgets/scrollcontainer.cpp +++ b/gui/widgets/scrollcontainer.cpp @@ -41,6 +41,7 @@ ScrollContainerWidget::ScrollContainerWidget(GuiObject *boss, const Common::Stri void ScrollContainerWidget::init() { setFlags(WIDGET_ENABLED); _type = kScrollContainerWidget; + _backgroundType = ThemeEngine::kDialogBackgroundDefault; _verticalScroll = new ScrollBarWidget(this, _w-16, 0, 16, _h); _verticalScroll->setTarget(this); _scrolledX = 0; @@ -145,8 +146,7 @@ void ScrollContainerWidget::reflowLayout() { } void ScrollContainerWidget::drawWidget() { - g_gui.theme()->drawDialogBackground(Common::Rect(_x, _y, _x + _w, _y + getHeight() - 1), - ThemeEngine::kDialogBackgroundDefault); + g_gui.theme()->drawDialogBackground(Common::Rect(_x, _y, _x + _w, _y + getHeight() - 1), _backgroundType); } bool ScrollContainerWidget::containsWidget(Widget *w) const { @@ -169,4 +169,8 @@ Common::Rect ScrollContainerWidget::getClipRect() const { return Common::Rect(getAbsX(), getAbsY(), getAbsX() + _w, getAbsY() + getHeight()); } +void ScrollContainerWidget::setBackgroundType(ThemeEngine::DialogBackground backgroundType) { + _backgroundType = backgroundType; +} + } // End of namespace GUI diff --git a/gui/widgets/scrollcontainer.h b/gui/widgets/scrollcontainer.h index 49326ac6e9..01d9a195fa 100644 --- a/gui/widgets/scrollcontainer.h +++ b/gui/widgets/scrollcontainer.h @@ -34,6 +34,7 @@ class ScrollContainerWidget: public Widget, public CommandSender { int16 _scrolledX, _scrolledY; uint16 _limitH; uint32 _reflowCmd; + ThemeEngine::DialogBackground _backgroundType; void recalc(); @@ -51,6 +52,9 @@ public: Common::Rect getClipRect() const override; void handleMouseWheel(int x, int y, int direction); + + void setBackgroundType(ThemeEngine::DialogBackground backgroundType); + protected: // We overload getChildY to make sure child widgets are positioned correctly. // Essentially this compensates for the space taken up by the tab title header. |