From 724db8775561651abbf24650b95b2d03a07d961d Mon Sep 17 00:00:00 2001 From: Roygbyte <82218266+roygbyte@users.noreply.github.com> Date: Tue, 25 Oct 2022 08:50:21 -0300 Subject: [PATCH] ButtonDialog: add documentation about layout (#9505) --- frontend/ui/widget/buttondialog.lua | 41 +++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/frontend/ui/widget/buttondialog.lua b/frontend/ui/widget/buttondialog.lua index 32e989e10..ee344481b 100644 --- a/frontend/ui/widget/buttondialog.lua +++ b/frontend/ui/widget/buttondialog.lua @@ -1,3 +1,44 @@ +--[[-- +A button dialog widget that shows a grid of buttons. + + @usage + local button_dialog = ButtonDialog:new{ + buttons = { + { + { + text = "First row, left side", + callback = function() end, + hold_callback = function() end + }, + { + text = "First row, middle", + callback = function() end + }, + { + text = "First row, right side", + callback = function() end + } + }, + { + { + text = "Second row, full span", + callback = function() end + } + }, + { + { + text = "Third row, left side", + callback = function() end + }, + { + text = "Third row, right side", + callback = function() end + } + } + } + } +--]] + local Blitbuffer = require("ffi/blitbuffer") local ButtonTable = require("ui/widget/buttontable") local CenterContainer = require("ui/widget/container/centercontainer")