Commit Graph

352 Commits

Author SHA1 Message Date
laith-m0 e1169e864d propmpt: Rename `args.hook` to `args.hook` for consistency. 2019-09-29 17:09:01 -04:00
Emmanuel Lepage Vallee f3dc57f3f4 layoutlist: Add more caching.
Technically this doesn't solve any memory leak, but AwesomeWM uses in
average less memory when changing the selected tab in quick succession.

This is because it has less "temporary" tables to track.
2019-08-07 04:27:56 -04:00
Emmanuel Lepage Vallee d832b8c9b8 layoutlist: Use weak tables to store the cache. 2019-08-07 03:21:17 -04:00
Emmanuel Lepage Vallee 90a29f92eb doc: Fix all the property, theme and field types. 2019-06-08 18:14:14 -04:00
Emmanuel Lepage Vallee b4ece0f053 doc: Use an explicit tag for all static functions.
This way their name doesn't get mangle by the broken magic. It will also
eventually allow to `error()` in the template when the implicit
`@function` is used.

This commit also fixes a large number of issues found while
proof-reading everything.
2019-06-08 18:14:13 -04:00
Emmanuel Lepage Vallee 11d7a614d9 doc: Add a constructor stereotype for everything.
This forces the constructor functions to be at the top of the API
documentation rather than in a random position.
2019-06-08 18:13:42 -04:00
Emmanuel Lepage Vallee 63ca0f0d8f doc: Use an explicit @method stereotype for all methods.
ldoc has a magical `@classmod` module type which tries to detect
what is a method and what is a static function. It fails about as
often as it works. This commit makes everything explicit to remove
such issues.

Fixes #2640
Ref #1373
2019-06-08 18:13:42 -04:00
Emmanuel Lepage Vallee f1dceb02f6 doc: Move all popups to a section. 2019-06-08 18:13:42 -04:00
Emmanuel Lepage Vallee bb51add089 doc: Move all widgets to a new section. 2019-06-08 17:49:14 -04:00
Emmanuel Lepage Vallee e9d4164851 doc: Move all containers to a new section. 2019-06-08 17:49:14 -04:00
fREW Schmidt 900cca54a4 Correct name of functions in taglist (#2783) 2019-06-08 16:09:02 -04:00
Emmanuel Lepage Vallee 5c57f43643 tasklist: Use awful.widget.clienticon by default.
This allows sharper icons to be used.

Fixes #2143
2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee a081413339 tasklist: Auto-call set_client on all template widgets
This commit also update one of the example to remove its now
redundant boilerplate code.
2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee aa6ab69ffc taglist: Auto-call set_tag on each widgets of the template.
This reduced the boilerplate code.
2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee e452ec8e27 awful.widget: Use private `args` for the update_function.
Previously, it would use the "real" args passed to the constructor.

It was a bad decision since:

 * It doesn't allow the tag/tasklist to add properties internally
 * It forces the widget to be created with a constructor rather than
   the alternate declarative syntax
 * It doesn't allow a tag/tasklist to be part of a widget_template

Technically this is a behavior change, but I doubt anybody will notice
given it is a dark and little documented corner of the API. Chances are
nobody have been using this API for years.
2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee d5a2fe0072 awful.widget: Add an helper to set a property on all template widgets
With this helper, it becomes possible to avoid manually setting common
properties such as the client in the tasklist of tag in the taglist when
the children widgets of the template have a set_+property_name.
2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee e79a5c5988 awful.widget: Add a `create_callback` to the common list.
This is like its template equivalent, but "private" to the list
widget.
2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee db2d4b92df awful.widget: Add support for icon_size.
This decision was taken out of necessity. While adding more style
elements to `awful.widget.common` isn't something I want, there is
little else to do here. The problem is that popup based lists only
have size constraints in one direction. So without a way to limit
the icon size, it will take 9999 pixels.
2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee 7adbbd3f7c awful.common: When a border is set, shrink the widget by its size. 2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee eb1c45b656 background: Update all users so they don't use the deprecated name.
This is done before deprecating the API so no commit ever use the
deprecated name.
2019-04-05 21:06:11 -04:00
Uli Schlachter f84e72d0d5 awful.widget.common: Use a template for the default template
Instead of having the default template hardcoded as code, this turns the
template into a descriptive version. This makes it easier to come up
with own templates: Just copy the default template and make a slight
change to it.

No functional changes are intended, but I cannot rule out that I did no
mistakes.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-03-28 18:51:13 +01:00
Emmanuel Lepage Vallée 8b5d79792b
doc: Fix a copy+paste mistake
The current `awful.widget.layoutlist` is a fork of the so far uncommitted `naughty.widget.actionlist`. It was created because some of the support code for the new `naughty` implementation needed "easier to merge" usage examples. The `layoutlist` was chosen because it was both a low hanging fruit and genuinely useful.
2019-01-27 22:01:10 -05:00
Emmanuel Lepage Vallee 8b60c05118 widget: Add a layoutlist widget
Like taglist and tasklist, but for layouts
2019-01-26 01:34:59 -05:00
Emmanuel Lepage Vallée a559f55c6a
prompt: Add a `with_shell` property. (#2500)
Fixes #2486
2018-12-31 15:38:14 -05:00
Aire-One 1a96642615 format code and doc 2018-10-31 11:42:36 +01:00
Aire-One bc822c0af7 Add all parameters from awful.prompt to awful.widget.prompt constructor. 2018-10-31 11:35:56 +01:00
Aire-One d5f20a7e0b Add `done_callback` parameter to awful.widget.prompt constructor. 2018-10-31 09:00:18 +01:00
Emmanuel Lepage Vallee 96bbbc82f3 widget.common: Add custom sources for the taglist and tasklist.
The current taglist/tasklist allow filter function to remove elements
from the list. However they don't allow sorting or additional entries
to be listed.

This commit introduced such a concept. It will later be used by the
layoutlist where it becomes more relevant since layouts are used created
"objects".
2018-08-27 00:03:22 -04:00
Emmanuel Lepage Vallee 250475d65c widget.common: Use the new ldoc filter section. 2018-08-18 18:14:24 -04:00
Yauhen Kirylau 94d3918d14 fix(awful: widget: only_on_screen): update for screen API changes from #2293 (#2304) 2018-07-22 18:33:59 -04:00
Kevin Zander 05b8836b01 Fix minor issues with calendar_popup (#2269) 2018-05-28 20:54:58 -04:00
Kevin Zander 347238b57a Check for layout spacing before theme spacing. Fixes #2250 (#2253) 2018-04-29 20:12:04 -04:00
Emmanuel Lepage Vallée f2bac50198
Merge pull request #2236 from funtaps/patch-1
Allow use of custom completion callback in prompt widget
2018-04-22 02:06:14 -04:00
Emmanuel Lepage Vallée c49095fc23
doc: Fix a tasklist/taglist documentation issue (#2228)
* doc: Fix a tasklist/taglist documentation issue
2018-04-22 02:04:01 -04:00
Kirill Funtov 38f7b17f0b
Added link to awful.prompt.run to documentation 2018-04-05 11:04:17 +03:00
Funtov Kirill 94856f48b4
Allow use of custom completion callback in prompt widget 2018-04-04 22:24:25 +03:00
Uli Schlachter 5c6e25fe0a Revert 31b8623ff6 and fix things properly (#2142)
The code here has things like "if cache.bgb" which suggests that "bgb"
(great name, by the way) is supposed to be optional. However,
31b8623ff6 made this thing definitely not optional by making it
*the* widget that is displayed. That feels wrong.

Also, after the above commit, the ".primary" entry is no longer used,
which is at least surprising for something which is called "primary".

None of this is explicitly documented (I didn't find anything when
looking for "primary" in common.lua nor tasklist.lua; I know that there
are examples for using this, but still that doesn't say how this is
supposed to work), so I'm not quite sure how this was intended to work.
Instead, I am just proposing this commit as a better fix with the above
rational and see what feedback I get...

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-01-12 21:32:51 -05:00
Emmanuel Lepage Vallee 31b8623ff6 widget.common: Fix the background color
regression from f147f0d28a
2017-12-05 19:52:36 -05:00
Emmanuel Lepage Vallee 20c4f71e19 taglist: Support externally defined layouts and widgets 2017-12-02 16:41:25 -05:00
Emmanuel Lepage Vallee 329c06fbca tasklist: Support externally defined layouts and widgets 2017-12-02 16:41:25 -05:00
Emmanuel Lepage Vallee f147f0d28a common: Refactor awful.widget.common to support external extensions
This commit allow user defined delegates to be used as list elements.
This put an end to the endless attempt to cram more features into this
code.

A widget template (non-instantiated) is passed to the arguments and
is created by the common code. It also supports "roles" where some
user defined widgets can replace the old textbox or imagebox.
2017-12-02 16:41:25 -05:00
Emmanuel Lepage Vallee 2e7cd2b2ef tasklist: Add a sync way to force an update
It simplifies the tests
2017-12-02 16:33:06 -05:00
Emmanuel Lepage Vallee b446a9bdb8 tasklist: Deprecate the old function signature 2017-12-02 16:33:06 -05:00
Emmanuel Lepage Vallee 8dedd19fcf taglist: Deprecate the old function signature
The old function didn't scale at all. As no replacements are going
to be merged anytime soon, start to make it meta-extensible.

This is the first step to be able to let the widget be extended
directly from rc.lua without adding yet more silly parameters.

It never scaled and has reached the point of no return a very long
time ago.

My first ever contribution to Awesome was to attempt to fix this,
but the solution was a bad hack. The radical module later solved
this by delegating the style, layout, theme, item layout and item
style to various "visitor" objects. While this is superior to this
commit, it was also a very large and complicated codebase. After
5 years, it is now obvious it will never be merged "whole".
2017-12-02 16:15:29 -05:00
Uli Schlachter a137655791 Add & use a dpi property on screen objects
Once upon a time, beautiful.xresources.get_dpi was added to query
Xft.dpi. That made sense since this queried an xresources property. Over
time, other, non-xresources-based ways to query DPI were added to this
function. Now, it makes no more sense to have this function here.

Also, recently it became possible to add new properties to C objects
from Lua code. Thus, we no longer need to have a get_dpi() function
somewhere, but can add s.dpi directly.

Thus, this commit adds s.dpi and makes everything use it. No functional
changes are intended.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-10-08 12:30:21 +02:00
Daniel Hahler 66c4e55511 Merge pull request #2029 from actionless/calendar-fix-click-hide
Calendar popup click/hover fix
2017-09-09 05:14:02 +02:00
getzze 35432e9f21 Avoid skipping a month if the day is 31 (#2028) 2017-09-08 22:08:47 +02:00
actionless c9fbecd1e8 refactor(awful: widget: calendar_popup): s/_calendar_clicked/_calendar_clicked_on/ 2017-09-01 22:43:57 +02:00
actionless 23613bac05 fix(awful: widget: calendar_popup): hover was not working anymore if hiding popup by clicking on it 2017-09-01 22:43:07 +02:00
Yauhen Kirylau 9e4446060e feat(awful: widget: calendar_popup: attach): implement 'on_hover' option (#2008)
* feat(awful: widget: calendar_popup: attach): implement 'on_hover' option

* feat(awful: widget: calendar_popup): smarter handling of click and hover at the same time
2017-08-27 21:01:24 +02:00