Commit Graph

68 Commits

Author SHA1 Message Date
Lucas Merritt
46c3f76a7d Styling and behavior fixes
Fix many issues with styling related to bemenu and the upwards list
mode. In addition to this, fix/modify some behavior to improve
this(ex: border_size and border_radius are now a double).
2023-11-21 13:39:18 +09:00
Lucas Merritt
432753bfe9 Upwards list support(X11)
Add upwards list support for X11, as well as refactor/improve some
drawing code and flags.
2023-11-21 13:39:18 +09:00
Lucas Merritt
d913466050 Password flag parameters with indicator option
Add parameters to the password flag, add an option in this flag to
enable indicator mode(display asterisks instead of hiding or
displaying the filter text).

Man page and help flag fix

Add password flag details to the man page, fix the help flag slightly
for better password flag details.
2023-10-09 08:41:40 +09:00
ItsProfessional
c9b891e89b Add option to exit bemenu using esc in vim binds normal mode 2023-06-30 09:31:45 +09:00
Lucas Merritt
d9ac320dd0
Add fixed height option(Addresses #270) (#326)
* added fixed height option && fixed counter
2023-02-18 18:30:55 +09:00
Lucas Merritt
77000a680c
Add Match/Page Counter(Addresses #204) (#325)
* counter with total item count

* filtered item counter

* optimized display code

* refactored overcomplicated code

* fixed warnings that failed Ubuntu test

* fixed inconsistent state

* CLI option for counter

* fixed vertical mode counter
2022-12-27 17:13:59 +09:00
Lucas Merritt
30379a88bf somewhat working, maybe fix background colors 2022-12-21 14:10:08 +09:00
Luca Nimmrichter
0c2bc885a1 Replace char *key_binding with an enum 2022-10-21 03:17:29 +09:00
Luca Nimmrichter
17481427a0 Replace --vim option with a generic --binding [name] option 2022-10-21 03:17:29 +09:00
Luca Nimmrichter
bcf53bcb25 Add basic vim bindings 2022-10-21 03:17:29 +09:00
Joan Bruguera
8217ae024b Fix exiting when an unexpected Wayland error occurs.
If an unexpected error was returned from a Wayland API during rendering (e.g.
from wl_display_flush), the code did set input.sym = XKB_KEY_Escape, so that
the next call to poll_key would return BM_KEY_ESCAPE and bemenu would quit.

However, this has been broken since #135, because input.key_pending was not
set, so the "fake" XKB_KEY_Escape is just ignored, bemenu doesn't quit, but
instead, it enters an infinite loop and keeps a CPU core at 100% usage.

The "quick fix" would be to just set input.key_pending wherever input.sym was
set to XKB_KEY_Escape. However, to make error handling less error-prone,
decouple it from input handling and add an error flag to (bm_menu_)render.
2022-08-03 08:55:34 +09:00
Barbaross
8c1c29c0b9 Add option to define a border and border color 2022-06-29 15:13:09 +09:00
Barbaross
84bccc02a0 Add option to specify horizontal padding in single line mode 2022-06-03 09:20:10 +09:00
Barbaross
9a76681b2c Add option to specify cursor width 2022-06-03 08:08:21 +09:00
Jari Vetoniemi
9817071f3a menu: make bm_menu_item_is_selected internal 2022-02-19 09:38:02 +09:00
Jari Vetoniemi
b427e0d35e internal: remove util.h include 2022-02-19 09:38:02 +09:00
Jari Vetoniemi
d201c48421 get rid of all the internal symbols 2022-02-19 08:00:26 +09:00
Stacy Harper
5a095705d2 Optimize redrawing
We add a dirty flag on the menu to track if the menu actually need a
redraw. With it, we will not redraw if the touch is hold on the same
entry by example.
2022-02-08 22:23:02 +09:00
Stacy Harper
9b8da12467 Add a feedback for touchscreen support
The idea is to write "Scroll up…", "Scroll down…" when the finger
touching bemenu will trigger a page scroll on release.
2022-02-08 22:23:02 +09:00
Stacy Harper
a111aa2afa mouse and touch support on wayland 2022-02-08 22:23:02 +09:00
Maxim Karasev
43255bbbe8 Add relative width option
It works on Wayland and X11 and acts as a complement to margin. Exact
behavior is as follows:
- If width factor is 0, width minus margin is used.
- If width multiplied by factor is greater than width minus margin,
  width minus is used. (so margin may be used to make sure that bemenu
  is at least N pixels away from the view border)
- Otherwise width multiplied by factor is used.

I think it's fine to disable warnings about floating point numbers
comparision. We don't do any arithmetics on them anyway, so we can't
suffer from inaccuracy.
2021-12-29 17:22:10 +09:00
lunacb
a96ed87472 redesigned vertical alignment
single enum determines if the menu is at the top, in the center,
or at the bottom. implemented in wayland and x11 renderers.
2021-11-03 17:57:18 +09:00
lunacb
bddeea05b6 created margin option
-M or --margin option sets the horizontal margin of the window
2021-11-03 17:57:18 +09:00
Stacy Harper
9b2a2cabf2 Add -s to disable title spacing on entries 2021-10-07 00:25:20 +09:00
Ben Brown
0589962d1c Add option to configure cursor height
If set to 0 (the default), the height of the cursor is set to the
height of the line (as is the current behaviour).
2021-08-27 04:01:13 +09:00
Stacy Harper
a42fa97a49 add -c center mode on wayland 2021-08-16 17:46:57 +09:00
Sören Tempel
2e922503e8 x11: Align -m argument interpretation with dmenu
With dmenu, monitor indices start at 0 and a value of -1 (the default)
is used to spawn dmenu on the current monitor. While bemenu strives to
be compatible with dmenu, bemenu monitor indices previously started at 1
and a value of 0 (the default) was used to spawn on the current monitor.

This commit aligns the behaviour of bemenu's x11 backend with dmenu. For
this purposes, the affected code in the x11 backend is synced with the
current dmenu implementation. While doing so the monitor type has also
been switched from a uint32_t to a int32_t.
2021-04-27 14:24:02 +09:00
Harley Swick
e74224a406 Use -m option for setting monitor name and monitor + cleanup 2021-02-05 16:53:43 +09:00
Robert Günzler
52547807b0
support hiding filter input (#150)
* support hiding filter input

"password mode"

Signed-off-by: Robert Günzler <r@gnzler.io>
2021-02-05 13:12:48 +09:00
Peter Colberg
a9cee36e85 Support compilation with -fvisibility=hidden
When using a compiler with support for GNU C extensions (GCC, Clang),
explicitly mark functions shared across library boundaries as visible.

This is the default visibility and has no effect when compiling with the
default CFLAGS. When compiling with -fvisibility=hidden, however, this
exports only functions marked BM_PUBLIC and hides all others.

https://gcc.gnu.org/wiki/Visibility

This facilitates packaging for distributions that track shared library
symbols, e.g., Debian, which uses a symbol file to provide the minimal
version associated to each symbol exported by a library.

https://www.debian.org/doc/debian-policy/ch-sharedlibs.html#the-symbols-system
https://manpages.debian.org/unstable/dpkg-dev/dpkg-gensymbols.1.en.html
2020-12-13 17:09:44 +09:00
Bill Doyle
6350a4000d
Add transparency support (#96)
Add transparency support
2020-03-16 11:41:42 +09:00
Jari Vetoniemi
bc584cc5f0 menu: make SHIFT_RETURN handling more elegant
Don't handle this on client side. Instead have a filter item and return
it if filter text is requested.
2020-02-07 21:54:13 +02:00
Jari Vetoniemi
ac9790b059 Fixes and docs from osx 2020-02-07 23:35:01 +09:00
Jari Vetoniemi
5a4d364d50 Nuke CMake from existance
Welcome glorious GNU Makefile
2020-02-07 16:03:08 +02:00
Alyssa Ross
93cde4831b
bemenu: add --line-height / -H option
Text is displayed vertically centered in a line. If unspecified, or 0,
the previous behaviour of making the height the size of the text, plus
two pixels on either side, is used, so there will be no change in
behaviour if this option is not used.

Fixes https://github.com/Cloudef/bemenu/issues/44.
2019-05-31 23:20:54 +00:00
Ilia Bozhinov
38069992ec Add option to respect panel position (#48)
* implement option to make menu respect panel boundaries

* fixup! implement option to make menu respect panel boundaries
2019-03-25 23:21:17 +02:00
Jari Vetoniemi
bf5fd83491 Fix mac os x build 2015-02-02 12:25:56 +02:00
Jari Vetoniemi
c2eabf2be1 Make scrollbar autohideable 2015-01-18 02:07:30 +02:00
Jari Vetoniemi
9c541d0b42 Add --scrollbar option 2015-01-18 01:08:10 +02:00
Jari Vetoniemi
074b2d1b58 Remove --backend and --prioritory options, change prioritory -> priorty
and provide BEMENU_BACKEND env variable. Change API to reflect this
change.

There is no reliable way to detect when running on terminal (especially
when stdin is a pipe), so we need to make curses backend explicit with
BEMENU_BACKEND=curses or bm_menu_new("curses"), otherwise GUI backend
will be choosed automatically.
2015-01-17 18:53:29 +02:00
Jari Vetoniemi
6ac8d8c4d8 Change font functions to function on pango style font descriptions instead of size
and name.
2015-01-17 15:25:50 +02:00
Jari Vetoniemi
ada6edc175 Add X11 renderer. 2015-01-16 01:59:09 +02:00
Jari Vetoniemi
a44b001e82 Mkae highlighted item prefix configurable. 2014-10-26 15:42:09 +02:00
Jari Vetoniemi
d3db039136 Single line mode, color customization, etc.. 2014-10-25 20:02:34 +03:00
Jari Vetoniemi
b03cd1ea53 Use BM_PLUGIN_VERSION for renderers. 2014-10-25 16:39:39 +03:00
Jari Vetoniemi
3f5e21a83f Cleanup wayland renderer and plugin support. 2014-10-25 01:38:30 +03:00
Jari Vetoniemi
0abad19b3e Pass bm_menu struct on each render api call. 2014-10-22 23:10:11 +03:00
Jari Vetoniemi
0b02230935 Call constructor of activated renderer. 2014-10-22 22:52:14 +03:00
Jari Vetoniemi
014c20099d Refactor code to snake_style, turn renderers into plugins, and start
wayland (cairo) renderer.
2014-10-22 22:46:51 +03:00
Jari Vetoniemi
617c4ab827 Add selection wrapping (-w). 2014-04-14 19:25:16 +03:00