Instead of creating unused cairo image surfaces, we create our temporary layouts
now via the (PangoCairo) font map. Way less ugly.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Replaced all references to image_surface_create_from_png to
awesome.load_image
Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
In the textbox' draw() callback we forgot to set the pango layout's width and
height. Whoops.
This was tested with the following code which makes it visible when the textbox
draws outside of its assigned space:
local w = wibox({ screen = 1 })
w.y = 10
w.x = 10
w.width = 150
w.height = 150
w.visible = true
local wi = wibox.widget.base.make_widget()
local t = wibox.widget.textbox()
t:set_markup("Foo <b>bar</b> <i>Foobar</i> und so weiter")
wi.draw = function(d, wibox, cr, width, height)
cr:move_to(24.5, 0)
cr:line_to(24.5, 150)
cr:move_to(0, 24.5)
cr:line_to(150, 24.5)
cr:move_to(124.5, 0)
cr:line_to(124.5, 150)
cr:move_to(0, 124.5)
cr:line_to(150, 124.5)
cr:set_line_width(1)
cr:stroke()
cr:translate(25, 25)
t.draw(t, wibox, cr, 100, 100)
end
w:set_widget(wi)
Signed-off-by: Uli Schlachter <psychon@znc.in>
This option is no longer valid in modelines, so it has been removed from
all modelines using the following shellscript:
#!/bin/ksh
git ls-tree -r HEAD | cut -f2 | while read f; do
egrep -e '^(//|--) vim: .*encoding=' $f >/dev/null || continue
sed -E -e '/^(\/\/|--) vim:/s/:encoding=utf-8//' $f > /tmp/foo
mv /tmp/foo $f
done
Signed-off-by: Gregor Best <gbe@ring0.de>
Signed-off-by: Uli Schlachter <psychon@znc.in>
Instead of creating a pango layout all the time (e.g. twice per redraw), we now
only create a single layout which we keep around all the time and update as
needed. Hopefully this helps a little.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This makes the imagebox widget refuse images which have a zero or negative width
or height. A zero size causes problems where a division by zero results in inf
which makes various stuff fail in weird ways later on.
Additionally, cairo's "error surfaces" have a negative size. Displaying those
would cause all sorts of weird problems, too, so we better reject those.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This makes the textbox pass the markup/text it is given to oopango immediately.
If it is invalid, a lua error will be thrown and the old text will still be
shown.
This fixes a bug where the whole wibox isn't redrawn when a textbox complains
about broken UTF8.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This makes sure that textbox.text = "foo" doesn't work at all. It was never
supposed to work anyway. Sorry that I break stuff again.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Instead of having to set the systray's base size by hand, it now automatically
uses min(avail_width, avail_height) as its base size. That's way less surprising
for people.
Signed-off-by: Uli Schlachter <psychon@znc.in>