GRAPHICS: MACGUI: load win95scrollbar border as default when enable win95 mode

This commit is contained in:
ysj1173886760 2021-04-21 10:02:59 +08:00 committed by Eugene Sandulenko
parent df895359cc
commit c317ca1900
3 changed files with 24 additions and 0 deletions

View File

@ -78,6 +78,13 @@ MacTextWindow::MacTextWindow(MacWindowManager *wm, const MacFont *font, int fgco
if (cursorHandler)
g_system->getTimerManager()->installTimerProc(&cursorTimerHandler, 200000, this, "textWindowCursor");
if (_wm->_mode & kWMModeWin95) {
// in win95 mode, we set scrollbar as default
_hasScrollBar = true;
loadWin95Border("Win95BorderScrollbar.bmp", kWindowBorderScrollbar | kWindowBorderActive);
loadWin95Border("Win95BorderScrollbar.bmp",kWindowBorderScrollbar);
}
}
void MacTextWindow::resize(int w, int h, bool inner) {

View File

@ -514,6 +514,22 @@ void MacWindow::setBorderType(int borderType) {
}
}
void MacWindow::loadWin95Border(const Common::String &filename, uint32 flags) {
Common::SeekableReadStream *stream = _wm->getFile(filename);
if (stream) {
Graphics::BorderOffsets offsets;
offsets.top = 1;
offsets.bottom = 1;
offsets.left = 1;
offsets.right = 17;
offsets.lowerScrollHeight = 15;
offsets.upperScrollHeight = 17;
offsets.titlePos = 0;
loadBorder(*stream, flags, offsets);
delete stream;
}
}
void MacWindow::addDirtyRect(const Common::Rect &r) {
if (!r.isValidRect())
return;

View File

@ -304,6 +304,7 @@ public:
void loadBorder(Common::SeekableReadStream &file, uint32 flags, int lo = -1, int ro = -1, int to = -1, int bo = -1);
void loadBorder(Common::SeekableReadStream &file, uint32 flags, BorderOffsets offsets);
void disableBorder();
void loadWin95Border(const Common::String &filename, uint32 flags);
/**
* we better set this before we load the border
* @param scrollbar state