Skip to content

Commit

Permalink
ManagerToolbar: Set toolbar buttons to half opaciy when not sensitive
Browse files Browse the repository at this point in the history
There is otherwise no indication when there is no text show.
  • Loading branch information
infirit committed Oct 17, 2024
1 parent 81b1393 commit 7780159
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions blueman/gui/manager/ManagerToolbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,22 @@ def _update_buttons(self, adapter: Optional[Adapter]) -> None:
self.b_search.props.sensitive = powered and not (adapter and adapter["Discovering"])

tree_iter = self.blueman.List.selected()
opacity = 0.5
if tree_iter is None:
self.b_bond.props.sensitive = False
self.b_bond.props.opacity = opacity
self.b_trust.props.sensitive = False
self.b_remove.props.sensitive = False
self.b_send.props.sensitive = False
self.b_send.props.opacity = opacity
else:
row = self.blueman.List.get(tree_iter, "paired", "trusted", "objpush")
self.b_bond.props.sensitive = powered and not row["paired"]
self.b_bond.props.opacity = 1.0 if powered and not row["paired"] else opacity
self.b_trust.props.sensitive = True
self.b_remove.props.sensitive = True
self.b_send.props.sensitive = powered and row["objpush"]
self.b_send.props.opacity = 1.0 if powered and row["objpush"] else opacity

self.b_trust.props.icon_name = "blueman-untrust-symbolic" if row["trusted"] else "blueman-trust-symbolic"
self.b_trust.props.label = _("Untrust") if row["trusted"] else _("Trust")
Expand Down

0 comments on commit 7780159

Please sign in to comment.