contextmenu: make divider less aggressive (#1228)

Following changes are applied:
- use divider color instead of caret;
- add a vertical padding on the divider.
This commit is contained in:
Cyriaque Skrapits 2022-12-20 22:29:53 +01:00 committed by GitHub
parent 5ab8dc0275
commit 5b5b5fd3e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -9,6 +9,7 @@ local View = require "core.view"
local border_width = 1
local divider_width = 1
local divider_padding = 5
local DIVIDER = {}
---@class core.contextmenu : core.object
@ -29,7 +30,7 @@ local function get_item_size(item)
local lw, lh
if item == DIVIDER then
lw = 0
lh = divider_width
lh = divider_width + divider_padding * SCALE * 2
else
lw = style.font:get_width(item.text)
if item.info then
@ -224,7 +225,7 @@ function ContextMenu:draw_context_menu()
for i, item, x, y, w, h in self:each_item() do
if item == DIVIDER then
renderer.draw_rect(x, y, w, h, style.caret)
renderer.draw_rect(x, y + divider_padding * SCALE, w, divider_width, style.divider)
else
if i == self.selected then
renderer.draw_rect(x, y, w, h, style.selection)