@@ -41,13 +41,14 @@ local function list_update(w, buttons, label, data, objects)
41
41
w :reset ()
42
42
for i , o in ipairs (objects ) do
43
43
local cache = data [o ]
44
- local ib , cb , tb , cbm , bgb , tbm , ibm , l , ll , bg_clickable
44
+ local ib , cb , tb , cbm , bgb , tbm , ibm , tt , l , ll , bg_clickable
45
45
if cache then
46
46
ib = cache .ib
47
47
tb = cache .tb
48
48
bgb = cache .bgb
49
49
tbm = cache .tbm
50
50
ibm = cache .ibm
51
+ tt = cache .tt
51
52
else
52
53
ib = wibox .widget .imagebox ()
53
54
tb = wibox .widget .textbox ()
@@ -95,12 +96,21 @@ local function list_update(w, buttons, label, data, objects)
95
96
96
97
l :buttons (create_buttons (buttons , o ))
97
98
99
+ -- Tooltip to display whole title, if it was truncated
100
+ tt = awful .tooltip ({
101
+ objects = {tb },
102
+ mode = ' outside' ,
103
+ align = ' bottom' ,
104
+ delay_show = 1 ,
105
+ })
106
+
98
107
data [o ] = {
99
108
ib = ib ,
100
109
tb = tb ,
101
110
bgb = bgb ,
102
111
tbm = tbm ,
103
- ibm = ibm
112
+ ibm = ibm ,
113
+ tt = tt
104
114
}
105
115
end
106
116
@@ -115,6 +125,10 @@ local function list_update(w, buttons, label, data, objects)
115
125
local textOnly = text :match (' >(.-)<' )
116
126
if (textOnly :len () > 24 ) then
117
127
text = text :gsub (' >(.-)<' , ' >' .. textOnly :sub (1 , 21 ) .. ' ...<' )
128
+ tt :set_text (textOnly )
129
+ tt :add_to_object (tb )
130
+ else
131
+ tt :remove_from_object (tb )
118
132
end
119
133
if not tb :set_markup_silently (text ) then
120
134
tb :set_markup (' <i><Invalid text></i>' )
0 commit comments