Commit Graph

10680 Commits

Author SHA1 Message Date
Lucas Schwiderski d84dc1e593
doc(w.l.overflow): Fix typo 2022-10-31 23:25:30 +01:00
Lucas Schwiderski d4a2fb06b0
bug(w.l.overflow): Fix resetting the widget 2022-10-31 23:25:29 +01:00
Lucas Schwiderski 29cfdc1a0a
doc(w.l.overflow): Fix constructor documentation 2022-10-31 15:51:20 +01:00
Lucas Schwiderski c8ec8394c5
fix(w.l.overflow): Fix mouse scrolling 2022-06-06 09:45:16 +02:00
Lucas Schwiderski 0f1dfe13ec
chore(w.l.overflow): Add unit tests for horizontal variant
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2022-01-08 11:34:06 +01:00
Lucas Schwiderski 16cdce6d1d
refactor(w.l.overflow): Rework unit test file layout
Improves separation of concerns for individual steps and reworks
groups and names for clearer output on error.

Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2022-01-08 11:34:05 +01:00
Lucas Schwiderski 6af44658a8
bug(w.l.overflow): Don't set position to initial click location
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-12-22 18:36:59 +01:00
Lucas Schwiderski 11892732d7
docs(w.l.overflow): Fix typo
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-12-21 17:39:10 +01:00
Lucas Schwiderski 6cb6ed0176
refactor(w.l.overflow): Remove redundant doc symbols import
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-12-21 17:34:19 +01:00
Lucas Schwiderski 51424b5da9
bug(w.l.fixed): Fix drawing to infinite available space
With the overflow layout, it is now possible to allow theoretically
infinite space for widgets to draw into. The `fixed` layout was broken
for this use case.

To determine the total amount of space used by its child widgets, the
`fixed` layout would subtract their size from the total available space
during `:fit` and keep that as a "remaining size" variable.
However, `Infinity - x == Infinity` (when `x < Infinity`).

So `:fit` would always end up with a calculation `needed_size =
available_size - size_left` or `x = Infinity - Infinity`, which is `0`.
So with infinite space available, the `fixed` layout would actually
report a size of `0`.

See also discussion at
https://github.com/awesomeWM/awesome/pull/3309#issuecomment-997191875

Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-12-18 14:20:48 +01:00
Lucas Schwiderski 52460a3317
bug(w.l.overflow): Fix scrolling for transformed widget
Fix mouse movement detection when the widget has been transformed by
something like `wibox.container.rotate`.

Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-12-16 23:08:39 +01:00
Lucas Schwiderski 23681c1f26
feat(w.l.overflow): Implement simple child extends clipping
While it is possible for any widget to clip drawing for its children to
prevent drawing outside the widget's boundaries, the widget system would
still consider the child widget's full size for mouse clicks.

Draw clipping via Cairo supports any arbitrary, complex path. To mirror
that for mouse clicks, we would need to create a temporary Cairo surface
to do the clipping for us, which is rather expensive.

Therefore this patch only adds the very basic, but likely the most
common use case where mouse clicks should be clipped to the widget's own
size.

See https://github.com/awesomeWM/awesome/pull/3309#discussion_r611138512
for the full discussion.

Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-12-16 23:08:38 +01:00
Lucas Schwiderski ea264d4388
doc(w.l.overflow): Fix incorrect default value.
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-12-16 23:08:38 +01:00
Lucas Schwiderski a587e8f647
doc(w.l.overflow): Fix description spacing
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-12-16 23:08:37 +01:00
Lucas Schwiderski 5e10f2620e
feat(w.l.overflow): Rename ambiguous property
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-12-16 23:08:36 +01:00
Lucas Schwiderski 580a0803a5
doc(w.l.overflow): Fix examples not showing a scrollbar
For some of the examples, the layout's available space was big enough to
show all child widgets, and no scrollbar was rendered.

Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-12-16 20:22:24 +01:00
Lucas Schwiderski 63ba82516d
doc(w.l.overflow): Clean up shared entries
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-12-16 20:13:31 +01:00
Lucas Schwiderski 252800fda1
chore(w.l.overflow): Improve code readability
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-12-16 20:02:47 +01:00
Lucas Schwiderski f5ba1d21c3
docs(w.l.overflow): Fix method tags
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-12-16 20:02:46 +01:00
Lucas Schwiderski c098bc36e8
bug(w.l.overflow): Fix iterating widgets
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-12-16 20:02:45 +01:00
Lucas Schwiderski 7cfb69c828
docs(w.l.overflow): Fix incorrect default value
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-12-16 20:02:44 +01:00
Lucas Schwiderski 12acb037d0
docs(w.l.overflow): Hide setters in docs
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-12-16 20:02:43 +01:00
Lucas Schwiderski a9922084e2
test(w.l.overflow): Add unit tests
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-12-16 20:02:42 +01:00
Lucas Schwiderski 3f19c51877
docs(w.l.overflow): Add examples
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-12-16 20:02:41 +01:00
Lucas Schwiderski c00418e5e9
docs(w.l.overflow): Add docs for overflow layout
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-12-16 20:02:40 +01:00
Lucas Schwiderski 200d452936
feat(w.l.overflow): Implement new overflow layout
This layout adds overflow behavior:

- adds a scrollbar, configurable as a widget
- adds scrollbar dragging to scroll
- adds mouse scroll behavior
- allows children to render at (near) infinite size in scroll direction

Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-12-16 20:02:39 +01:00
Aire-One 70524e72fa
Merge pull request #3519 from HumblePresent/fix_notif_register
Apply presets before registering notification
2021-12-09 21:11:17 +01:00
Actionless Loveless 1932bd017f
doc(readme): link to building and testing (fixes #3514) (#3515) 2021-11-28 14:59:51 -08:00
HumblePresent 030073fee7 Apply presets before registering notification 2021-11-26 13:22:58 -06:00
Emmanuel Lepage Vallée e7a21947e6
Merge pull request #3509 from Aire-One/fix/3508
[doc] Small improvements on the client's icons documentation
2021-11-21 12:01:39 -08:00
Emmanuel Lepage Vallée d328f92fdb
Merge pull request #3503 from sarubo/make_markup_available
fix: make markup available
2021-11-21 12:01:06 -08:00
sarubo 8d61790be7 doc: Add the markup example of popup_calendar
Refer to tests/examples/awful/widget/calendar_popup/default.lua
2021-11-21 23:49:46 +09:00
sarubo 03e437e32a calendar_popup: Fix markup not working 2021-11-21 23:42:00 +09:00
Aire-One aa378a1d4c
fix(client_get_some_icon) loosness about fail
Review @sclu1034
2021-11-15 22:44:26 +01:00
Aire-One 219cff8726 doc(icon) note on default value 2021-11-15 19:18:02 +01:00
Aire-One ea349cee6a doc(client_get_some_icon) Improve description 2021-11-15 19:18:02 +01:00
Aire-One 0246c44d4f
Merge pull request #3504 from Elv13/fix_build
build: Fix a recent regression when tests are built.
2021-11-14 13:22:46 +01:00
Lucas Schwiderski 4d111db7b2 build: Fix a recent regression when tests are built.
Fix #3502
2021-11-13 19:28:12 -08:00
Emmanuel Lepage Vallée 062ecfb6f0
Merge pull request #3490 from Elv13/less_flacky_tests
Less flacky tests
2021-11-13 00:42:18 -08:00
Jezer Mejía bf74f249d4
LC_CTYPE replaced with LC_ALL (#3492) 2021-11-09 09:13:28 +01:00
Emmanuel Lepage Vallée 2eb035e125
Merge pull request #3493 from Elv13/progressbar_doc
Improve the progressbar doc with more examples.
2021-11-03 12:40:56 -07:00
Emmanuel Lepage Vallée d95934d209
Merge pull request #3491 from Elv13/textbox_doc
Improve the textbox widget documentation.
2021-11-03 12:40:39 -07:00
Emmanuel Lepage Vallee 76704b33e7 progressbar: Make `ticks` and `bar_shape` compatible with each other.
It looked horrible/buggy when combined. Now it looks like people would
expect it to work. Another problem was the `bar_border_width` look
when `ticks` was `true.
2021-11-02 20:36:07 -07:00
Emmanuel Lepage Vallee 0afb719f82 doc: Improve the progressbar doc.
Another commit in the "lets finish the widget doc" serie.
2021-11-02 20:36:07 -07:00
Emmanuel Lepage Vallee 9dcfde32e0 naughty: Never hold a strong reference to the notification in the box.
luajit was failing to GC the notification about 5% of the time. This
commit stores all widget notifications in a weak table and don't let
any lambda access the parent object notification object.

Each of those changes reduces the failure rate. There might still be
a couple in there, but the test passed 200x on my laptop with 100%
success rate.
2021-10-31 19:30:17 -07:00
Emmanuel Lepage Vallee 6e8b0d5a85 ci: Be faster. 2021-10-31 13:37:33 -07:00
Emmanuel Lepage Vallee 295538e389 tests: Force GTK3 for the client test.
GTK4 removes iconify and deiconify and replaces them with
minimize and unminimize.
2021-10-31 13:37:33 -07:00
Emmanuel Lepage Vallee a08191913e tests: Blind attempt at making a flacky test under luajit stable.
I could not reproduce the issue locally.
2021-10-31 13:37:33 -07:00
Emmanuel Lepage Vallee 90a2b003a2 tests: Remove a noisy print 2021-10-31 13:37:33 -07:00
Emmanuel Lepage Vallee b4beb2308b tests: Add a simple systray test.
Compile a random little C program found on stack overflow to make
a systray. The goal is to make the `event.c` tests less flacky.
2021-10-31 13:37:32 -07:00