Made clicking the message on the StatusView open a LogView

This commit is contained in:
rxi 2020-05-12 14:44:29 +01:00
parent 23cf193026
commit 7f6a2710ef

View file

@ -1,8 +1,10 @@
local core = require "core" local core = require "core"
local common = require "core.common" local common = require "core.common"
local command = require "core.command"
local config = require "core.config" local config = require "core.config"
local style = require "core.style" local style = require "core.style"
local DocView = require "core.docview" local DocView = require "core.docview"
local LogView = require "core.logview"
local View = require "core.view" local View = require "core.view"
@ -20,6 +22,14 @@ function StatusView:new()
end end
function StatusView:on_mouse_pressed()
if system.get_time() < self.message_timeout
and not core.active_view:is(LogView) then
command.perform "core:open-log"
end
end
function StatusView:show_message(icon, icon_color, text) function StatusView:show_message(icon, icon_color, text)
self.message = { self.message = {
icon_color, style.icon_font, icon, icon_color, style.icon_font, icon,