|
|
@ -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'
|
|
|
@ -267,16 +263,16 @@ function MinimizeButton:init()
|
|
|
|
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=']',
|
|
|
|