Add RAII listener blocking utility

* Added for ToolPanel listener and Adjuster
* Follows style of ConnectionBlocker for sigc::connection
This commit is contained in:
Daniel Gao
2024-11-07 11:31:59 -05:00
parent 03a73eb3a4
commit b472fbf2ab
2 changed files with 52 additions and 0 deletions

View File

@@ -45,7 +45,9 @@ struct CropParams;
}
class Adjuster;
class RTImage;
class ToolPanel;
Glib::ustring escapeHtmlChars(const Glib::ustring &src);
bool removeIfThere (Gtk::Container* cont, Gtk::Widget* w, bool increference = true);
@@ -161,6 +163,26 @@ private:
bool wasBlocked;
};
class BlockAdjusterEvents
{
public:
explicit BlockAdjusterEvents(Adjuster* adjuster);
~BlockAdjusterEvents();
private:
Adjuster* adj;
};
class DisableListener
{
public:
explicit DisableListener(ToolPanel* panelToDisable);
~DisableListener();
private:
ToolPanel* panel;
};
/**
* @brief Glue box to control visibility of the MyExpender's content ; also handle the frame around it
*/