summaryrefslogtreecommitdiff
path: root/xmake/core/ui/textedit.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2018-01-26 22:21:40 +0800
committerruki <[email protected]>2018-01-26 08:10:04 +0800
commitee7c1f8452c0e0b819ea9b896fd58a2268832ca6 (patch)
tree7f29a3a5b48d2871e4eda6ac6f668c4fafa1e6a5 /xmake/core/ui/textedit.lua
parent1589248c258456d5045d8e5bb9db69c9663f7181 (diff)
disable multi-line for mconfdialog input
Diffstat (limited to 'xmake/core/ui/textedit.lua')
-rw-r--r--xmake/core/ui/textedit.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/xmake/core/ui/textedit.lua b/xmake/core/ui/textedit.lua
index 4bc941855..ea5222140 100644
--- a/xmake/core/ui/textedit.lua
+++ b/xmake/core/ui/textedit.lua
@@ -48,6 +48,9 @@ function textedit:init(name, bounds, text)
-- disable progress
self:option_set("progress", false)
+
+ -- enable multiple line
+ self:option_set("multiline", true)
end
-- draw textedit
@@ -79,7 +82,7 @@ function textedit:event_on(e)
if e.key_code > 0x1f and e.key_code < 0x7f then
self:text_set(self:text() .. e.key_name)
return true
- elseif e.key_name == "Enter" then
+ elseif e.key_name == "Enter" and self:option("multiline") then
self:text_set(self:text() .. '\n')
return true
elseif e.key_name == "Backspace" then