aboutsummaryrefslogtreecommitdiff
path: root/gui/widgets
diff options
context:
space:
mode:
authorBastien Bouclet2019-12-28 10:43:58 +0100
committerBastien Bouclet2020-01-04 10:56:25 +0100
commiteb28c5a09288e563011b11eafea1c772a7127e7f (patch)
tree0fc961ac83a19357d6941f93a1e2106e1c4f2b93 /gui/widgets
parent346d53b0342d8a1d543887560a28cc45f211d9ad (diff)
downloadscummvm-rg350-eb28c5a09288e563011b11eafea1c772a7127e7f.tar.gz
scummvm-rg350-eb28c5a09288e563011b11eafea1c772a7127e7f.tar.bz2
scummvm-rg350-eb28c5a09288e563011b11eafea1c772a7127e7f.zip
GUI: Use a dialog theme layout for the unknown game dialog
Diffstat (limited to 'gui/widgets')
-rw-r--r--gui/widgets/edittext.cpp2
-rw-r--r--gui/widgets/list.cpp2
-rw-r--r--gui/widgets/popup.cpp2
-rw-r--r--gui/widgets/scrollcontainer.cpp18
-rw-r--r--gui/widgets/scrollcontainer.h6
5 files changed, 9 insertions, 21 deletions
diff --git a/gui/widgets/edittext.cpp b/gui/widgets/edittext.cpp
index e2dcd2be3e..ff21b3d3a9 100644
--- a/gui/widgets/edittext.cpp
+++ b/gui/widgets/edittext.cpp
@@ -90,7 +90,7 @@ void EditTextWidget::handleMouseDown(int x, int y, int button, int clickCount) {
}
void EditTextWidget::drawWidget() {
- g_gui.theme()->drawWidgetBackground(Common::Rect(_x, _y, _x + _w, _y + _h), 0,
+ g_gui.theme()->drawWidgetBackground(Common::Rect(_x, _y, _x + _w, _y + _h),
ThemeEngine::kWidgetBackgroundEditText);
// Draw the text
diff --git a/gui/widgets/list.cpp b/gui/widgets/list.cpp
index 9144282e65..8bdc002a8e 100644
--- a/gui/widgets/list.cpp
+++ b/gui/widgets/list.cpp
@@ -520,7 +520,7 @@ void ListWidget::drawWidget() {
Common::String buffer;
// Draw a thin frame around the list.
- g_gui.theme()->drawWidgetBackground(Common::Rect(_x, _y, _x + _w, _y + _h), 0,
+ g_gui.theme()->drawWidgetBackground(Common::Rect(_x, _y, _x + _w, _y + _h),
ThemeEngine::kWidgetBackgroundBorder);
// Draw the list items
diff --git a/gui/widgets/popup.cpp b/gui/widgets/popup.cpp
index ebb69f1e4d..aa87e1e835 100644
--- a/gui/widgets/popup.cpp
+++ b/gui/widgets/popup.cpp
@@ -130,7 +130,7 @@ void PopUpDialog::drawDialog(DrawLayer layerToDraw) {
Dialog::drawDialog(layerToDraw);
// Draw the menu border
- g_gui.theme()->drawWidgetBackground(Common::Rect(_x, _y, _x + _w, _y + _h), 0);
+ g_gui.theme()->drawWidgetBackground(Common::Rect(_x, _y, _x + _w, _y + _h), ThemeEngine::kWidgetBackgroundPlain);
/*if (_twoColumns)
g_gui.vLine(_x + _w / 2, _y, _y + _h - 2, g_gui._color);*/
diff --git a/gui/widgets/scrollcontainer.cpp b/gui/widgets/scrollcontainer.cpp
index e0680e123b..ac79f844f9 100644
--- a/gui/widgets/scrollcontainer.cpp
+++ b/gui/widgets/scrollcontainer.cpp
@@ -41,7 +41,7 @@ ScrollContainerWidget::ScrollContainerWidget(GuiObject *boss, const Common::Stri
void ScrollContainerWidget::init() {
setFlags(WIDGET_ENABLED);
_type = kScrollContainerWidget;
- _backgroundType = ThemeEngine::kDialogBackgroundDefault;
+ _backgroundType = ThemeEngine::kWidgetBackgroundPlain;
_verticalScroll = new ScrollBarWidget(this, _w-16, 0, 16, _h);
_verticalScroll->setTarget(this);
_scrolledX = 0;
@@ -136,24 +136,12 @@ void ScrollContainerWidget::reflowLayout() {
//recalculate height
recalc();
- //hide those widgets which are out of visible area
- ptr = _firstWidget;
- while (ptr) {
- int y = ptr->getAbsY() - getChildY();
- int h = ptr->getHeight();
- bool visible = ptr->isVisible();
- if (y + h - _scrolledY < 0) visible = false;
- if (y - _scrolledY > _limitH) visible = false;
- ptr->setVisible(visible);
- ptr = ptr->next();
- }
-
_verticalScroll->setVisible(_verticalScroll->_numEntries > _limitH); //show when there is something to scroll
_verticalScroll->recalc();
}
void ScrollContainerWidget::drawWidget() {
- g_gui.theme()->drawDialogBackground(Common::Rect(_x, _y, _x + _w, _y + getHeight()), _backgroundType);
+ g_gui.theme()->drawWidgetBackground(Common::Rect(_x, _y, _x + _w, _y + getHeight()), _backgroundType);
}
bool ScrollContainerWidget::containsWidget(Widget *w) const {
@@ -176,7 +164,7 @@ Common::Rect ScrollContainerWidget::getClipRect() const {
return Common::Rect(getAbsX(), getAbsY(), getAbsX() + _w, getAbsY() + getHeight() - 1); // this -1 is because of container border, which might not be present actually
}
-void ScrollContainerWidget::setBackgroundType(ThemeEngine::DialogBackground backgroundType) {
+void ScrollContainerWidget::setBackgroundType(ThemeEngine::WidgetBackground backgroundType) {
_backgroundType = backgroundType;
}
diff --git a/gui/widgets/scrollcontainer.h b/gui/widgets/scrollcontainer.h
index fd8db765a3..d534a6352b 100644
--- a/gui/widgets/scrollcontainer.h
+++ b/gui/widgets/scrollcontainer.h
@@ -34,7 +34,7 @@ class ScrollContainerWidget: public Widget, public CommandSender {
int16 _scrolledX, _scrolledY;
uint16 _limitH;
uint32 _reflowCmd;
- ThemeEngine::DialogBackground _backgroundType;
+ ThemeEngine::WidgetBackground _backgroundType;
Common::String _dialogName;
void recalc();
@@ -52,11 +52,10 @@ public:
Common::Rect getClipRect() const override;
- void setBackgroundType(ThemeEngine::DialogBackground backgroundType);
+ void setBackgroundType(ThemeEngine::WidgetBackground 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.
int16 getChildX() const override;
@@ -64,6 +63,7 @@ protected:
uint16 getWidth() const override;
uint16 getHeight() const override;
+protected:
void drawWidget() override;
Widget *findWidget(int x, int y) override;