Add 'disable_markup' option
This commit is contained in:
parent
6899f18aac
commit
fc48ca261f
|
@ -139,6 +139,7 @@ Multiple items can have multiple sets of options.
|
||||||
| filter_prefix | Text to be shown at begenning of the filter string | string |
|
| filter_prefix | Text to be shown at begenning of the filter string | string |
|
||||||
| max_items | Maximum number of items before showing scrollbar | number |
|
| max_items | Maximum number of items before showing scrollbar | number |
|
||||||
| enable_keyboard | Enable or disable keyboard navigation / hooks | boolean |
|
| enable_keyboard | Enable or disable keyboard navigation / hooks | boolean |
|
||||||
|
| disable_markup | Disable pango markup in items text | boolean |
|
||||||
| x | X position (absolute) | number |
|
| x | X position (absolute) | number |
|
||||||
| y | Y position (absolute) | number |
|
| y | Y position (absolute) | number |
|
||||||
|
|
||||||
|
|
1
base.lua
1
base.lua
|
@ -264,6 +264,7 @@ local function new(args)
|
||||||
filter_prefix = args.filter_prefix or "Filter:",
|
filter_prefix = args.filter_prefix or "Filter:",
|
||||||
enable_keyboard = (args.enable_keyboard ~= false),
|
enable_keyboard = (args.enable_keyboard ~= false),
|
||||||
max_items = args.max_items or nil,
|
max_items = args.max_items or nil,
|
||||||
|
disable_markup = args.disable_markup or false,
|
||||||
x = args.x or 0,
|
x = args.x or 0,
|
||||||
y = args.y or 0,
|
y = args.y or 0,
|
||||||
},
|
},
|
||||||
|
|
|
@ -116,7 +116,6 @@ function module:setup_item(data,item,args)
|
||||||
cr:paint()
|
cr:paint()
|
||||||
wibox.widget.textbox.draw(self,w, cr, width, height)
|
wibox.widget.textbox.draw(self,w, cr, width, height)
|
||||||
end
|
end
|
||||||
pref:set_markup("<span fgcolor='".. beautiful.bg_normal .."'><tt><b>F11</b></tt></span>")
|
|
||||||
l:add(pref)
|
l:add(pref)
|
||||||
m:set_left ( 0 )
|
m:set_left ( 0 )
|
||||||
end
|
end
|
||||||
|
@ -172,7 +171,11 @@ function module:setup_item(data,item,args)
|
||||||
data.height = fit_h
|
data.height = fit_h
|
||||||
data.style(data)
|
data.style(data)
|
||||||
item._internal.set_map.text = function (value)
|
item._internal.set_map.text = function (value)
|
||||||
|
if data.disable_markup then
|
||||||
|
text_w:set_text(value)
|
||||||
|
else
|
||||||
text_w:set_markup(value)
|
text_w:set_markup(value)
|
||||||
|
end
|
||||||
if data.auto_resize then
|
if data.auto_resize then
|
||||||
local fit_w,fit_h = text_w:fit(999,9999)
|
local fit_w,fit_h = text_w:fit(999,9999)
|
||||||
local is_largest = item == data._internal.largest_item_h
|
local is_largest = item == data._internal.largest_item_h
|
||||||
|
|
|
@ -206,7 +206,11 @@ function module:setup_item(data,item,args)
|
||||||
data.height = fit_h
|
data.height = fit_h
|
||||||
data.style(data)
|
data.style(data)
|
||||||
item._internal.set_map.text = function (value)
|
item._internal.set_map.text = function (value)
|
||||||
|
if data.disable_markup then
|
||||||
|
text_w:set_text(value)
|
||||||
|
else
|
||||||
text_w:set_markup(value)
|
text_w:set_markup(value)
|
||||||
|
end
|
||||||
if data.auto_resize then
|
if data.auto_resize then
|
||||||
local fit_w,fit_h = wibox.widget.textbox.fit(text_w,9999,9999)
|
local fit_w,fit_h = wibox.widget.textbox.fit(text_w,9999,9999)
|
||||||
local is_largest = item == data._internal.largest_item_w
|
local is_largest = item == data._internal.largest_item_w
|
||||||
|
|
Loading…
Reference in New Issue