Commit Graph

17 Commits

Author SHA1 Message Date
Emmanuel Lepage Vallee be23bf0f15 widget: Fix documentation 2016-05-30 17:51:19 -04:00
Uli Schlachter 65b403c34a wibox: Support screen objects
This commit documents that a textbox already accepts a screen object where a
screen index is expected. Also, this changes the widget API in that a widget's
context.screen is now a screen object instead of a screen index.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-26 18:42:57 +01:00
Uli Schlachter 15e72fb037 Fix luacheck warnings in lib/wibox
Warnings pointing out actual problems are left.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-12 09:15:55 +01:00
Uli Schlachter 178204449c Textbox:set_markup(): Print errors to stderr
Instead of throwing a Lua error, the code now just prints an error message to
stderr on invalid markup. For callers which want to handle this case specially,
we add :set_markup_silently() which returns error messages.

Fixes: https://github.com/awesomeWM/awesome/issues/546
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-01-17 16:47:27 +01:00
Daniel Hahler e39504a30f Make textbox widget respect the current theme
Without this fix `wibox.widget.textbox` ignores current theme font
setting and resets it to the initial one.
It becomes handy when the initial theme is tweaked during runtime, ie.
in `rc.lua`. Other AwesomeWM components like `awful` (taglist,
tasklist, menu) are aware and do respect the actual theme settings.

Closes https://github.com/awesomeWM/awesome/pull/89.
2015-12-11 00:55:33 +01:00
Uli Schlachter cdd8d2ed5f Textbox: Add API for queriying preferred size (#466)
This adds :get_preferred_size() and :get_preferred_size_at_dpi() which return
the size (=width, height) that the textbox would need if unlimited space is
available.

This also adds :get_height_for_width() and :get_height_for_width_at_dpi() which
return the height that the textbox would need if the given width is available.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-10-17 19:13:26 +02:00
Daniel Hahler 4e22cf02e6 Merge pull request #384 from blueyed/more-robust-errors
More robust errors: make sure errors are strings

Closes https://github.com/awesomeWM/awesome/pull/384.
2015-09-23 20:59:35 +02:00
Uli Schlachter 8d6030819b textbox: Honor per-screen DPI
This makes the textbox' :draw() and :fit() callbacks use the DPI that is
specified in the given drawing context. With this, the textbox now scales
correctly if different screens have different DPI values.

Idea originally from Daniel.

Closes https://github.com/awesomeWM/awesome/pull/457.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-21 21:13:21 +02:00
Uli Schlachter 9b8cbf7539 Convert the textbox to the new widget system
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-05 14:28:53 +02:00
Uli Schlachter 56c22cde77 Merge branch 'widget_context' 2015-08-23 15:33:43 +02:00
Daniel Hahler b33cffd851 doc: textbox:set_markup: link to Pango markup documentation 2015-08-13 16:13:22 +02:00
Uli Schlachter 1ebc34b5e9 Widgets: Also add a context argument to :fit()
Together with the context argument to :draw(), this even allows widgets to have
DPI-dependant size.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 11:19:48 +02:00
Uli Schlachter 88b98789a0 Rename the first argument to :draw to "context"
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 11:19:28 +02:00
Daniel Hahler 5b60bc212a textbox.set_markup: handle `parsed.message` from Pango.parse_markup
Ref: https://github.com/pavouk/lgi/issues/115
Fixes: https://github.com/awesomeWM/awesome/issues/301
2015-08-01 18:25:10 +02:00
Daniel Hahler 861cfc5915 wibox.widget.textbox: skip setting unchanged layout properties
In case the text, markup or other layout properties have not changed, there's
no need to update the widget.

Based on 5a2a5d03d3/lib/wibox/widget/textbox.lua.
Closes https://github.com/awesomeWM/awesome/pull/335.
2015-07-29 01:20:23 +02:00
actionless cec04b2684 Add DPI support and 'xresources' theme
This makes awesome respect DPI settings, and adds a new theme based on
xrdb and xsettingsd color settings ("xresources").

Closes https://github.com/awesomeWM/awesome/pull/229
2015-06-25 06:40:38 +02:00
Julian Wollrath 6cc7be512c Remove the *.in from all files.
Signed-off-b: Julian Wollrath <jwollrath@web.de>
2015-06-19 22:33:32 +02:00