add a special bool option that prevents redrawing

This commit is contained in:
Robin Gareus
2014-09-02 16:16:36 +02:00
parent 9ecdb765aa
commit 538a569d0b
2 changed files with 24 additions and 3 deletions

View File

@@ -28,6 +28,7 @@
#include "ardour/dB.h"
#include "ardour/session.h"
#include "public_editor.h"
#include "option_editor.h"
#include "gui_thread.h"
#include "i18n.h"
@@ -139,6 +140,18 @@ BoolOption::toggled ()
_set (_button->get_active ());
}
RouteDisplayBoolOption::RouteDisplayBoolOption (string const & i, string const & n, sigc::slot<bool> g, sigc::slot<bool, bool> s)
: BoolOption (i, n, g, s)
{
}
void
RouteDisplayBoolOption::toggled ()
{
DisplaySuspender ds;
BoolOption::toggled ();
}
EntryOption::EntryOption (string const & i, string const & n, sigc::slot<string> g, sigc::slot<bool, string> s)
: Option (i, n),
_get (g),

View File

@@ -169,11 +169,11 @@ public:
_button->set_sensitive (yn);
}
Gtk::Widget& tip_widget() { return *_button; }
Gtk::Widget& tip_widget() { return *_button; }
private:
protected:
void toggled ();
virtual void toggled ();
sigc::slot<bool> _get; ///< slot to get the configuration variable's value
sigc::slot<bool, bool> _set; ///< slot to set the configuration variable's value
@@ -181,6 +181,14 @@ private:
Gtk::Label* _label; ///< label for button, so we can use markup
};
class RouteDisplayBoolOption : public BoolOption
{
public:
RouteDisplayBoolOption (std::string const &, std::string const &, sigc::slot<bool>, sigc::slot<bool, bool>);
protected:
virtual void toggled ();
};
/** Component which allows to add any GTK Widget - intended for single buttons and custom stateless objects */
class FooOption : public OptionEditorComponent
{