mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
refactor(custom): tooltip markup
This commit is contained in:
parent
6e7f22ac3a
commit
e96a0bf799
@ -129,9 +129,9 @@ auto waybar::modules::Custom::update() -> void {
|
|||||||
label_.set_markup(str);
|
label_.set_markup(str);
|
||||||
if (tooltipEnabled()) {
|
if (tooltipEnabled()) {
|
||||||
if (text_ == tooltip_) {
|
if (text_ == tooltip_) {
|
||||||
label_.set_tooltip_text(str);
|
label_.set_tooltip_markup(str);
|
||||||
} else {
|
} else {
|
||||||
label_.set_tooltip_text(tooltip_);
|
label_.set_tooltip_markup(tooltip_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
auto classes = label_.get_style_context()->list_classes();
|
auto classes = label_.get_style_context()->list_classes();
|
||||||
|
@ -6,7 +6,7 @@ waybar::modules::Temperature::Temperature(const std::string& id, const Json::Val
|
|||||||
if (config_["hwmon-path"].isString()) {
|
if (config_["hwmon-path"].isString()) {
|
||||||
file_path_ = config_["hwmon-path"].asString();
|
file_path_ = config_["hwmon-path"].asString();
|
||||||
} else if (config_["hwmon-path-abs"].isString() && config_["input-filename"].isString()) {
|
} else if (config_["hwmon-path-abs"].isString() && config_["input-filename"].isString()) {
|
||||||
file_path_ = (*std::filesystem::directory_iterator(config_["hwmon-path-abs"].asString())).path().u8string() + "/" + config_["input-filename"].asString();
|
file_path_ = (*std::filesystem::directory_iterator(config_["hwmon-path-abs"].asString())).path().string() + "/" + config_["input-filename"].asString();
|
||||||
} else {
|
} else {
|
||||||
auto zone = config_["thermal-zone"].isInt() ? config_["thermal-zone"].asInt() : 0;
|
auto zone = config_["thermal-zone"].isInt() ? config_["thermal-zone"].asInt() : 0;
|
||||||
file_path_ = fmt::format("/sys/class/thermal/thermal_zone{}/temp", zone);
|
file_path_ = fmt::format("/sys/class/thermal/thermal_zone{}/temp", zone);
|
||||||
|
Loading…
Reference in New Issue
Block a user