aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorEugene Sandulenko2006-05-26 01:49:56 +0000
committerEugene Sandulenko2006-05-26 01:49:56 +0000
commit5fee4afc32e042893c90623d89c8d4d8e1857665 (patch)
tree987279fe1f511ab29f857f2331f0679ff7a384ca /gui
parent12461c3ca0e0c971f4cdf2ba255c37568208dc94 (diff)
downloadscummvm-rg350-5fee4afc32e042893c90623d89c8d4d8e1857665.tar.gz
scummvm-rg350-5fee4afc32e042893c90623d89c8d4d8e1857665.tar.bz2
scummvm-rg350-5fee4afc32e042893c90623d89c8d4d8e1857665.zip
- Put scrollbar inside of list widget
- Use resize() instead of setPos() and setSize() where applicable svn-id: r22646
Diffstat (limited to 'gui')
-rw-r--r--gui/ListWidget.cpp15
-rw-r--r--gui/console.cpp3
2 files changed, 9 insertions, 9 deletions
diff --git a/gui/ListWidget.cpp b/gui/ListWidget.cpp
index 4803153950..575c711e31 100644
--- a/gui/ListWidget.cpp
+++ b/gui/ListWidget.cpp
@@ -31,7 +31,6 @@ namespace GUI {
ListWidget::ListWidget(GuiObject *boss, String name)
: EditableWidget(boss, name), CommandSender(boss) {
- int w = g_gui.evaluator()->getVar(_name + ".w");
WidgetSize ws = g_gui.getWidgetSize();
@@ -42,13 +41,14 @@ ListWidget::ListWidget(GuiObject *boss, String name)
_hlLeftPadding = g_gui.evaluator()->getVar("ListWidget.hlLeftPadding", 0);
_hlRightPadding = g_gui.evaluator()->getVar("ListWidget.hlRightPadding", 0);
+ int scrollBarWidth;
if (ws == kBigWidgetSize) {
- _w = w - kBigScrollBarWidth;
+ scrollBarWidth = kBigScrollBarWidth;
} else {
- _w = w - kNormalScrollBarWidth;
+ scrollBarWidth = kNormalScrollBarWidth;
}
- _scrollBar = new ScrollBarWidget(boss, _x + _w, _y, (ws == kBigWidgetSize ? kBigScrollBarWidth : kNormalScrollBarWidth), _h);
+ _scrollBar = new ScrollBarWidget(this, _w - scrollBarWidth, 0, scrollBarWidth, _h);
_scrollBar->setTarget(this);
_flags = WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS | WIDGET_WANT_TICKLE;
@@ -451,10 +451,11 @@ void ListWidget::handleScreenChanged() {
_hlLeftPadding = g_gui.evaluator()->getVar("ListWidget.hlLeftPadding", 0);
_hlRightPadding = g_gui.evaluator()->getVar("ListWidget.hlRightPadding", 0);
+ int scrollBarWidth;
if (ws == kBigWidgetSize) {
- _w = w - kBigScrollBarWidth;
+ scrollBarWidth = kBigScrollBarWidth;
} else {
- _w = w - kNormalScrollBarWidth;
+ scrollBarWidth = kNormalScrollBarWidth;
}
_entriesPerPage = (_h - _topPadding - _bottomPadding) / kLineHeight;
@@ -465,7 +466,7 @@ void ListWidget::handleScreenChanged() {
for (int i = 0; i < _entriesPerPage; i++)
_textWidth[i] = 0;
- _scrollBar->resize(_x + _w, _y, (ws == kBigWidgetSize ? kBigScrollBarWidth : kNormalScrollBarWidth), _h);
+ _scrollBar->resize(_w - scrollBarWidth, 0, scrollBarWidth, _h);
scrollBarRecalc();
}
diff --git a/gui/console.cpp b/gui/console.cpp
index 28e21d9628..de6f914644 100644
--- a/gui/console.cpp
+++ b/gui/console.cpp
@@ -112,8 +112,7 @@ void ConsoleDialog::init() {
scrollBarWidth = kBigScrollBarWidth;
else
scrollBarWidth = kNormalScrollBarWidth;
- _scrollBar->setPos(_w - scrollBarWidth - 1, 0);
- _scrollBar->setSize(scrollBarWidth, _h);
+ _scrollBar->resize(_w - scrollBarWidth - 1, 0, scrollBarWidth, _h);
_drawingHints = THEME_HINT_FIRST_DRAW | THEME_HINT_SAVE_BACKGROUND;