mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-25 17:44:59 +00:00
Fixup 04ece4f0: handle case where openinlined_ is not set
When computing the width of the button, some code has been added in 04ece4f0 to shorten the space in LeftButton geometry. It turns out that the Left/Top-button-ness is not always known at this point (since it depends on the width itself!). Therefore, it is better to make the button narrower also in the TopButton case.
This commit is contained in:
parent
a3d58d2884
commit
e181474e6c
@ -191,8 +191,11 @@ Dimension InsetCollapsible::dimensionCollapsed(BufferView const & bv) const
|
|||||||
int const offset = Inset::textOffset(&bv);
|
int const offset = Inset::textOffset(&bv);
|
||||||
theFontMetrics(labelfont).buttonText(
|
theFontMetrics(labelfont).buttonText(
|
||||||
buttonLabel(bv), offset, dim.wid, dim.asc, dim.des);
|
buttonLabel(bv), offset, dim.wid, dim.asc, dim.des);
|
||||||
// remove spacing on the right for left buttons
|
// remove spacing on the right for left buttons; we also do it for
|
||||||
if (geometry(bv) == LeftButton)
|
// 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
|
// this form makes a difference if offset is even
|
||||||
dim.wid -= offset - offset / 2;
|
dim.wid -= offset - offset / 2;
|
||||||
return dim;
|
return dim;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user