GUI: Don't display the ScrollContainer background inside tabs
Fixes #10645.
This commit is contained in:
parent
91c463184d
commit
7c570d9b25
4 changed files with 13 additions and 2 deletions
|
@ -187,6 +187,7 @@ EditGameDialog::EditGameDialog(const String &domain)
|
||||||
//
|
//
|
||||||
_graphicsTabId = tab->addTab(g_system->getOverlayWidth() > 320 ? _("Graphics") : _("GFX"));
|
_graphicsTabId = tab->addTab(g_system->getOverlayWidth() > 320 ? _("Graphics") : _("GFX"));
|
||||||
ScrollContainerWidget *graphicsContainer = new ScrollContainerWidget(tab, "GameOptions_Graphics.Container", kGraphicsTabContainerReflowCmd);
|
ScrollContainerWidget *graphicsContainer = new ScrollContainerWidget(tab, "GameOptions_Graphics.Container", kGraphicsTabContainerReflowCmd);
|
||||||
|
graphicsContainer->setBackgroundType(ThemeEngine::kDialogBackgroundNone);
|
||||||
graphicsContainer->setTarget(this);
|
graphicsContainer->setTarget(this);
|
||||||
|
|
||||||
if (g_system->getOverlayWidth() > 320)
|
if (g_system->getOverlayWidth() > 320)
|
||||||
|
|
|
@ -1523,6 +1523,7 @@ void GlobalOptionsDialog::build() {
|
||||||
_graphicsTabId = tab->addTab(g_system->getOverlayWidth() > 320 ? _("Graphics") : _("GFX"));
|
_graphicsTabId = tab->addTab(g_system->getOverlayWidth() > 320 ? _("Graphics") : _("GFX"));
|
||||||
ScrollContainerWidget *graphicsContainer = new ScrollContainerWidget(tab, "GlobalOptions_Graphics.Container", kGraphicsTabContainerReflowCmd);
|
ScrollContainerWidget *graphicsContainer = new ScrollContainerWidget(tab, "GlobalOptions_Graphics.Container", kGraphicsTabContainerReflowCmd);
|
||||||
graphicsContainer->setTarget(this);
|
graphicsContainer->setTarget(this);
|
||||||
|
graphicsContainer->setBackgroundType(ThemeEngine::kDialogBackgroundNone);
|
||||||
addGraphicControls(graphicsContainer, "GlobalOptions_Graphics_Container.");
|
addGraphicControls(graphicsContainer, "GlobalOptions_Graphics_Container.");
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -1718,6 +1719,7 @@ void GlobalOptionsDialog::build() {
|
||||||
|
|
||||||
ScrollContainerWidget *container = new ScrollContainerWidget(tab, "GlobalOptions_Cloud.Container", kCloudTabContainerReflowCmd);
|
ScrollContainerWidget *container = new ScrollContainerWidget(tab, "GlobalOptions_Cloud.Container", kCloudTabContainerReflowCmd);
|
||||||
container->setTarget(this);
|
container->setTarget(this);
|
||||||
|
container->setBackgroundType(ThemeEngine::kDialogBackgroundNone);
|
||||||
|
|
||||||
_storagePopUpDesc = new StaticTextWidget(container, "GlobalOptions_Cloud_Container.StoragePopupDesc", _("Storage:"), _("Active cloud storage"));
|
_storagePopUpDesc = new StaticTextWidget(container, "GlobalOptions_Cloud_Container.StoragePopupDesc", _("Storage:"), _("Active cloud storage"));
|
||||||
_storagePopUp = new PopUpWidget(container, "GlobalOptions_Cloud_Container.StoragePopup");
|
_storagePopUp = new PopUpWidget(container, "GlobalOptions_Cloud_Container.StoragePopup");
|
||||||
|
|
|
@ -41,6 +41,7 @@ ScrollContainerWidget::ScrollContainerWidget(GuiObject *boss, const Common::Stri
|
||||||
void ScrollContainerWidget::init() {
|
void ScrollContainerWidget::init() {
|
||||||
setFlags(WIDGET_ENABLED);
|
setFlags(WIDGET_ENABLED);
|
||||||
_type = kScrollContainerWidget;
|
_type = kScrollContainerWidget;
|
||||||
|
_backgroundType = ThemeEngine::kDialogBackgroundDefault;
|
||||||
_verticalScroll = new ScrollBarWidget(this, _w-16, 0, 16, _h);
|
_verticalScroll = new ScrollBarWidget(this, _w-16, 0, 16, _h);
|
||||||
_verticalScroll->setTarget(this);
|
_verticalScroll->setTarget(this);
|
||||||
_scrolledX = 0;
|
_scrolledX = 0;
|
||||||
|
@ -145,8 +146,7 @@ void ScrollContainerWidget::reflowLayout() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScrollContainerWidget::drawWidget() {
|
void ScrollContainerWidget::drawWidget() {
|
||||||
g_gui.theme()->drawDialogBackground(Common::Rect(_x, _y, _x + _w, _y + getHeight() - 1),
|
g_gui.theme()->drawDialogBackground(Common::Rect(_x, _y, _x + _w, _y + getHeight() - 1), _backgroundType);
|
||||||
ThemeEngine::kDialogBackgroundDefault);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ScrollContainerWidget::containsWidget(Widget *w) const {
|
bool ScrollContainerWidget::containsWidget(Widget *w) const {
|
||||||
|
@ -169,4 +169,8 @@ Common::Rect ScrollContainerWidget::getClipRect() const {
|
||||||
return Common::Rect(getAbsX(), getAbsY(), getAbsX() + _w, getAbsY() + getHeight());
|
return Common::Rect(getAbsX(), getAbsY(), getAbsX() + _w, getAbsY() + getHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScrollContainerWidget::setBackgroundType(ThemeEngine::DialogBackground backgroundType) {
|
||||||
|
_backgroundType = backgroundType;
|
||||||
|
}
|
||||||
|
|
||||||
} // End of namespace GUI
|
} // End of namespace GUI
|
||||||
|
|
|
@ -34,6 +34,7 @@ class ScrollContainerWidget: public Widget, public CommandSender {
|
||||||
int16 _scrolledX, _scrolledY;
|
int16 _scrolledX, _scrolledY;
|
||||||
uint16 _limitH;
|
uint16 _limitH;
|
||||||
uint32 _reflowCmd;
|
uint32 _reflowCmd;
|
||||||
|
ThemeEngine::DialogBackground _backgroundType;
|
||||||
|
|
||||||
void recalc();
|
void recalc();
|
||||||
|
|
||||||
|
@ -51,6 +52,9 @@ public:
|
||||||
Common::Rect getClipRect() const override;
|
Common::Rect getClipRect() const override;
|
||||||
|
|
||||||
void handleMouseWheel(int x, int y, int direction);
|
void handleMouseWheel(int x, int y, int direction);
|
||||||
|
|
||||||
|
void setBackgroundType(ThemeEngine::DialogBackground backgroundType);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// We overload getChildY to make sure child widgets are positioned correctly.
|
// We overload getChildY to make sure child widgets are positioned correctly.
|
||||||
// Essentially this compensates for the space taken up by the tab title header.
|
// Essentially this compensates for the space taken up by the tab title header.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue