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 Sep 13, 2024
1 parent d177969 commit bf2f16f
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 @@ -33,6 +33,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 @@ -50,6 +51,7 @@ class AModule : public IModule {
private:
bool handleUserEvent(GdkEventButton *const &ev);
const bool isTooltip;
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 @@ -15,6 +15,9 @@ AModule::AModule(const Json::Value& config, const std::string& name, const std::
: name_(name),
config_(config),
isTooltip{config_["tooltip"].isBool() ? config_["tooltip"].asBool() : true},
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 @@ -274,6 +277,8 @@ bool AModule::handleScroll(GdkEventScroll* e) {

bool AModule::tooltipEnabled() const { return isTooltip; }

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

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

} // namespace waybar

0 comments on commit bf2f16f

Please sign in to comment.