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:
Takase 2022-10-10 23:05:30 +08:00 committed by GitHub
parent d1c74f529a
commit 3409929a0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 83 additions and 1 deletions

View File

@ -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

Binary file not shown.

View File

@ -125,6 +125,76 @@
"css": "right-open",
"code": 62,
"src": "fontawesome"
},
{
"uid": "ebf4bfe82c54f9beb94c5221a7bdd975",
"css": "lite-xlbg",
"code": 53,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M83.3 0H916.7C962.7 0 1000 37.3 1000 83.3V916.7C1000 962.7 962.7 1000 916.7 1000H83.3C37.3 1000 0 962.7 0 916.7V83.3C0 37.3 37.3 0 83.3 0Z",
"width": 1000
},
"search": [
"lite-xlbg"
]
},
{
"uid": "cde50fad6c2cd7a805a8d5026939d645",
"css": "lite-xl1",
"code": 54,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M395.8 562.5V312.5C395.8 289.5 377.2 270.8 354.2 270.8H270.8V625C270.8 682.5 317.5 729.2 375 729.2H729.2V645.8C729.2 622.8 710.5 604.2 687.5 604.2H437.5C414.5 604.2 395.8 585.5 395.8 562.5Z",
"width": 1000
},
"search": [
"lite-xl1"
]
},
{
"uid": "526539ec7fcda0b3e7e7ceaa6ae416e6",
"css": "lite-xl2",
"code": 55,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M729.2 270.8H437.5L729.2 562.5Z",
"width": 1000
},
"search": [
"lite-xl2"
]
},
{
"uid": "cccbe047c5cb17c63c41a1fb1fc022f4",
"css": "lite-xl3",
"code": 57,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M666.7 333.3H500L666.7 500Z",
"width": 1000
},
"search": [
"lite-xl3"
]
},
{
"uid": "09d781dca1f50fcae90e67df9cc2f8dd",
"css": "lite-xl4",
"code": 56,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M500 458.3V333.3L604.2 395.8 666.7 500H541.7C518.7 500 500 481.3 500 458.3Z",
"width": 1000
},
"search": [
"lite-xl4"
]
}
]
}