Widget text upper case option, change gimp plugin mode to executable
This commit is contained in:
parent
14085a525b
commit
e78edad4c6
|
@ -5,7 +5,7 @@ MainWindow
|
||||||
@onEnter: EnterGame.doLogin()
|
@onEnter: EnterGame.doLogin()
|
||||||
@onEscape: EnterGame.hide()
|
@onEscape: EnterGame.hide()
|
||||||
|
|
||||||
Label
|
MenuLabel
|
||||||
!text: tr('Account name')
|
!text: tr('Account name')
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
|
@ -18,7 +18,7 @@ MainWindow
|
||||||
anchors.top: prev.bottom
|
anchors.top: prev.bottom
|
||||||
margin-top: 2
|
margin-top: 2
|
||||||
|
|
||||||
Label
|
MenuLabel
|
||||||
!text: tr('Password')
|
!text: tr('Password')
|
||||||
anchors.left: prev.left
|
anchors.left: prev.left
|
||||||
anchors.top: prev.bottom
|
anchors.top: prev.bottom
|
||||||
|
@ -32,7 +32,7 @@ MainWindow
|
||||||
anchors.top: prev.bottom
|
anchors.top: prev.bottom
|
||||||
margin-top: 2
|
margin-top: 2
|
||||||
|
|
||||||
Label
|
MenuLabel
|
||||||
id: serverLabel
|
id: serverLabel
|
||||||
!text: tr('Server')
|
!text: tr('Server')
|
||||||
anchors.left: prev.left
|
anchors.left: prev.left
|
||||||
|
@ -48,7 +48,7 @@ MainWindow
|
||||||
anchors.top: serverLabel.bottom
|
anchors.top: serverLabel.bottom
|
||||||
margin-top: 2
|
margin-top: 2
|
||||||
|
|
||||||
Label
|
MenuLabel
|
||||||
id: protocolLabel
|
id: protocolLabel
|
||||||
!text: tr('Protocol')
|
!text: tr('Protocol')
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
|
@ -65,7 +65,7 @@ MainWindow
|
||||||
margin-top: 2
|
margin-top: 2
|
||||||
width: 90
|
width: 90
|
||||||
|
|
||||||
Label
|
MenuLabel
|
||||||
id: portLabel
|
id: portLabel
|
||||||
!text: tr('Port')
|
!text: tr('Port')
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
|
|
@ -17,6 +17,8 @@ FlatLabel < UILabel
|
||||||
$disabled:
|
$disabled:
|
||||||
color: #aaaaaa88
|
color: #aaaaaa88
|
||||||
|
|
||||||
|
MenuLabel < Label
|
||||||
|
|
||||||
GameLabel < UILabel
|
GameLabel < UILabel
|
||||||
font: verdana-11px-antialised
|
font: verdana-11px-antialised
|
||||||
color: #bbbbbb
|
color: #bbbbbb
|
||||||
|
|
|
@ -43,7 +43,6 @@ TopPanel < Panel
|
||||||
image-repeated: true
|
image-repeated: true
|
||||||
focusable: false
|
focusable: false
|
||||||
|
|
||||||
|
|
||||||
TopPanel
|
TopPanel
|
||||||
id: topMenu
|
id: topMenu
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
|
|
|
@ -467,17 +467,19 @@ protected:
|
||||||
Point m_textOffset;
|
Point m_textOffset;
|
||||||
stdext::boolean<false> m_textWrap;
|
stdext::boolean<false> m_textWrap;
|
||||||
stdext::boolean<false> m_textAutoResize;
|
stdext::boolean<false> m_textAutoResize;
|
||||||
|
stdext::boolean<false> m_textOnlyUpperCase;
|
||||||
BitmapFontPtr m_font;
|
BitmapFontPtr m_font;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void resizeToText() { setSize(getTextSize()); }
|
void resizeToText() { setSize(getTextSize()); }
|
||||||
void clearText() { setText(""); }
|
void clearText() { setText(""); }
|
||||||
|
|
||||||
void setText(const std::string& text);
|
void setText(std::string text);
|
||||||
void setTextAlign(Fw::AlignmentFlag align) { m_textAlign = align; updateText(); }
|
void setTextAlign(Fw::AlignmentFlag align) { m_textAlign = align; updateText(); }
|
||||||
void setTextOffset(const Point& offset) { m_textOffset = offset; updateText(); }
|
void setTextOffset(const Point& offset) { m_textOffset = offset; updateText(); }
|
||||||
void setTextWrap(bool textWrap) { m_textWrap = textWrap; updateText(); }
|
void setTextWrap(bool textWrap) { m_textWrap = textWrap; updateText(); }
|
||||||
void setTextAutoResize(bool textAutoResize) { m_textAutoResize = textAutoResize; updateText(); }
|
void setTextAutoResize(bool textAutoResize) { m_textAutoResize = textAutoResize; updateText(); }
|
||||||
|
void setTextOnlyUpperCase(bool textOnlyUpperCase) { m_textOnlyUpperCase = textOnlyUpperCase; setText(m_text); }
|
||||||
void setFont(const std::string& fontName);
|
void setFont(const std::string& fontName);
|
||||||
|
|
||||||
std::string getText() { return m_text; }
|
std::string getText() { return m_text; }
|
||||||
|
|
|
@ -69,6 +69,8 @@ void UIWidget::parseTextStyle(const OTMLNodePtr& styleNode)
|
||||||
setTextWrap(node->value<bool>());
|
setTextWrap(node->value<bool>());
|
||||||
else if(node->tag() == "text-auto-resize")
|
else if(node->tag() == "text-auto-resize")
|
||||||
setTextAutoResize(node->value<bool>());
|
setTextAutoResize(node->value<bool>());
|
||||||
|
else if(node->tag() == "text-only-upper-case")
|
||||||
|
setTextOnlyUpperCase(node->value<bool>());
|
||||||
else if(node->tag() == "font")
|
else if(node->tag() == "font")
|
||||||
setFont(node->value());
|
setFont(node->value());
|
||||||
}
|
}
|
||||||
|
@ -103,8 +105,11 @@ void UIWidget::onFontChange(const std::string& font)
|
||||||
callLuaField("onFontChange", font);
|
callLuaField("onFontChange", font);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UIWidget::setText(const std::string& text)
|
void UIWidget::setText(std::string text)
|
||||||
{
|
{
|
||||||
|
if(m_textOnlyUpperCase)
|
||||||
|
std::transform(text.begin(), text.end(), text.begin(), toupper);
|
||||||
|
|
||||||
if(m_text == text)
|
if(m_text == text)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue