diff options
author | Eugene Sandulenko | 2006-05-26 01:16:21 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2006-05-26 01:16:21 +0000 |
commit | 12461c3ca0e0c971f4cdf2ba255c37568208dc94 (patch) | |
tree | 919bce5b0f37cd3ad4d12f8b561c5765cfe3f579 /gui | |
parent | 7f8b79d5d0c98e5321c435293fdda8ebb9166cde (diff) | |
download | scummvm-rg350-12461c3ca0e0c971f4cdf2ba255c37568208dc94.tar.gz scummvm-rg350-12461c3ca0e0c971f4cdf2ba255c37568208dc94.tar.bz2 scummvm-rg350-12461c3ca0e0c971f4cdf2ba255c37568208dc94.zip |
Do not create scrollbar copy on each resolution switch
svn-id: r22645
Diffstat (limited to 'gui')
-rw-r--r-- | gui/console.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gui/console.cpp b/gui/console.cpp index 419ea59c14..28e21d9628 100644 --- a/gui/console.cpp +++ b/gui/console.cpp @@ -56,6 +56,11 @@ ConsoleDialog::ConsoleDialog(float widthPercent, float heightPercent) // Reset the line buffer memset(_buffer, ' ', kBufferSize); + + // Dummy + _scrollBar = new ScrollBarWidget(this, 0, 0, 5, 10); + _scrollBar->setTarget(this); + init(); _currentPos = 0; @@ -101,14 +106,14 @@ void ConsoleDialog::init() { _h = (uint16)((_heightPercent * screenH - 2) / kConsoleLineHeight); _h = _h * kConsoleLineHeight + 2; - // Add scrollbar + // Set scrollbar dimensions int scrollBarWidth; if (g_gui.getWidgetSize() == kBigWidgetSize) scrollBarWidth = kBigScrollBarWidth; else scrollBarWidth = kNormalScrollBarWidth; - _scrollBar = new ScrollBarWidget(this, _w - scrollBarWidth - 1, 0, scrollBarWidth, _h); - _scrollBar->setTarget(this); + _scrollBar->setPos(_w - scrollBarWidth - 1, 0); + _scrollBar->setSize(scrollBarWidth, _h); _drawingHints = THEME_HINT_FIRST_DRAW | THEME_HINT_SAVE_BACKGROUND; |