diff --git a/src/ltui/dialog.lua b/src/ltui/dialog.lua index ca01138..d334327 100644 --- a/src/ltui/dialog.lua +++ b/src/ltui/dialog.lua @@ -63,6 +63,9 @@ function dialog:init(name, bounds, title) self:buttons():bounds_set(rect:new(0, v:height() - 1, v:width(), 1)) self:_update_buttons_layout() end) + + -- mark as block mouse + self:option_set("blockmouse", true) end -- get buttons diff --git a/src/ltui/panel.lua b/src/ltui/panel.lua index 1632f9e..b8479df 100644 --- a/src/ltui/panel.lua +++ b/src/ltui/panel.lua @@ -58,7 +58,7 @@ function panel:init(name, bounds) -- try focused first local current = v:current() - if current and current:option("mouseable") and current:bounds():contains(x, y) then + if current and current:option("mouseable") and (current:option("blockmouse") or current:bounds():contains(x, y)) then return current:action_on(action.ac_on_clicked, x, y) end diff --git a/src/ltui/textedit.lua b/src/ltui/textedit.lua index 4d04f1b..285d065 100644 --- a/src/ltui/textedit.lua +++ b/src/ltui/textedit.lua @@ -26,6 +26,7 @@ local event = require("ltui/event") local border = require("ltui/border") local curses = require("ltui/curses") local textarea = require("ltui/textarea") +local action = require("ltui/action") -- define module local textedit = textedit or textarea() @@ -42,6 +43,10 @@ function textedit:init(name, bounds, text) -- mark as selectable self:option_set("selectable", true) + -- mark as mouseable + self:option_set("mouseable", true) + self:action_set(action.ac_on_clicked, function () return true end) + -- disable progress self:option_set("progress", false)