[Scummvm-git-logs] scummvm master -> ed5f0c1924e186f0b7197a126fd7210a3ff7e9d3
sev-
sev at scummvm.org
Sat Nov 13 21:06:46 UTC 2021
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
ed5f0c1924 GUI: Properly initialize GridWidget
Commit: ed5f0c1924e186f0b7197a126fd7210a3ff7e9d3
https://github.com/scummvm/scummvm/commit/ed5f0c1924e186f0b7197a126fd7210a3ff7e9d3
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-11-13T22:06:35+01:00
Commit Message:
GUI: Properly initialize GridWidget
Changed paths:
gui/widgets/grid.cpp
diff --git a/gui/widgets/grid.cpp b/gui/widgets/grid.cpp
index 4ecfbd3d37..eeb6e75cf0 100644
--- a/gui/widgets/grid.cpp
+++ b/gui/widgets/grid.cpp
@@ -340,6 +340,11 @@ GridWidget::GridWidget(GuiObject *boss, const Common::String &name)
_platformIconWidth = g_gui.xmlEval()->getVar("Globals.Grid.PlatformIcon.Width");
_minGridXSpacing = g_gui.xmlEval()->getVar("Globals.Grid.XSpacing");
_minGridYSpacing = g_gui.xmlEval()->getVar("Globals.Grid.YSpacing");
+ _isTitlesVisible = g_gui.xmlEval()->getVar("Globals.Grid.ShowTitles");
+ _scrollBarWidth = g_gui.xmlEval()->getVar("Globals.Scrollbar.Width", 0);
+
+ _scrollWindowPaddingX = _minGridXSpacing;
+ _scrollWindowPaddingY = _minGridYSpacing;
loadPlatformIcons();
loadFlagIcons();
@@ -347,8 +352,10 @@ GridWidget::GridWidget(GuiObject *boss, const Common::String &name)
_scrollBar = new ScrollBarWidget(this, _w - _scrollBarWidth, _y, _scrollBarWidth, _y + _h);
_scrollBar->setTarget(this);
_scrollPos = 0;
+ _scrollSpeed = 1;
_firstVisibleItem = 0;
_lastVisibleItem = 0;
+ _rows = 0;
_itemsPerRow = 0;
_innerHeight = 0;
@@ -357,8 +364,15 @@ GridWidget::GridWidget(GuiObject *boss, const Common::String &name)
_scrollWindowWidth = 0;
_gridYSpacing = 0;
_gridXSpacing = 0;
+ _gridHeaderHeight = kLineHeight;
+ _gridHeaderWidth = 0;
+ _gridItemHeight = _thumbnailHeight + (2 * kLineHeight * _isTitlesVisible);
+ _gridItemWidth = _thumbnailWidth;
+ _trayHeight = kLineHeight * 3;
_selectedEntry = nullptr;
+ _tray = nullptr;
+ _isGridInvalid = true;
}
GridWidget::~GridWidget() {
More information about the Scummvm-git-logs
mailing list