As this was the last step in the base constructor, it could be
done in each menu type without the callback and extra code.
The only reason this existed was to allow menu "sub classes"
that override this function. However, since this was rewritten,
it was no longer used, so for the sake of simplicity, I remove
this feature.
This is a step forward to stabilize Radical again. Most of impl/ and widgets/
code is still a mess, but the other modules slowly start to be maintainable
again. The road is still long before the Radical code is good enough to go
into Awesome. It will get there, eventually.
There is a new widget called `infoshapes`. It support all the features
from the underlay system, but is a lot less intrusive. This allow to
make some code simpler.
This is another step in getting rid of all the hacks.
Radical is a model-view framework. There is a common API to
set data, then view modules to display it. Those modules have
been rewritten on top of new APIs.
Not all features are yet re-integrated, most are. Future commits
will address the various regressions and missing features. This
time, the code should be maintainable. The whole separation of
concerns analysis has been re-done. Allowing code de-duplication
and generalization.
The API remain the same, only `set_menu` has changed a little to
allow merging the 2 sub-menu code paths.
Lots of things will break, hopefully for the better (eventually)
This commit use new upstream APIs:
* Many cairo paths have been replaced with gears.shape and gears.matrix
This commit add some features:
* Improved border_color support, now available per state
* bg_image support, now available per state
* Mutualize the state setting, remove duplicated code
Regressions:
* The arrow menu background border is off by a pixel
* The layout position problem reported by @mindeunix is now worst.
The positioning algo is full of race conditions and cannot be fixed
without a full rewrite. This commit break more things than it solve
and the code is in the middle of a transition. This will be solved
by future commits addressing the code quality (after the refactoring).
**WARNING**: this break the API
menu.overlay -> menu.draw_overlay
The new "overlay" behave like underlay, but is on top
This commit also add underlay/overlay "align" option and document
the feature properly.
This commit fix most issues introduced by the new widget system. It
is not production ready and will require multiple commits to fix
individual issues.
The new widget system is better suited for modules like Radical than
the previous one. Over time, this breakage will probably end up being
a good thing. However, for now, expect multiple errors.
The changes:
* The draw "wibox" argument is now a "context". "context.wibox" is
the equivalent. This will allow passing the Radical structure to
the draw method without storing it in the widgets.
* "fit" now have a new required "context" argument for the DPI, this
will allow removing the "default_height" variable Radical is using
to scale the UI on HIDPI systems. This will allow size policies to
be passed to the fit method
* "draw" has been splitted into "draw", "draw_before_children",
"draw_after_children" and "layout". This simplify the overlay
system and will allow cleaner code
* Drawing outside of the widget clip is no longer supported, this
break multiple Radical item.style. This will allow better
performance and less redraw once the new system issues have been
fixed
* Add hide() method to hide a menu and all sub menu (compared to set_visible)
* Add option to have sub_menu arrows
* Fix selected::changed not being emited in some cases
* Remove duplicated code from notification layout
While **much** more complex and slower for regular menus, it has advantages:
* Better performance scaling when state count grow
* Prevent most accidental unsupported state colors
* Prevent a big if elseif elseif... switch copy pasted in all item_styles
* Make it easier to register new states
As for the 'bloated' created by this commit, it will be moved when I will
fix issue #12
It can use Blind common.drawing tools to implement some magic.
I may merge this into Radical and kill Blind as everything else
is pretty much deprecated at this point. Blind was never more
than a hack.