From 00a2ebf00d9bf80033d489431888778268d736ee Mon Sep 17 00:00:00 2001 From: Keloran Date: Fri, 18 Nov 2022 13:09:38 +0000 Subject: [PATCH] added onclick to upower --- include/modules/upower/upower.hpp | 1 + man/waybar-upower.5.scd | 4 ++++ src/modules/upower/upower.cpp | 5 +---- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/modules/upower/upower.hpp b/include/modules/upower/upower.hpp index 2724443..e19315f 100644 --- a/include/modules/upower/upower.hpp +++ b/include/modules/upower/upower.hpp @@ -8,6 +8,7 @@ #include #include "ALabel.hpp" +#include "AButton.hpp" #include "glibconfig.h" #include "gtkmm/box.h" #include "gtkmm/image.h" diff --git a/man/waybar-upower.5.scd b/man/waybar-upower.5.scd index dae974d..a6ba4df 100644 --- a/man/waybar-upower.5.scd +++ b/man/waybar-upower.5.scd @@ -47,6 +47,10 @@ compatible devices in the tooltip. default: 4 ++ Defines the spacing between the tooltip window edge and the tooltip content. +*on-click*: ++ + typeof: string ++ + Command to execute when clicked on the module. + # FORMAT REPLACEMENTS *{percentage}*: The battery capacity in percentage diff --git a/src/modules/upower/upower.cpp b/src/modules/upower/upower.cpp index 41fc362..6b8a202 100644 --- a/src/modules/upower/upower.cpp +++ b/src/modules/upower/upower.cpp @@ -250,10 +250,7 @@ const std::string UPower::getDeviceStatus(UpDeviceState& state) { } bool UPower::handleToggle(GdkEventButton* const& event) { - std::lock_guard guard(m_Mutex); - showAltText = !showAltText; - dp.emit(); - return true; + return AModule::handleToggle(event); } std::string UPower::timeToString(gint64 time) {