mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-20 17:03:05 +00:00
GRAPHICS: MACGUI: Add title functions
This commit is contained in:
parent
dc3216dab8
commit
d7b1d27ccd
@ -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;
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user