Commit Graph

41 Commits

Author SHA1 Message Date
Emmanuel Lepage Vallee 1c34c56d0b base: Remove setup_drawable callback
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.
2016-12-25 21:59:50 -05:00
Emmanuel Lepage Vallee 2d0a957506 quality: Begin to fix luacheck warnings 2016-12-25 21:59:37 -05:00
Emmanuel Lepage Vallee 6244ed7c26 api: Update file to match new upstream Awesome APIs
Also has some bug fixes mixed in the patch.

The Radical placement API is now fully upstreamed.
2016-12-25 21:59:37 -05:00
Emmanuel Lepage Vallee b167117958 bar: Support border color
Apparently this never worked as documented
2016-12-25 21:59:37 -05:00
Emmanuel Lepage Vallee f239ee9a24 Rewrite the view layer
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.
2016-12-25 21:59:37 -05:00
Emmanuel Lepage Vallee 5271ffd35c Begin the big changes for 3.6
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).
2016-12-25 21:59:23 -05:00
Emmanuel Lepage Vallee 6e85a46093 Fix more issues for 3.6. The arrow_prefix now work using a new hack
The "hack" force the full redraw of the menu. This is what 3.5 did
anyway, but of course is not correct. The new layout system allow
widgets to have a larger fit and it should cascade by itself. This
is not yet used by radical.

This commit also fix some mistake made during the initial port.

My whole config now load mostly correctly. Some 3.5 era bugs even
fixed themselves! It is still slower for some reasons and have many
errors left, but it "look" ok.
2016-12-25 21:59:23 -05:00
Emmanuel Lepage Vallee 1229da75c7 Add a new global get_preferred_size() for all widgets
Replace the fit(9999,9999) used before. This will hopefully be
temporary until upstream adopt such a method
2016-12-25 21:59:23 -05:00
Emmanuel Lepage Vallee cf9bb87b36 Port to the new Awesome widget system
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
2016-12-25 21:59:23 -05:00
Emmanuel Lepage Vallee 80bdbcca68 Add 'add_items' and 'add_widgets' methods 2014-12-28 22:23:59 -05:00
Emmanuel Lepage Vallee 75e6357b23 Various improvements 2014-12-25 01:10:55 -05:00
Emmanuel Lepage Vallee 03090fa2ec Add a bunch of skining options 2014-11-14 23:46:06 -05:00
Emmanuel Lepage Vallee 1a7630e437 Add default_item_margins and default_margins 2014-10-17 23:52:26 -04:00
Emmanuel Lepage Vallee f3fb27f464 Fix minor bugs
* 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
2014-08-08 02:02:40 -04:00
Emmanuel Lepage Vallee 52fdd8a1f2 Correctly forward menu item geometry 2014-07-27 23:49:14 -04:00
Emmanuel Lepage Vallee 1662a013dc Bug fixes 2014-07-27 19:20:04 -04:00
Emmanuel Lepage Vallee 231eef25bc Add global underlay support 2014-03-12 00:31:50 -04:00
Emmanuel Lepage Vallee ad20d9e2be Properly handle menu prefix and suffix widgets
This was previously hardcoded

100 commits!
2014-03-11 20:50:00 -04:00
Emmanuel Lepage Vallee 5255cca803 Change object syntax to user get_ and set_ prefix instead of get_map/set_map mappers (issue #15) 2014-03-05 00:12:48 -05:00
Emmanuel Lepage Vallee fabd52d1a6 Major refactoring, address issue #12 2014-02-22 23:59:03 -05:00
Emmanuel Lepage Vallee fd835fdbeb Fix issue #14 2014-02-19 22:16:59 -05:00
Emmanuel Lepage Vallee cd88700613 Port rc.lua default tasklist buttons to the tasklist module 2014-02-17 01:11:35 -05:00
Emmanuel Lepage Vallee 5cebb6a961 Switch to the new button handling API (instead of awful.button) 2014-02-16 23:55:44 -05:00
Emmanuel Lepage Vallee cbb39935db Add support for mouse over colors 2014-02-09 00:54:59 -05:00
Emmanuel Lepage Vallee 1170ac0cc4 Fix 2 tasklist bugs 2014-02-08 01:31:45 -05:00
Emmanuel Lepage Vallee 4482d93c96 Add tasklist widget (prototype) 2014-02-08 00:52:42 -05:00
Emmanuel Lepage Vallee 220dd27a02 Add new 'flexbar' menu type (bar with a flex layout) 2014-02-06 23:47:24 -05:00
Emmanuel Lepage Vallee c0c57eff16 Partially implement issue #8 2014-02-05 22:48:26 -05:00
Emmanuel Lepage Vallee 8fa38c2a2c Add :move() and :remove() methods 2014-02-05 21:43:06 -05:00
Emmanuel Lepage Vallee ddd67ca569 Add :swap(item1,item2) 2014-02-05 01:03:51 -05:00
Emmanuel Lepage Vallee 0376cfaf31 Add new 'item_layout' concept to fight code duplication between layouts 2014-02-02 16:53:09 -05:00
Emmanuel LEpage Vallee ebac399d72 Add 'arrow_single' item style 2014-01-25 01:33:50 -05:00
Emmanuel Lepage Vallee 5b635e96e5 Move upderlay widget to Radical 2014-01-16 00:25:50 -05:00
Emmanuel Lepage Vallee 27a5970277 Add partial arrow_prefix item style (1/3) 2014-01-13 00:46:33 -05:00
Emmanuel Lepage Vallee c974dc7534 Add 'arrow_alt' item style 2014-01-12 01:27:46 -05:00
Emmanuel Lepage Vallee a1144564ab Replace old item_style attributes by a more flexible array 2014-01-08 00:59:57 -05:00
Emmanuel Lepage Vallee 63bb804a45 'Bar' menu cleanup, minor bug fixes 2014-01-05 17:35:23 -05:00
Emmanuel Lepage Vallee 4db83034b8 Refactor menu layout to maximize code sharing 2014-01-05 01:04:40 -05:00
Emmanuel Lepage Vallee 55f1b2a0c1 Add :set_tooltip() method to all wibox.widgets 2014-01-04 16:51:50 -05:00
Emmanuel Lepage Vallee 4e54b38991 Add sub_menu_on option 2014-01-04 01:27:52 -05:00
Emmanuel Lepage Vallee 5ff71f7385 Add new 'bar' menu type 2014-01-04 00:49:20 -05:00