diff options
author | Justin Luth <jluth@mail.com> | 2023-07-10 15:27:29 -0400 |
---|---|---|
committer | Justin Luth <jluth@mail.com> | 2023-07-18 01:22:41 +0200 |
commit | 1876feb8a8805b2f80537e2828c152ccbdf67fe2 (patch) | |
tree | 940a63fd50ca5dbda9977d6a6753ef2ec2d075f3 /include | |
parent | ef1484c731140699f26d15f4cda36f1a81e73abe (diff) |
tdf#136905 NBB: let ValueSetWithTextControl set optimal height
There was no way to specify a "good font size" to use
for .uno:AttributePageSize in the notebookbar.
The font "resized to match to size of the box"
which is hard-coded to aSize(250, 300).
(Even if ValueSet::SetOptimalSize worked, it would set an
inadequate height.)
So it seems like the best thing to do is simply add a function
that allows the box height to be modified.
Using the fontsize from GetDefaultFont is not correct.
Use the OS-defined label font size instead, which seems to be
the most common choice - GetPushButtonFont would has also worked.
I verified that the label font size is controled by
the OS' font preference.
The ability to define the box's optimal height
is still (somewhat) necessary. It isn't good enough
to just "use the system font size".
I tested with an OS font size of 48 (instead of 11),
and in that case the box height was too small
(but with the font only using 4/9's of a 12pt space,
even a 24pt font looked OK without adjusting optimal height).
Change-Id: I0a0774dea9c2a6c21a8e84439318a94f39783413
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154286
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/svx/sidebar/ValueSetWithTextControl.hxx | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/svx/sidebar/ValueSetWithTextControl.hxx b/include/svx/sidebar/ValueSetWithTextControl.hxx index ac397f9fdab6..407e9606757f 100644 --- a/include/svx/sidebar/ValueSetWithTextControl.hxx +++ b/include/svx/sidebar/ValueSetWithTextControl.hxx @@ -40,6 +40,7 @@ public: SVX_DLLPRIVATE virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; + void SetOptimalDrawingAreaHeight(); void AddItem(const OUString& rItemText, const OUString& rItemText2); SVX_DLLPRIVATE virtual void UserDraw(const UserDrawEvent& rUDEvt) override; |