Using GTKGetPreferredSize() doesn't always seem to return the correct
values, resulting in making the control too big, so just hard code the
smaller margins there.
Additionally implement wxWebViewEdge::GetUserAgent() via SDK.
This functionality is available with the slightly newer
WebView2 SDK required by previous changes.
See #23225.
Fix wxUILocale::GetLocalizedName(wxLOCALE_FORM_ENGLISH) to actually
returns the names in English by using the en-US locale for obtaining
them.
Closes#23190.
Co-Authored-by: Lauri Nurmi <lanurmi@iki.fi>
As we don't call IncreaseSizeForText() in the ctor any longer, redo the
same check there too.
Also prefer using GetClientSize() to GetSize() for determining the
available size, the difference is not big, but the former is more
correct.
This is identical to 44e9218e03 (Don't always increase height in
DoGetSizeFromTextSize(), 2023-02-02) for wxGTK and ensures that we don't
make the returned height too big when a valid height is specified on
input.
The documentation for wxChoiceBook discusses using this method, but it
was not previously documented.
See #23211.
Co-Authored-By: Vadim Zeitlin <vadim@wxwidgets.org>
Similar items were added context in d85f0e311d (Use translation context
for standard OSX menu items, 2022-05-02) but some were missed back then.
The context primarily serves as a translator comment, informing that these
are indeed OSX menu item names, and not something else.
Also to match the established translations of OSX itself, for some
languages these may need to be translated using particular terminology
different than on other platforms.
See #23213.
When wxWidgets itself is embedded into another repository as a
submodule, it may not be obvious that the given command must be run from
wxWidgets subdirectory and not the top-level repository itself, so make
it more explicit.
Use vertical component of the size returned from GetSizeFromTextSize()
too, not only the horizontal one, to ensure we make the control tall
enough to fit its contents.
This actually makes the height returned from it smaller, as these
margins are negative (at least with GTK 3), but this works well with the
size returned by GTKGetPreferredSize() which would be too big otherwise,
as it seems to include the margins around the control too.
The intention here almost certainly was to use at least the specified
height, not to always add something to it at the end for no apparent
reason, so do this instead.
Use GetSizeFromText() when computing the increased size after the text
changes and do it from wxEVT_CHAR handler rather than in wxEVT_KEY_UP
one in order to be able to account for the newly entered character
correctly.
wxGraphicsContext::ResetClip (wxOSX)
Using native CGContextResetClip() to reset the clip causes some
drawing glitches - especially with drawing text with CT - see
https://github.com/wxWidgets/wxWidgets/issues/22629#issuecomment-1399554002
For the time being we have to revert to the previous code
with emulated resetting based on restoring the graphics context state.
We also have to disable a unit tests that fails with emulated
resetting the clip.
See #22629.