[Scummvm-git-logs] scummvm master -> 389f54ba1cd4d1e4e03d5873702060577a7a7d94
djsrv
dservilla at gmail.com
Fri Jul 24 04:35:14 UTC 2020
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
d7b1d27ccd GRAPHICS: MACGUI: Add title functions
389f54ba1c DIRECTOR: LINGO: Implement title properties
Commit: d7b1d27ccd7824907628026b167df7eeda6591b1
https://github.com/scummvm/scummvm/commit/d7b1d27ccd7824907628026b167df7eeda6591b1
Author: djsrv (dservilla at gmail.com)
Date: 2020-07-24T00:32:02-04:00
Commit Message:
GRAPHICS: MACGUI: Add title functions
Changed paths:
graphics/macgui/macwindow.cpp
graphics/macgui/macwindow.h
diff --git a/graphics/macgui/macwindow.cpp b/graphics/macgui/macwindow.cpp
index 197c8f7acd..0a72780eb0 100644
--- a/graphics/macgui/macwindow.cpp
+++ b/graphics/macgui/macwindow.cpp
@@ -68,6 +68,8 @@ MacWindow::MacWindow(int id, bool scrollable, bool resizable, bool editable, Mac
_closeable = false;
_borderWidth = kBorderWidth;
+
+ _titleVisible = true;
}
static const byte noborderData[3][3] = {
@@ -258,7 +260,7 @@ void MacWindow::drawBorderFromSurface(ManagedSurface *g) {
void MacWindow::drawSimpleBorder(ManagedSurface *g) {
- bool active = _active, scrollable = _scrollable, closeable = _active, drawTitle = !_title.empty();
+ bool active = _active, scrollable = _scrollable, closeable = _active, drawTitle = _titleVisible && !_title.empty();
const int size = kBorderWidth;
int x = 0;
int y = 0;
diff --git a/graphics/macgui/macwindow.h b/graphics/macgui/macwindow.h
index fc0e672c4a..cf8fb1be62 100644
--- a/graphics/macgui/macwindow.h
+++ b/graphics/macgui/macwindow.h
@@ -235,9 +235,25 @@ public:
/**
* Mutator to change the title of the window.
- * @param title Target title of the window.
+ * @param title Target title.
*/
- void setTitle(Common::String &title) { _title = title; }
+ void setTitle(const Common::String &title) { _title = title; _borderIsDirty = true; }
+ /**
+ * Accessor to get the title of the window.
+ * @return Title.
+ */
+ Common::String getTitle() { return _title; };
+ /**
+ * Mutator to change the visible state of the title.
+ * @param active Target state.
+ */
+ void setTitleVisible(bool titleVisible) { _titleVisible = titleVisible; _borderIsDirty = true; };
+ /**
+ * Accessor to determine whether the title is visible.
+ * @return True if the title is visible.
+ */
+ bool isTitleVisible() { return _titleVisible; };
+
/**
* Highlight the target part of the window.
* Used for the default borders.
@@ -322,6 +338,7 @@ private:
float _scrollPos, _scrollSize;
Common::String _title;
+ bool _titleVisible;
};
Commit: 389f54ba1cd4d1e4e03d5873702060577a7a7d94
https://github.com/scummvm/scummvm/commit/389f54ba1cd4d1e4e03d5873702060577a7a7d94
Author: djsrv (dservilla at gmail.com)
Date: 2020-07-24T00:32:45-04:00
Commit Message:
DIRECTOR: LINGO: Implement title properties
Changed paths:
engines/director/lingo/lingo-builtins.cpp
engines/director/lingo/lingo-object.cpp
diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp
index 1da221b802..2c0d68203f 100644
--- a/engines/director/lingo/lingo-builtins.cpp
+++ b/engines/director/lingo/lingo-builtins.cpp
@@ -2280,6 +2280,7 @@ void LB::b_window(int nargs) {
Graphics::MacWindowManager *wm = g_director->getMacWindowManager();
Stage *window = new Stage(wm->getNextId(), false, false, false, wm, g_director);
window->setName(windowName);
+ window->setTitle(windowName);
window->resize(1, 1, true);
window->setVisible(false, true);
wm->addWindowInitialized(window);
diff --git a/engines/director/lingo/lingo-object.cpp b/engines/director/lingo/lingo-object.cpp
index 64fa5dd0fd..b2a9aa52fe 100644
--- a/engines/director/lingo/lingo-object.cpp
+++ b/engines/director/lingo/lingo-object.cpp
@@ -350,6 +350,10 @@ bool Stage::setProp(const Common::String &propName, const Datum &value) {
Datum Stage::getField(int field) {
switch (field) {
+ case kTheTitle:
+ return getTitle();
+ case kTheTitleVisible:
+ return isTitleVisible();
case kTheVisible:
return isVisible();
default:
@@ -360,6 +364,12 @@ Datum Stage::getField(int field) {
bool Stage::setField(int field, const Datum &value) {
switch (field) {
+ case kTheTitle:
+ setTitle(value.asString());
+ return true;
+ case kTheTitleVisible:
+ setTitleVisible(value.asInt());
+ return true;
case kTheVisible:
setVisible(value.asInt());
return true;
More information about the Scummvm-git-logs
mailing list