Skip to content

Commit

Permalink
Issue Alexays#3375: add tooltip-with-markup config flag to AModule
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertMueller2 committed Dec 7, 2024
1 parent e959f1d commit aac61c5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/AModule.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class AModule : public IModule {

SCROLL_DIR getScrollDir(GdkEventScroll *e);
bool tooltipEnabled() const;
bool tooltipMarkupEnabled() const;

const std::string name_;
const Json::Value &config_;
Expand All @@ -53,6 +54,7 @@ class AModule : public IModule {
bool handleUserEvent(GdkEventButton *const &ev);
const bool isTooltip;
const bool isExpand;
const bool isMarkupTooltip;
bool hasUserEvents_;
std::vector<int> pid_;
gdouble distance_scrolled_y_;
Expand Down
5 changes: 5 additions & 0 deletions src/AModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ AModule::AModule(const Json::Value& config, const std::string& name, const std::
config_(config),
isTooltip{config_["tooltip"].isBool() ? config_["tooltip"].asBool() : true},
isExpand{config_["expand"].isBool() ? config_["expand"].asBool() : false},
isMarkupTooltip{isTooltip && config_["tooltip-with-markup"].isBool()
? config_["tooltip-with-markup"].asBool()
: true},
distance_scrolled_y_(0.0),
distance_scrolled_x_(0.0) {
// Configure module action Map
Expand Down Expand Up @@ -276,6 +279,8 @@ bool AModule::handleScroll(GdkEventScroll* e) {
bool AModule::tooltipEnabled() const { return isTooltip; }
bool AModule::expandEnabled() const { return isExpand; }

bool AModule::tooltipMarkupEnabled() const { return isMarkupTooltip; }

AModule::operator Gtk::Widget&() { return event_box_; }

} // namespace waybar

0 comments on commit aac61c5

Please sign in to comment.