Skip to content

Commit

Permalink
Fix handling user input for nested menus
Browse files Browse the repository at this point in the history
  • Loading branch information
miphreal committed Dec 6, 2020
1 parent d016184 commit 5300e17
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.5.1

- Fixed enabling/disabling handling input for nested menus

## 0.5.0

- Added support for rofi 1.6 (handle correctly ROFI_RETV, ROFI_INFO)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "rofi-menu"
version = "0.5.0"
version = "0.5.1"
description = "Create rofi menus via python"
authors = ["miphreal <[email protected]>"]
license = "MIT"
Expand Down
4 changes: 1 addition & 3 deletions rofi_menu/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,9 @@ async def render(self, meta):
_rofi_menu = [
meta.rofi_mode.menu_prompt(self.prompt),
meta.rofi_mode.menu_enable_markup(),
meta.rofi_mode.menu_no_input(not self.allow_user_input),
]

if not self.allow_user_input:
_rofi_menu.append(meta.rofi_mode.menu_no_input())

for num, item in enumerate(self.items):
if constants.FLAG_STYLE_ACTIVE in item.flags:
_rofi_menu.append(meta.rofi_mode.menu_active(num))
Expand Down
2 changes: 1 addition & 1 deletion rofi_menu/rofi_mode/rofi_mode_16.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def menu_active(num: int) -> str:


def menu_no_input(val: bool = True) -> str:
return "\0no-custom\x1f" + "true" if val else "false"
return "\0no-custom\x1f" + ("true" if val else "false")


def menu_entry(text, **fields):
Expand Down

0 comments on commit 5300e17

Please sign in to comment.