Fixes and new tuned terminal

This commit is contained in:
Eduardo Bart
2013-02-28 18:39:27 -03:00
parent 69e762385e
commit b804dd6959
18 changed files with 238 additions and 206 deletions

View File

@@ -542,8 +542,15 @@ bool Tile::isLookPossible()
bool Tile::isClickable()
{
bool hasGround = false;
bool hasOnBottom = false;
bool hasIgnoreLook = false;
for(const ThingPtr& thing : m_things) {
if(!thing->isOnTop() && !thing->isIgnoreLook())
if(thing->isGround())
hasGround = true;
if(thing->isOnBottom())
hasOnBottom = true;
if((hasGround || hasOnBottom) && !hasIgnoreLook)
return true;
}
return false;

View File

@@ -41,6 +41,7 @@ UITextEdit::UITextEdit()
m_maxLength = 0;
m_editable = true;
m_selectable = true;
m_autoScroll = false;
m_changeCursorImage = true;
m_selectionReference = 0;
m_selectionStart = 0;
@@ -164,7 +165,7 @@ void UITextEdit::update(bool focusCursor)
// readjust start view area based on cursor position
m_cursorInRange = false;
if(focusCursor) {
if(focusCursor && m_autoScroll) {
if(m_cursorPos > 0 && textLength > 0) {
assert(m_cursorPos <= textLength);
Rect virtualRect(m_textVirtualOffset, m_rect.size() - Size(m_padding.left+m_padding.right, 0)); // previous rendered virtual rect
@@ -628,6 +629,8 @@ void UITextEdit::onStyleApply(const std::string& styleName, const OTMLNodePtr& s
setCursorVisible(node->value<bool>());
else if(node->tag() == "change-cursor-image")
setChangeCursorImage(node->value<bool>());
else if(node->tag() == "auto-scroll")
setAutoScroll(node->value<bool>());
}
}

View File

@@ -51,6 +51,7 @@ public:
void setSelectable(bool selectable) { m_selectable = selectable; }
void setSelectionColor(const Color& color) { m_selectionColor = color; }
void setSelectionBackgroundColor(const Color& color) { m_selectionBackgroundColor = color; }
void setAutoScroll(bool autoScroll) { m_autoScroll = autoScroll; }
void moveCursorHorizontally(bool right);
void moveCursorVertically(bool up);
@@ -87,6 +88,7 @@ public:
bool isMultiline() { return m_multiline; }
bool isEditable() { return m_editable; }
bool isSelectable() { return m_selectable; }
bool isAutoScrolling() { return m_autoScroll; }
protected:
void updateText();
@@ -123,6 +125,7 @@ private:
std::string m_validCharacters;
uint m_maxLength;
bool m_updatesEnabled;
bool m_autoScroll;
bool m_selectable;
int m_selectionReference;