Skip to content

Commit

Permalink
refactor: enable markup for labels
Browse files Browse the repository at this point in the history
  • Loading branch information
sassanh committed Mar 30, 2024
1 parent 88bfaf6 commit af45dc1
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Version 0.10.5

- refactor: enable `markup` for labels

## Version 0.10.4

- fix(menu): avoid closing all applications when a single application is closed
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.4"
version = "0.10.5"
description = "GUI sdk for Ubo Pod"
authors = ["Sassan Haradji <[email protected]>"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion ubo_gui/app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def title_callback(self: UboApp, _: RootWidget, title: str) -> None:
@cached_property
def header(self: UboApp) -> Widget | None:
"""The header section of the app."""
self.header_label = Label(text=self.root.title or '')
self.header_label = Label(text=self.root.title or '', markup=True)

self.root.bind(title=self.title_callback)

Expand Down
1 change: 1 addition & 0 deletions ubo_gui/gauge/gauge_widget.kv
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
text: root.label
text_size: self.size
size_hint: 1, None
markup: True
height: dp(24)
halign: 'center'
shorten: True
Expand Down
3 changes: 3 additions & 0 deletions ubo_gui/menu/widgets/header_menu_page_widget.kv
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
max_lines: 2
strip: True
shorten_from: 'right'
markup: True

Label:
text: root.sub_heading
Expand All @@ -35,6 +36,7 @@
size_hint: 1, 0
max_lines: 2
shorten_from: 'right'
markup: True

Widget:
size_hint: 1, None
Expand All @@ -51,6 +53,7 @@
color: .6, .6, .6
bold: True
italic: True
markup: True

BoxLayout:
height: self.minimum_height if root.items else 0
Expand Down
2 changes: 2 additions & 0 deletions ubo_gui/menu/widgets/item_widget.kv
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
size_hint: None, 1
width: self.parent.height - dp(25)
valign: 'middle'
markup: True

Label:
pos: root.pos
Expand All @@ -39,6 +40,7 @@
valign: 'middle'
shorten: True
shorten_from: 'right'
markup: True

Widget:
width: dp(34)
Expand Down
1 change: 1 addition & 0 deletions ubo_gui/menu/widgets/normal_menu_page_widget.kv
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
color: .6, .6, .6
bold: True
italic: True
markup: True

BoxLayout:
height: self.minimum_height if root.items else 0
Expand Down
7 changes: 5 additions & 2 deletions ubo_gui/notification/notification_widget.kv
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@

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

Label:
font_size: dp(22)
Expand All @@ -45,6 +46,7 @@
halign: 'center'
valign: 'middle'
strip: True
markup: True

Widget:
size_hint: 1, None
Expand All @@ -59,6 +61,7 @@
halign: 'center'
shorten: False
strip: True
markup: True

Widget:
size_hint: 1, 1
Expand Down
2 changes: 2 additions & 0 deletions ubo_gui/prompt/prompt_widget.kv
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
height: dp(50) if root.icon is not None else dp(0)
font_size: dp(30)
text: root.icon if root.icon is not None else ''
markup: True

Label:
text: root.prompt
Expand All @@ -29,6 +30,7 @@
height: dp(20)
shorten: True
shorten_from: 'right'
markup: True

ItemWidget:
item: root.first_item
Expand Down

0 comments on commit af45dc1

Please sign in to comment.