- if ((x >= button_x) && (y >= button_top_y)) {
- InsetText::InsetMotionNotify(bv, x-top_x, y, button);
- }
+ if ((this == inset) && !owner())
+ return pain.paperWidth();
+ if (this == inset)
+ return static_cast<UpdatableInset*>(owner())->getMaxWidth(pain,inset);
+ if (owner())
+ return static_cast<UpdatableInset*>(owner())->getMaxWidth(pain,inset)-
+ width_collapsed(pain, labelfont) - widthOffset;
+
+ return pain.paperWidth()-width_collapsed(pain, labelfont) - widthOffset;
+}
+
+
+int InsetCollapsable::getMaxTextWidth(Painter & pain,
+ UpdatableInset const * inset) const
+{
+ return getMaxWidth(pain, inset) -
+ width_collapsed(pain, labelfont) - widthOffset;
+}
+
+
+void InsetCollapsable::update(BufferView * bv,
+ LyXFont const & font, bool dodraw)
+{
+ drawTextXOffset = width_collapsed(bv->painter(), font);
+ InsetText::update(bv, font, dodraw);