mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 05:38:56 +00:00
PINK: modify action_text to suit for new macgui, move dynamic scrollbar to macgui
This commit is contained in:
parent
fb7ed6f845
commit
7da28dfc15
@ -112,22 +112,16 @@ void ActionText::start() {
|
|||||||
Graphics::MacFont *font = new Graphics::MacFont;
|
Graphics::MacFont *font = new Graphics::MacFont;
|
||||||
_txtWnd = director->getWndManager().addTextWindow(font, _textColorIndex, _backgroundColorIndex,
|
_txtWnd = director->getWndManager().addTextWindow(font, _textColorIndex, _backgroundColorIndex,
|
||||||
_xRight - _xLeft, align, nullptr, false);
|
_xRight - _xLeft, align, nullptr, false);
|
||||||
|
_txtWnd->setTextColorRGB(_textRGB);
|
||||||
_txtWnd->enableScrollbar(true);
|
_txtWnd->enableScrollbar(true);
|
||||||
|
// it will hide the scrollbar when the text height is smaller than the window height
|
||||||
|
_txtWnd->setMode(Graphics::kWindowModeDynamicScrollbar);
|
||||||
_txtWnd->move(_xLeft, _yTop);
|
_txtWnd->move(_xLeft, _yTop);
|
||||||
_txtWnd->resize(_xRight - _xLeft, _yBottom - _yTop);
|
_txtWnd->resize(_xRight - _xLeft, _yBottom - _yTop);
|
||||||
_txtWnd->setEditable(false);
|
_txtWnd->setEditable(false);
|
||||||
_txtWnd->setSelectable(false);
|
_txtWnd->setSelectable(false);
|
||||||
|
|
||||||
_txtWnd->appendText(_text, font);
|
_txtWnd->appendText(_text, font);
|
||||||
// if the textHeight is smaller than the area we display the text, then we disable the scrollbar
|
|
||||||
if (_txtWnd->getTextHeight() < _txtWnd->getInnerDimensions().height()) {
|
|
||||||
_txtWnd->clearText();
|
|
||||||
_txtWnd->enableScrollbar(false);
|
|
||||||
_txtWnd->disableBorder();
|
|
||||||
_txtWnd->move(_xLeft, _yTop);
|
|
||||||
_txtWnd->resize(_xRight - _xLeft, _yBottom - _yTop);
|
|
||||||
_txtWnd->appendText(_text, font);
|
|
||||||
}
|
|
||||||
director->addTextWindow(_txtWnd);
|
director->addTextWindow(_txtWnd);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user