@@ -57,10 +57,10 @@ local function buttonbar_formspec(self)
57
57
end
58
58
59
59
formspec = formspec ..
60
- string.format (" image_button[%f,%f;%f,%f;%s;%s;%s;true;%s]" ,
60
+ string.format (" image_button[%f,%f;%f,%f;%s;%s;%s;true;%s]tooltip[%s;%s] " ,
61
61
btn_pos .x , btn_pos .y , self .btn_size , self .btn_size ,
62
62
self .buttons [i ].image , btn_name , self .buttons [i ].caption ,
63
- borders )
63
+ borders , btn_name , self . buttons [ i ]. tooltip )
64
64
else
65
65
-- print("end of displayable buttons: orientation: " .. self.orientation)
66
66
-- print( "button_end: " .. (btn_pos.y + self.btn_size - (self.btn_size * 0.05)))
@@ -140,11 +140,12 @@ local buttonbar_metatable = {
140
140
141
141
delete = function (self ) ui .delete (self ) end ,
142
142
143
- add_button = function (self , name , caption , image )
143
+ add_button = function (self , name , caption , image , tooltip )
144
144
if caption == nil then caption = " " end
145
145
if image == nil then image = " " end
146
+ if tooltip == nil then tooltip = " " end
146
147
147
- table.insert (self .buttons ,{ name = name , caption = caption , image = image })
148
+ table.insert (self .buttons ,{ name = name , caption = caption , image = image , tooltip = tooltip })
148
149
if self .orientation == " horizontal" then
149
150
if ( (self .btn_size * # self .buttons ) + (self .btn_size * 0.05 * 2 )
150
151
> self .size .x ) then
0 commit comments