]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetcommand.C
* src/LyXAction.C: mark goto-clear-bookmark as working without buffer
[lyx.git] / src / insets / insetcommand.C
index 7fdedd2c8065b0b18a3fe5a0bea8d29505eefc67..6d5248844b923d5650941ffb563ea74feb0313ae 100644 (file)
@@ -35,6 +35,7 @@ InsetCommand::InsetCommand(InsetCommandParams const & p,
                           string const & mailer_name)
        : p_(p),
          mailer_name_(mailer_name),
+         mouse_hover_(false),
          updateButtonLabel_(true)
 {}
 
@@ -46,7 +47,7 @@ InsetCommand::~InsetCommand()
 }
 
 
-void InsetCommand::metrics(MetricsInfo & mi, Dimension & dim) const
+bool InsetCommand::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        if (updateButtonLabel_) {
                updateButtonLabel_ = false;
@@ -54,13 +55,23 @@ void InsetCommand::metrics(MetricsInfo & mi, Dimension & dim) const
                               editable() != NOT_EDITABLE);
        }
        button_.metrics(mi, dim);
+       bool const changed = dim_ != dim;
        dim_ = dim;
+       return changed;
+}
+
+
+bool InsetCommand::setMouseHover(bool mouse_hover)
+{
+       mouse_hover_ = mouse_hover;
+       return true;
 }
 
 
 void InsetCommand::draw(PainterInfo & pi, int x, int y) const
 {
        setPosCache(pi, x, y);
+       button_.setRenderState(mouse_hover_);
        button_.draw(pi, x, y);
 }