aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVicent Marti2008-08-10 22:03:00 +0000
committerVicent Marti2008-08-10 22:03:00 +0000
commita4b3434af91bcb7ea272c7e214e249c0f6823126 (patch)
tree1389ce416ea5d3328ccf43cd9a8cf6bee735e7e8
parent52f3551587aad266a794e69416a9662023e55e0f (diff)
downloadscummvm-rg350-a4b3434af91bcb7ea272c7e214e249c0f6823126.tar.gz
scummvm-rg350-a4b3434af91bcb7ea272c7e214e249c0f6823126.tar.bz2
scummvm-rg350-a4b3434af91bcb7ea272c7e214e249c0f6823126.zip
Bugfix: Selection background too short when scrollbar not present.
Bugfix: Vector renderer drawstep for bitmap blitting. Added bitmap GFX for checkboxes. svn-id: r33771
-rw-r--r--graphics/VectorRenderer.h4
-rw-r--r--gui/ListWidget.cpp7
-rw-r--r--gui/ThemeParser.cpp6
-rw-r--r--gui/ThemeParser.h2
-rw-r--r--gui/themes/scummodern.stx8
-rw-r--r--gui/themes/scummodern.zipbin107874 -> 111123 bytes
6 files changed, 16 insertions, 11 deletions
diff --git a/graphics/VectorRenderer.h b/graphics/VectorRenderer.h
index 13ba9ff480..34c9c2c8a5 100644
--- a/graphics/VectorRenderer.h
+++ b/graphics/VectorRenderer.h
@@ -417,7 +417,7 @@ public:
void drawCallback_BITMAP(const Common::Rect &area, const DrawStep &step) {
uint16 x, y, w, h;
stepGetPositions(step, area, x, y, w, h);
- blitAlphaBitmap(step.blitSrc, Common::Rect(x, y, w, h));
+ blitAlphaBitmap(step.blitSrc, Common::Rect(x, y, x + w, y + h));
}
void drawCallback_VOID(const Common::Rect &area, const DrawStep &step) {}
@@ -720,8 +720,6 @@ public:
}
virtual void blitAlphaBitmap(const Graphics::Surface *source, const Common::Rect &r) {
- assert(r.width() >= source->w && r.height() >= source->h);
-
int16 x = r.left;
int16 y = r.top;
diff --git a/gui/ListWidget.cpp b/gui/ListWidget.cpp
index 5881d9fcef..13633941c8 100644
--- a/gui/ListWidget.cpp
+++ b/gui/ListWidget.cpp
@@ -364,6 +364,7 @@ void ListWidget::drawWidget() {
// Draw a thin frame around the list.
g_gui.theme()->drawWidgetBackground(Common::Rect(_x, _y, _x + _w, _y + _h), _hints, Theme::kWidgetBackgroundBorder);
+ const int scrollbarW = (_scrollBar && _scrollBar->isVisible()) ? _scrollBarWidth : 0;
// Draw the list items
for (i = 0, pos = _currentPos; i < _entriesPerPage && pos < len; i++, pos++) {
@@ -398,7 +399,7 @@ void ListWidget::drawWidget() {
if (_selectedItem == pos && _editMode) {
buffer = _editString;
adjustOffset();
- width = _w - r.left - _hlRightPadding - _leftPadding - _scrollBarWidth;
+ width = _w - r.left - _hlRightPadding - _leftPadding - scrollbarW;
g_gui.theme()->drawText(Common::Rect(_x + r.left, y, _x + r.left + width, y + fontHeight-2),
buffer, _state, Theme::kTextAlignLeft, inverted, pad);
} else {
@@ -407,9 +408,9 @@ void ListWidget::drawWidget() {
if (_selectedItem != pos) {
width = g_gui.getStringWidth(buffer) + pad;
if (width > _w - r.left)
- width = _w - r.left - _hlRightPadding - _scrollBarWidth;
+ width = _w - r.left - _hlRightPadding - scrollbarW;
} else
- width = _w - r.left - _hlRightPadding - _scrollBarWidth;
+ width = _w - r.left - _hlRightPadding - scrollbarW;
if (width > maxWidth)
maxWidth = width;
g_gui.theme()->drawText(Common::Rect(_x + r.left, y, _x + r.left + maxWidth, y + fontHeight-2),
diff --git a/gui/ThemeParser.cpp b/gui/ThemeParser.cpp
index 8fda7c2894..572acc0b76 100644
--- a/gui/ThemeParser.cpp
+++ b/gui/ThemeParser.cpp
@@ -354,10 +354,12 @@ bool ThemeParser::parseDrawStep(ParserNode *stepNode, Graphics::DrawStep *drawst
Common::String functionName = stepNode->values["func"];
if (functionName == "bitmap") {
- if (!stepNode->values.contains("filename"))
+ if (!stepNode->values.contains("file"))
return parserError("Need to specify a filename for Bitmap blitting.");
- if (!_theme->getBitmap(stepNode->values["filename"]))
+ drawstep->blitSrc = _theme->getBitmap(stepNode->values["file"]);
+
+ if (!drawstep->blitSrc)
return parserError("The given filename hasn't been loaded into the GUI.");
}
diff --git a/gui/ThemeParser.h b/gui/ThemeParser.h
index 905795f8ed..782ab9a44f 100644
--- a/gui/ThemeParser.h
+++ b/gui/ThemeParser.h
@@ -422,7 +422,7 @@ protected:
XML_PROP(xpos, false)
XML_PROP(ypos, false)
XML_PROP(orientation, false)
- XML_PROP(bitmap, false)
+ XML_PROP(file, false)
KEY_END()
XML_KEY(text)
diff --git a/gui/themes/scummodern.stx b/gui/themes/scummodern.stx
index fb388b7e5f..a2a58e3e67 100644
--- a/gui/themes/scummodern.stx
+++ b/gui/themes/scummodern.stx
@@ -60,6 +60,7 @@
<bitmaps>
<bitmap filename = 'logo.bmp'/>
<bitmap filename = 'cursor.bmp'/>
+ <bitmap filename = 'checkbox.bmp'/>
</bitmaps>
<fonts>
@@ -419,7 +420,7 @@
vertical_align = 'top'
horizontal_align = 'left'
/>
- <drawstep func = 'roundedsq'
+/* <drawstep func = 'roundedsq'
fill = 'gradient'
radius = 4
fg_color = 'white'
@@ -428,6 +429,9 @@
shadow = 0
bevel = 1
bevel_color = 'shadowcolor'
+ /> */
+ <drawstep func = 'bitmap'
+ file = 'checkbox.bmp'
/>
</drawdata>
@@ -518,7 +522,7 @@
padding = '7, 5, 0, 0'
/>
<widget name = 'EditTextWidget'
- padding = '7, 5, 0, 0'
+ padding = '5, 5, 0, 0'
/>
<widget name = 'Console'
padding = '7, 5, 5, 5'
diff --git a/gui/themes/scummodern.zip b/gui/themes/scummodern.zip
index aca5fa32a8..c58c4c1c2e 100644
--- a/gui/themes/scummodern.zip
+++ b/gui/themes/scummodern.zip
Binary files differ