develop
Myk Taylor 2023-04-23 16:10:54 -07:00
parent 1231006f6c
commit c6d9a426dd
No known key found for this signature in database
1 changed files with 8 additions and 12 deletions

@ -248,11 +248,7 @@ end
-------------------- --------------------
MinimizeButton = defclass(MinimizeButton, widgets.Panel) MinimizeButton = defclass(MinimizeButton, widgets.Panel)
MinimizeButton.ATTRS{ MinimizeButton.ATTRS{label_pos='left', get_minimized_fn=DEFAULT_NIL, on_click=DEFAULT_NIL}
label_pos='left',
get_minimized_fn=DEFAULT_NIL,
on_click=DEFAULT_NIL,
}
function MinimizeButton:init() function MinimizeButton:init()
local show_label, hide_label = 'show', 'hide' local show_label, hide_label = 'show', 'hide'
@ -261,22 +257,22 @@ function MinimizeButton:init()
self:addviews{ self:addviews{
widgets.Label{ widgets.Label{
frame={t=0, l=0, w=1, h=1}, frame={t=0, l=0, w=1, h=1},
text='['..string.char(30)..']', text='[' .. string.char(30) .. ']',
text_pen=dfhack.pen.parse{fg=COLOR_BLACK, bg=COLOR_LIGHTRED}, text_pen=dfhack.pen.parse{fg=COLOR_BLACK, bg=COLOR_LIGHTRED},
text_hpen=dfhack.pen.parse{fg=COLOR_WHITE, bg=COLOR_RED}, text_hpen=dfhack.pen.parse{fg=COLOR_WHITE, bg=COLOR_RED},
visible=self.get_minimized_fn, visible=self.get_minimized_fn,
}, widgets.Label{ }, widgets.Label{
frame={t=0, l=1, w=1, h=1}, frame={t=0, l=1, w=1, h=1},
text={'[', text={{width=label_width},
{ '[', {
text=function() text=function()
return self.get_minimized_fn() and string.char(31) or string.char(30) return self.get_minimized_fn() and string.char(31) or string.char(30)
end, end,
},']', }, ']',
}, },
text_pen=dfhack.pen.parse{fg=COLOR_BLACK, bg=COLOR_GREY}, text_pen=dfhack.pen.parse{fg=COLOR_BLACK, bg=COLOR_LIGHTRED},
text_hpen=dfhack.pen.parse{fg=COLOR_BLACK, bg=COLOR_WHITE}, text_hpen=dfhack.pen.parse{fg=COLOR_WHITE, bg=COLOR_RED},
on_click=self:callback('toggleMinimized'), on_click=self.on_click,
}, widgets.Label{ }, widgets.Label{
frame={t=0, r=0, w=1, h=1}, frame={t=0, r=0, w=1, h=1},
text=']', text=']',