[Scummvm-git-logs] scummvm master -> c1bd6a250d728912b5cacdbdd247f6107d18c6ad

bgK bastien.bouclet at gmail.com
Wed Nov 14 20:31:25 CET 2018


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
7c570d9b25 GUI: Don't display the ScrollContainer background inside tabs
c1bd6a250d GUI: Add some override markers


Commit: 7c570d9b253206e906fc9cc38c20083e043a0ed8
    https://github.com/scummvm/scummvm/commit/7c570d9b253206e906fc9cc38c20083e043a0ed8
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2018-11-14T20:27:41+01:00

Commit Message:
GUI: Don't display the ScrollContainer background inside tabs

Fixes #10645.

Changed paths:
    gui/editgamedialog.cpp
    gui/options.cpp
    gui/widgets/scrollcontainer.cpp
    gui/widgets/scrollcontainer.h


diff --git a/gui/editgamedialog.cpp b/gui/editgamedialog.cpp
index 6c44399..ac030d7 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 7c1a576..1bfe386 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 6578d26..7e3f50d 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 49326ac..01d9a19 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.


Commit: c1bd6a250d728912b5cacdbdd247f6107d18c6ad
    https://github.com/scummvm/scummvm/commit/c1bd6a250d728912b5cacdbdd247f6107d18c6ad
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2018-11-14T20:27:41+01:00

Commit Message:
GUI: Add some override markers

Changed paths:
    gui/widgets/scrollcontainer.h


diff --git a/gui/widgets/scrollcontainer.h b/gui/widgets/scrollcontainer.h
index 01d9a19..c034cab 100644
--- a/gui/widgets/scrollcontainer.h
+++ b/gui/widgets/scrollcontainer.h
@@ -41,31 +41,31 @@ class ScrollContainerWidget: public Widget, public CommandSender {
 public:
 	ScrollContainerWidget(GuiObject *boss, int x, int y, int w, int h, uint32 reflowCmd = 0);
 	ScrollContainerWidget(GuiObject *boss, const Common::String &name, uint32 reflowCmd = 0);
-	~ScrollContainerWidget();
+	~ScrollContainerWidget() override;
 
 	void init();
-	virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
-	virtual void reflowLayout();
+	void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
+	void reflowLayout() override;
 
-	virtual bool containsWidget(Widget *) const;
+	bool containsWidget(Widget *) const override;
 
 	Common::Rect getClipRect() const override;
 
-	void handleMouseWheel(int x, int y, int direction);
-
 	void setBackgroundType(ThemeEngine::DialogBackground backgroundType);
 
+	void handleMouseWheel(int x, int y, int direction) override;
+
 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.
-	virtual int16	getChildX() const;
-	virtual int16	getChildY() const;
-	virtual uint16	getWidth() const;
-	virtual uint16	getHeight() const;
+	int16	getChildX() const override;
+	int16	getChildY() const override;
+	uint16	getWidth() const override;
+	uint16	getHeight() const override;
 
-	virtual void drawWidget();
+	void drawWidget() override;
 
-	virtual Widget *findWidget(int x, int y);
+	Widget *findWidget(int x, int y) override;
 };
 
 } // End of namespace GUI





More information about the Scummvm-git-logs mailing list