X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetCollapsible.cpp;h=a0a789cc6759416bd14f50b149928c8809870bf1;hb=8124e6c02ea1fd6779bb6c47ffe2bca2c8bd2d97;hp=d629aaaca40d51e80e5a7e773563b480fee8aa8b;hpb=04ece4f0d6af818b3bc572b558181b947a109580;p=lyx.git diff --git a/src/insets/InsetCollapsible.cpp b/src/insets/InsetCollapsible.cpp index d629aaaca4..a0a789cc67 100644 --- a/src/insets/InsetCollapsible.cpp +++ b/src/insets/InsetCollapsible.cpp @@ -191,8 +191,11 @@ Dimension InsetCollapsible::dimensionCollapsed(BufferView const & bv) const int const offset = Inset::textOffset(&bv); theFontMetrics(labelfont).buttonText( buttonLabel(bv), offset, dim.wid, dim.asc, dim.des); - // remove spacing on the right for left buttons - if (geometry(bv) == LeftButton) + // remove spacing on the right for left buttons; we also do it for + // TopButton (although it is not useful per se), because + // openinlined_ is not always set properly at this point. + Geometry const geom = geometry(bv); + if (geom == LeftButton || geom == TopButton) // this form makes a difference if offset is even dim.wid -= offset - offset / 2; return dim; @@ -424,7 +427,7 @@ void InsetCollapsible::cursorPos(BufferView const & bv, switch (geometry(bv)) { case LeftButton: - x += dimensionCollapsed(bv).wid; + x += dimensionCollapsed(bv).wid - leftOffset(&bv) / 2; break; case TopButton: { y += dimensionCollapsed(bv).des + textdim.asc;