Added common header creation

This commit is contained in:
Cooldude2606
2019-06-14 20:31:43 +01:00
parent fd6aced4d5
commit 1d31ab09ad
5 changed files with 55 additions and 66 deletions

View File

@@ -310,28 +310,16 @@ local function generate_container(player,element)
container.style.vertically_stretchable = false
-- main header for the gui
local header =
container.add{
name='header',
type='frame',
style='subheader_frame'
}
Gui.set_padding(header,2,2,4,4)
header.style.horizontally_stretchable = true
header.style.use_header_filler = false
--- Caption for the header bar
header.add{
type='label',
style='heading_1_label',
caption={'task-list.main-caption'},
tooltip={'task-list.sub-tooltip'}
}
local header_area = Gui.create_header(
container,
{'task-list.main-caption'},
{'task-list.sub-tooltip'},
true
)
--- Right aligned button to toggle the section
if player_allowed_edit(player) then
local right_align = Gui.create_alignment(header)
add_new_task(right_align)
add_new_task(header_area)
end
-- table that stores all the data