fix(awful: hotkeys_popup): use new widget api in pagination (#1384)

This commit is contained in:
Yauhen Kirylau 2017-01-11 13:12:38 +01:00 committed by GitHub
parent 1f8309f1ff
commit f69769f7ba
1 changed files with 6 additions and 4 deletions

View File

@ -312,17 +312,18 @@ local function create_wibox(s, available_groups)
local available_width_px = width local available_width_px = width
local pages = {} local pages = {}
local columns = wibox.layout.fixed.horizontal() local columns = wibox.layout.fixed.horizontal()
local previous_page_last_layout
for _, item in ipairs(column_layouts) do for _, item in ipairs(column_layouts) do
if item.max_width > available_width_px then if item.max_width > available_width_px then
columns.widgets[#columns.widgets]['widget']:add( previous_page_last_layout:add(
group_label("PgDn - Next Page", beautiful.fg_normal) group_label("PgDn - Next Page", beautiful.fg_normal)
) )
table.insert(pages, columns) table.insert(pages, columns)
columns = wibox.layout.fixed.horizontal() columns = wibox.layout.fixed.horizontal()
available_width_px = width - item.max_width available_width_px = width - item.max_width
local old_widgets = item.layout.widgets item.layout:insert(
item.layout.widgets = {group_label("PgUp - Prev Page", beautiful.fg_normal)} 1, group_label("PgUp - Prev Page", beautiful.fg_normal)
awful.util.table.merge(item.layout.widgets, old_widgets) )
else else
available_width_px = available_width_px - item.max_width available_width_px = available_width_px - item.max_width
end end
@ -330,6 +331,7 @@ local function create_wibox(s, available_groups)
column_margin:set_widget(item.layout) column_margin:set_widget(item.layout)
column_margin:set_left(widget.group_margin) column_margin:set_left(widget.group_margin)
columns:add(column_margin) columns:add(column_margin)
previous_page_last_layout = item.layout
end end
table.insert(pages, columns) table.insert(pages, columns)