commit e322f37c1df4bc2e7a6fabf1f0a65a70a2d7f55c
Author: Juergen Spitzmueller <[email protected]>
Date: Thu Feb 19 16:25:25 2026 +0100
Simplify InsetDynamicArgs::draw()
---
src/insets/InsetDynamicArgs.cpp | 21 ++++++++++++---------
src/insets/InsetDynamicArgs.h | 2 ++
2 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/src/insets/InsetDynamicArgs.cpp b/src/insets/InsetDynamicArgs.cpp
index 08f826f473..5f9e8ca7e2 100644
--- a/src/insets/InsetDynamicArgs.cpp
+++ b/src/insets/InsetDynamicArgs.cpp
@@ -51,20 +51,14 @@ void InsetDynamicArgs::draw(PainterInfo & pi, int x, int y)
const
return;
}
- BufferView const & bv = *pi.base.bv;
- Changer dummy = pi.base.font.change(getFont(), true);
// Draw button
- Dimension dimc = dimensionCollapsed(bv);
-
+ BufferView const & bv = *pi.base.bv;
FontInfo labelfont = getLabelfont();
labelfont.setColor(labelColor());
labelfont.realize(pi.base.font);
pi.pain.buttonText(x, y, buttonLabel(bv), labelfont,
- Color_commandbg, Color_commandframe,
Inset::textOffset(pi.base.bv));
- // Draw the change tracking cue on the label, unless RowPainter already
- // takes care of it.
- if (canPaintChange(bv))
- pi.change.paintCue(pi, x, y, x + dimc.width(), labelfont);
+ Color_commandbg, Color_commandframe,
+ Inset::textOffset(pi.base.bv));
}
@@ -156,6 +150,15 @@ bool InsetDynamicArgs::getStatus(Cursor & cur, FuncRequest
const & cmd,
}
+bool InsetDynamicArgs::canPaintChange(BufferView const & bv) const
+{
+ if (isButtonOnly())
+ return false;
+
+ return InsetCollapsible::canPaintChange(bv);
+}
+
+
InsetCollapsible::Geometry InsetDynamicArgs::geometry(BufferView const & bv)
const
{
if (isButtonOnly())
diff --git a/src/insets/InsetDynamicArgs.h b/src/insets/InsetDynamicArgs.h
index 8d8086b258..8f6df0108e 100644
--- a/src/insets/InsetDynamicArgs.h
+++ b/src/insets/InsetDynamicArgs.h
@@ -33,6 +33,8 @@ public:
///
Geometry geometry(BufferView const & bv) const;
///
+ bool canPaintChange(BufferView const & bv) const override;
+ ///
bool editable() const override;
/// can we go further down on mouse click?
bool descendable(BufferView const & bv) const override;
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs