-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): notifications now can have an optional `extra_information…
…` field which will cause the notification widget to render an info icon which opens a separate screen to render the extra information
- Loading branch information
Showing
16 changed files
with
216 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "ubo-app" | ||
version = "0.12.5" | ||
version = "0.12.6" | ||
description = "Ubo main app, running on device initialization. A platform for running other apps." | ||
authors = ["Sassan Haradji <[email protected]>"] | ||
license = "Apache-2.0" | ||
|
@@ -18,10 +18,10 @@ priority = "primary" | |
python = "^3.11" | ||
psutil = "^5.9.8" | ||
ubo-gui = [ | ||
{ version = "^0.10.5", markers = "extra=='default'", extras = [ | ||
{ version = "^0.10.6", markers = "extra=='default'", extras = [ | ||
"default", | ||
] }, | ||
{ version = "^0.10.5", markers = "extra=='dev'", extras = [ | ||
{ version = "^0.10.6", markers = "extra=='dev'", extras = [ | ||
"dev", | ||
] }, | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# ruff: noqa: D100, D101, D102, D103, D104, D107 | ||
from __future__ import annotations | ||
|
||
from functools import cached_property | ||
from typing import TYPE_CHECKING | ||
|
||
from kivy.clock import Clock | ||
from ubo_gui.gauge import GaugeWidget | ||
from ubo_gui.page import PageWidget | ||
from ubo_gui.volume import VolumeWidget | ||
|
||
from ubo_app.store import autorun | ||
|
||
if TYPE_CHECKING: | ||
from collections.abc import Sequence | ||
|
||
from ubo_gui.menu.types import Item | ||
|
||
|
||
class HomePage(PageWidget): | ||
def __init__( | ||
self: HomePage, | ||
items: Sequence[Item] | None = None, | ||
*args: object, | ||
**kwargs: object, | ||
) -> None: | ||
super().__init__(items, *args, **kwargs) | ||
|
||
self.ids.central_column.add_widget(self.cpu_gauge) | ||
self.ids.central_column.add_widget(self.ram_gauge) | ||
|
||
self.volume_widget = VolumeWidget() | ||
self.ids.right_column.add_widget(self.volume_widget) | ||
|
||
autorun(lambda state: state.sound.playback_volume)(self._sync_output_volume) | ||
|
||
def _sync_output_volume(self: HomePage, selector_result: float) -> None: | ||
self.volume_widget.value = selector_result * 100 | ||
|
||
@cached_property | ||
def cpu_gauge(self: HomePage) -> GaugeWidget: | ||
import psutil | ||
|
||
gauge = GaugeWidget( | ||
value=psutil.cpu_percent(percpu=False), | ||
fill_color='#24D636', | ||
label='CPU', | ||
) | ||
|
||
def set_value(_: int) -> None: | ||
gauge.value = psutil.cpu_percent(percpu=False) | ||
|
||
Clock.schedule_interval(set_value, 1) | ||
|
||
return gauge | ||
|
||
@cached_property | ||
def ram_gauge(self: HomePage) -> GaugeWidget: | ||
import psutil | ||
|
||
gauge = GaugeWidget( | ||
value=psutil.virtual_memory().percent, | ||
fill_color='#D68F24', | ||
label='RAM', | ||
) | ||
|
||
def set_value(_: int) -> None: | ||
gauge.value = psutil.virtual_memory().percent | ||
|
||
Clock.schedule_interval(set_value, 1) | ||
|
||
return gauge |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#:kivy 2.2.1 | ||
|
||
<NotificationInfo>: | ||
BoxLayout: | ||
orientation: 'horizontal' | ||
padding: dp(5) | ||
|
||
Label: | ||
text: root.text | ||
text_size: self.size | ||
halign: 'left' | ||
valign: 'top' | ||
size_hint: 1, 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# ruff: noqa: D100, D101, D102, D103, D104, D107 | ||
from __future__ import annotations | ||
|
||
from kivy.properties import StringProperty | ||
from ubo_gui.page import PageWidget | ||
|
||
|
||
class NotificationInfo(PageWidget): | ||
text: str = StringProperty() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters