display ack image at the end of the line, not at the front

This commit is contained in:
Franzi 2024-02-13 14:05:23 +01:00
parent 1ada00b323
commit 55ae3fe2dd
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -95,20 +95,22 @@ function node.render()
y = y + margin
local service_x = real_width - margin - CONFIG.header_font:width(serv.service, service_font_size)
local host_x = margin
if serv.ack then
ack_image:draw(host_x, y, host_x + host_font_size, y + host_font_size)
host_x = host_x + host_font_size + margin
ack_image:draw(
real_width - margin - service_font_size, y,
real_width - margin, y + service_font_size
)
service_x = service_x - service_font_size - margin
end
if host_width + service_width > header_width then
CONFIG.header_font:write(host_x, y, serv.host, host_font_size, c_text[serv.state][1],c_text[serv.state][2],c_text[serv.state][2],1)
CONFIG.header_font:write(margin, y, serv.host, host_font_size, c_text[serv.state][1],c_text[serv.state][2],c_text[serv.state][2],1)
y = y + host_font_size + margin
CONFIG.header_font:write(service_x, y, serv.service, service_font_size, c_text[serv.state][1],c_text[serv.state][2],c_text[serv.state][3],1)
y = y + service_font_size + margin
else
CONFIG.header_font:write(host_x, y, serv.host, host_font_size, c_text[serv.state][1],c_text[serv.state][2],c_text[serv.state][2],1)
CONFIG.header_font:write(margin, y, serv.host, host_font_size, c_text[serv.state][1],c_text[serv.state][2],c_text[serv.state][2],1)
CONFIG.header_font:write(service_x, y, serv.service, service_font_size, c_text[serv.state][1],c_text[serv.state][2],c_text[serv.state][3],1)
y = y + CONFIG.header_size + margin
end