mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 19:45:22 +09:00
Added common header creation
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user