Skip to content

Commit

Permalink
fix(regression): handle return value of the action in ActionItem wh…
Browse files Browse the repository at this point in the history
…en it's callable

refactor(notification): make the icon smaller and make sure it is rendered on top
  • Loading branch information
sassanh committed Apr 27, 2024
1 parent 9a85194 commit cff5bdb
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## Version 0.10.8

- fix(regression): handle return value of the action in `ActionItem` when it's callable
- refactor(notification): make the icon smaller and make sure it is rendered on top

## Version 0.10.7

- fix(menu): not assume the return value of the action in `ActionItem` is a `Menu`
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 = "ubo-gui"
version = "0.10.7"
version = "0.10.8"
description = "GUI sdk for Ubo Pod"
authors = ["Sassan Haradji <[email protected]>"]
license = "Apache-2.0"
Expand Down
5 changes: 4 additions & 1 deletion ubo_gui/menu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,11 @@ def select_action_item(self: MenuWidget, item: ActionItem) -> None:
return
if isinstance(result, type) and issubclass(result, PageWidget):
self.open_application(result())
elif isinstance(result, Menu):
elif isinstance(result, Menu) or callable(result):
self.open_menu(result)
else:
msg = f'Unsupported returned value by `ActionItem`: {type(result)}'
raise TypeError(msg)

def select_application_item(self: MenuWidget, item: ApplicationItem) -> None:
"""Select an application item."""
Expand Down
6 changes: 3 additions & 3 deletions ubo_gui/notification/notification_widget.kv
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@
BoxLayout:
pos: container.pos
orientation: 'vertical'
height: self.minimum_height
height: max(container.height, self.minimum_height)
width: container.width
id: scrollable_widget

Label:
padding: dp(20), 0, dp(20), 0
font_size: dp(52)
font_size: dp(42)
text: root.icon
halign: 'center'
valign: 'middle'
color: root.color
size_hint: 1, None
height: dp(60)
height: dp(46)
markup: True

Label:
Expand Down

0 comments on commit cff5bdb

Please sign in to comment.