draw lite-xl icon in TitleView (#1143)
the original hamburger menu icon is confusing. It is not a menu and clicking it doesn't do anything. There is no reason why we can't draw lite-xl's icon in place of that.
This commit is contained in:
+13
-1
@@ -3,6 +3,14 @@ local common = require "core.common"
|
||||
local style = require "core.style"
|
||||
local View = require "core.view"
|
||||
|
||||
local icon_colors = {
|
||||
bg = { common.color "#2e2e32ff" },
|
||||
color6 = { common.color "#e1e1e6ff" },
|
||||
color7 = { common.color "#ffa94dff" },
|
||||
color8 = { common.color "#93ddfaff" },
|
||||
color9 = { common.color "#f7c95cff" }
|
||||
};
|
||||
|
||||
local restore_command = {
|
||||
symbol = "w", action = function() system.set_window_mode("normal") end
|
||||
}
|
||||
@@ -55,7 +63,11 @@ function TitleView:draw_window_title()
|
||||
local ox, oy = self:get_content_offset()
|
||||
local color = style.text
|
||||
local x, y = ox + style.padding.x, oy + style.padding.y
|
||||
x = common.draw_text(style.icon_font, color, "M ", nil, x, y, 0, h)
|
||||
common.draw_text(style.icon_font, icon_colors.bg, "5", nil, x, y, 0, h)
|
||||
common.draw_text(style.icon_font, icon_colors.color6, "6", nil, x, y, 0, h)
|
||||
common.draw_text(style.icon_font, icon_colors.color7, "7", nil, x, y, 0, h)
|
||||
common.draw_text(style.icon_font, icon_colors.color8, "8", nil, x, y, 0, h)
|
||||
x = common.draw_text(style.icon_font, icon_colors.color9, "9 ", nil, x, y, 0, h)
|
||||
local title = core.compose_window_title(core.window_title)
|
||||
common.draw_text(style.font, color, title, nil, x, y, 0, h)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user