mirror of https://github.com/anoshenko/rui.git
Fixing "hint" property
This commit is contained in:
parent
befb2a7484
commit
0740a48346
31
editView.go
31
editView.go
|
@ -517,20 +517,31 @@ func GetHint(view View, subviewID ...string) string {
|
|||
if len(subviewID) > 0 && subviewID[0] != "" {
|
||||
view = ViewByID(view, subviewID[0])
|
||||
}
|
||||
|
||||
session := view.Session()
|
||||
text := ""
|
||||
if view != nil {
|
||||
if text, ok := stringProperty(view, Hint, view.Session()); ok {
|
||||
return text
|
||||
}
|
||||
var ok bool
|
||||
text, ok = stringProperty(view, Hint, view.Session())
|
||||
if !ok {
|
||||
if value := valueFromStyle(view, Hint); value != nil {
|
||||
if text, ok := value.(string); ok {
|
||||
if text, ok = view.Session().resolveConstants(text); ok {
|
||||
if text, ok = value.(string); ok {
|
||||
if text, ok = session.resolveConstants(text); !ok {
|
||||
text = ""
|
||||
}
|
||||
} else {
|
||||
text = ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if text != "" && !GetNotTranslate(view) {
|
||||
text, _ = session.GetString(text)
|
||||
}
|
||||
|
||||
return text
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// GetMaxLength returns a maximal length of EditView. If a maximal length is not limited then 0 is returned
|
||||
// If the second argument (subviewID) is not specified or it is "" then a value of the first argument (view) is returned.
|
||||
|
|
Loading…
Reference in New Issue