Commit Graph

128 Commits

Author SHA1 Message Date
96239597ed Move most action state out of renderer
The renderer now only stores the positions of the actions because that
is specific to the renderer and because the actual position can only be
finalized after all the rendering is done because intitially the
positions are relative to the alignment and not the bar.
2021-02-12 20:01:22 +01:00
5d518e171e renderer: Use interface to render offset 2021-02-12 20:01:22 +01:00
fd556525a8 New Tag Parser (#2303)
* refactor(color): Use enum class for color type

* Add testcases for tag parser

* Make tag parser a pull-style parser

Being able to parse single elements at a time gives us more fine-grained
error messages, we can also parse as much as possible and only stop
after an exception.

* fix(color): Parser did not check for invalid chars

* tag parser: First full implementation

* tag parser: Fix remaining failing tests

* tag parser: Replace old parser

* tag parser: Treat alignment as formatting tag

Makes the structure less complex and the alignment tags really are
formatting tags, they are structurally no different from the %{R} tag.

* tag parser: Cleanup type definitions

All type definitions for tags now live in tags/types.hpp, the parser.hpp
only contains the definitions necessary for actually calling the parser,
this shouldn't be included in many places (only places that actually do
parsing). But many places need the definitions for the tags themselves.

* Rename components/parser to tags/dispatch

* tag parser: Cleanup

* Add changelog
2020-12-17 20:37:28 +01:00
7c662ec44f feat(conf) Properties for {bottom,top}-{left,right} radius 2020-12-13 17:02:23 +01:00
e89da58940 fix(builder): Properly apply alpha for fg and bg
It was not quite clear how try_apply_alpha should behave if the given
color was not ALPHA_ONLY. The implementation just returned 'this'.
However, the build relied on it returning the given color.

This broke all bg and fg settings in the entire bar.

To clear this up, we switch this around take the alpha channel of 'this'
and also return 'this' if it isn't ALPHA_ONLY.

Fixes #2255
2020-12-01 14:53:41 +01:00
5007dae35a If bar bg, fg, border, or line color is alpha only, apply to default 2020-11-27 22:08:03 +01:00
c9efd09f71 Load rgba from config instead of strings. 2020-11-27 22:08:03 +01:00
52000c194a fix(xrandr): Fetch cloned monitors where possible
Removing monitors is not really necessary when selecting the monitor
where to render the bar or choosing the backlight. Since both monitors
occupy the same coordinates rendering can be done on both and it's
better to give people felxibility for the backlight.

Fixes #1191
2020-04-21 23:59:01 +02:00
6849b8a56b clang-format 2019-10-27 16:02:33 +01:00
587dc6c84d bar: Make module separator a label
Some people use text modules instead of the `separator` key in the bar
section to better configure the separator (colors, fonts).
Since we disallowed the same module being used multiple times in #1534,
this will now print an error message.

This should help with this a bit.

Ref #1913
2019-10-27 16:02:33 +01:00
fea579ec85 fix(bar): Configure window before remapping
Some WMs like i3 discard position information when unmapping the bar and
because of that the bar would be at the wrong position after being
remapped.

Fixes #1484
Ref: https://github.com/i3/i3/pull/3834
2019-10-21 13:22:51 +02:00
1fc6942482 fix(ipc): Update bar when making bar visible
While an update was forced whenever polybar was made visible, the
`m_lastinput` variable was still set to the same value as when the bar
became hidden because updates to it were prevented.

Fixes #1875
2019-10-03 22:49:19 +02:00
b3ceedde76 refactor(bar): Remove bar_settings.center
Not used anywhere
2019-02-05 11:50:25 +01:00
1145681cf5 feat(monitor): use primary monitor as default (#1426)
If the monitor option isn't set, the primary monitor (if connected) is chosen as the default display.
2019-01-20 11:20:30 -08:00
46b8bb84ed feat(border): Percentage and pixel offset (#1592)
Uses the same X%:Z format as width, height and offset-*

Resolves #1567
2019-01-12 11:48:09 +01:00
4a506d429d xbacklight: Use monitor-strict from bar settings
monitor-strict in the xbacklight module was never documented anywhere so
it's fine to remove it.
2019-01-08 17:23:28 +01:00
e793082008 randr: Add separate key for exact monitor matching
This adds `monitor-exact = true` in the bar section

This also properly does best-match instead of first-match if multiple
matches exists. For example if there are two monitors HDMI2 and HDMI-2
and we try to match HDMI-2 with monitor-exact = false, until now HDMI2
would be matched. Now exact matches are always preferred.

Fixes #1532
2019-01-08 17:23:28 +01:00
6ca4f06785 doc: Convert @ to \ doxygen commands
Ref #1377
2018-11-04 19:28:27 -08:00
51d58e7518 fix(render): support stacked bars
We now take the bar position that the window manager gives us instead of trying
to calculate it ourselves. This is more correct when multiple bars are attached
to the same edge, as the window manager may move some of them in that
case (assuming override redirect is not enabled)
2018-10-04 15:52:03 +02:00
c2ac93db55 Added support for mixed percent/pixel geometry. 2018-05-10 00:05:18 +02:00
095d68fad0 fix: Stop using ato* for string to num conversion
atoi, atof and so on have undefined behavior if anything goes wrong. We
now use strto*, but without error checking. In most places overflows and
the like *should* not happen. String to number conversions are only used
when reading data from other applications or from the config, if another
application gives unparsable strings or too large numbers, then most
likely there is something wrong with that application. If the error
comes from the user config, then the user has to live with values
provided by strto* on error (which are very reasonable)

Fixes #1201
2018-05-03 11:07:37 -07:00
224ffa97c1 feat(config): Support fractional size and offset
Fixes #953.
2018-03-28 10:59:22 -07:00
39c12edc8a fix(cursor): add lock to motion handler 2018-03-27 22:03:38 +02:00
692e6d9b4a Loglevel info for "No matching input area" (#1059) 2018-02-27 17:45:24 +01:00
c7cb5ebf94 fix(renderer): Handle nested actions events properly
For nested actions, the inner action should override the outer action.
But because the list of actions was not iterated in reverse the outer
action was matched first.

Fixes #760
2017-09-23 16:53:04 +02:00
70023b07c1 refactor(cursor): Include double clicks and fix scroll to click changes 2017-09-16 19:48:38 -07:00
e612fe1624 refactor(cursor): use map for cursor list 2017-09-16 15:31:24 -07:00
1886cf97a8 fix: pass action by reference 2017-09-16 15:31:24 -07:00
1dc111c0fa fix: make xcb-cursor optional for now 2017-09-16 15:31:24 -07:00
65edba3321 feat: add cursor change 2017-09-16 15:31:24 -07:00
b6c5563b0b feat(ipc): Add visibility commands 2017-05-12 17:55:05 +02:00
f3089e88f2 feat(conf): Properties for top/bottom radius #445 2017-03-21 14:49:33 +01:00
3e4a4ce78f fix(renderer): Alignment blocks 2017-01-27 15:36:37 +01:00
beedc5ab84 fix(color_util): Parsing 2017-01-27 13:46:27 +01:00
162e77793a fix(tray): Ignore if detached
Refs #383
2017-01-26 12:46:10 +01:00
5283fbff01 fix(renderer): Fill background to the sub blocks
Paint the background on each sub block instead of the base surface.
Fixes the compositing ops.
2017-01-26 01:53:25 +01:00
8138a12381 refactor(renderer): Cleanup 2017-01-25 23:38:51 +01:00
02ab1b9a81 fix: Allow explicit override with property shorthand
Refs #375
2017-01-25 15:13:03 +01:00
eae612ce95 fix: Use correct name for padding shorthand
Refs #375
2017-01-25 15:03:57 +01:00
6692b4a8da refactor(x11): Cleanup 2017-01-24 10:49:14 +01:00
8b9461e63e wip(refactor): Cairo drawing 2017-01-24 07:41:46 +01:00
a59e115622 wip(refactor): Cairo drawing 2017-01-24 07:11:14 +01:00
452afcdc68 refactor: Integral types 2017-01-24 07:11:14 +01:00
5e1886a312 wip(refactor): Cairo drawing 2017-01-24 07:11:14 +01:00
48749b12d8 fix(bar): Improve error message for unparsable color 2017-01-20 02:32:52 +01:00
40d482d039 fix: By-pass double click timers if no handlers are defined
Fixes #338
2017-01-15 02:00:35 +01:00
6fb48c8e6f feat(build): Add flag for drawing visible whitespace 2017-01-13 11:04:43 +01:00
385572ec64 feat(xrandr): Support for monitors
Refs #280
2017-01-13 03:52:57 +01:00
2cde3f31a0 fix(config): Comply to parameter naming scheme 2017-01-12 18:09:56 +01:00
d49b1cacd3 fix(config): Rename parameter for individual border size
Rename `border-{left,top,right,bottom}` to `border-{left,top,right,bottom}-size`
to follow the naming scheme used for other size parameters
2017-01-12 17:55:56 +01:00