From 7b91486441ed368f46ff43061a785550f8858c70 Mon Sep 17 00:00:00 2001 From: scorpion-26 <58082714+scorpion-26@users.noreply.github.com> Date: Sat, 14 Jan 2023 14:47:30 +0100 Subject: [PATCH] Add Bluetooth tooltips --- src/Bar.cpp | 17 +++++++++++------ src/Common.h | 9 ++++++++- src/Widget.cpp | 11 +++++++++++ src/Widget.h | 2 ++ 4 files changed, 32 insertions(+), 7 deletions(-) diff --git a/src/Bar.cpp b/src/Bar.cpp index 2ad0491..b825871 100644 --- a/src/Bar.cpp +++ b/src/Bar.cpp @@ -99,7 +99,7 @@ namespace Bar btIconText->SetClass("bt-label-connected"); btIconText->SetText(""); std::string btDev; - + std::string tooltip; for (auto& dev : info.devices) { std::string ico = " "; @@ -115,9 +115,13 @@ namespace Bar { ico = " "; } + tooltip += dev.name + " & "; btDev += ico; } - + // Delete last delim + if (tooltip.size()) + tooltip.erase(tooltip.end() - 3, tooltip.end()); + btDevText->SetTooltip(tooltip); btDevText->SetText(std::move(btDev)); } return TimerResult::Ok; @@ -380,10 +384,11 @@ namespace Bar { auto workspace = Widget::Create