fix: unable to disable upower's tooltip

This commit is contained in:
Erik Alonso
2025-07-21 19:04:37 +01:00
parent 39d6d80f64
commit bb190409de

View File

@ -10,7 +10,6 @@ UPower::UPower(const std::string &id, const Json::Value &config)
: AIconLabel(config, "upower", id, "{percentage}", 0, true, true, true), sleeping_{false} {
box_.set_name(name_);
box_.set_spacing(0);
box_.set_has_tooltip(AModule::tooltipEnabled());
// Tooltip box
contentBox_.set_orientation((box_.get_orientation() == Gtk::ORIENTATION_HORIZONTAL)
? Gtk::ORIENTATION_VERTICAL
@ -70,8 +69,10 @@ UPower::UPower(const std::string &id, const Json::Value &config)
g_signal_connect(upClient_, "device-removed", G_CALLBACK(deviceRemoved_cb), this);
// Subscribe tooltip query events
box_.set_has_tooltip();
box_.signal_query_tooltip().connect(sigc::mem_fun(*this, &UPower::queryTooltipCb), false);
box_.set_has_tooltip(AModule::tooltipEnabled());
if (AModule::tooltipEnabled()) {
box_.signal_query_tooltip().connect(sigc::mem_fun(*this, &UPower::queryTooltipCb), false);
}
resetDevices();
setDisplayDevice();