Commit graph

76206 commits

Author SHA1 Message Date
Alex Shvartzkop
1b7727d058 Limit rounded rectangle radius in GTK wxWindowDCImpl. 2024-02-16 01:18:15 +03:00
Alex Shvartzkop
922a15328e Limit rounded rectangle radius in graphics path. 2024-02-16 01:09:54 +03:00
Vadim Zeitlin
47b011c665 Merge branch 'qt-bgcol-fixes'
Make setting background colour in wxQt more consistent with the other
ports and fix it for wxSearchCtrl.

Closes #23170, #24315.
2024-02-13 22:03:35 +01:00
Alex Shvartzkop
9b97d3a308 Fix generic wxSearchCtrl background colour in wxQt
Set the background colour of the whole control to the text control
background colour.
2024-02-13 21:55:35 +01:00
Alex Shvartzkop
253cfa3a31 Use white background brush by default in wxQt too
Just as this is done in the other ports.

This commit is best viewed with Git --color-moved option.
2024-02-13 21:54:07 +01:00
Alex Shvartzkop
4be5fde721 Don't handle unset background colour as black in wxQt
Unset background colour actually means to use the default one, which is
still not the case for wxQt if the background had been previously
changed, but at the very least it doesn't change it to black any longer.

This commit is best viewed ignoring whitespace-only changes.
2024-02-13 21:49:53 +01:00
Vadim Zeitlin
4a5de60fa9 Merge branch 'wxqt-2' of https://github.com/dsa-t/wxWidgets
More miscellaneous wxQt fixes.

See #24309.
2024-02-13 21:43:48 +01:00
Vadim Zeitlin
19038ea58f Merge branch 'minor-pg-fixes'
Minor wxPropertyGrid fixes, notably fixing the expander buttons
appearance in high DPI under MSW.

See #24304.
2024-02-13 21:40:27 +01:00
Vadim Zeitlin
e00e6dcd81 Merge branch 'qt-msgdlg-ext'
Add support for extended messages and custom button labels to
wxMessageDialog in wxQt.

See #24243, #24299.
2024-02-13 21:38:43 +01:00
Vadim Zeitlin
01ffca369c Merge branch 'translation-lookup-fixes' of https://github.com/vslavik/wxWidgets
Restore correct translation language lookup taking into account message
IDs language correctly when it is present in the preferred UI languages
but is not the first language in them and other similar corner cases.

Also add unit tests verifying that this code logic, already changed many
times in the past, does behave correctly now.

See #24297.
2024-02-13 21:34:00 +01:00
Vadim Zeitlin
79ac049d74 Merge branch 'wxqt-1' of https://github.com/dsa-t/wxWidgets
Make wxGLCanvas work in wxQt and fix possible crashes in wxComboBox and
wxStatusBar in this port.

See #24200.
2024-02-13 21:29:24 +01:00
Vadim Zeitlin
d3731c86ed Merge branch 'aui_splitter_overlay'
Use wxOverlay to show sash feedback in wxAUI and in wxSplitterWindow to
implement non-live resizing in ports where it didn't work before (wxGTK3
with Wayland, wxOSX).

See #24193.
2024-02-13 21:23:47 +01:00
taler21
716bf59449 Ensure full label is shown after editing it in generic wxListCtrl
The list control needs to be updated after the user has edited an item
label because, for example, in icon view the column width and positions
of subsequent columns may change if the edited label is or was wider
than the icons and other labels in the column.

Closes #24311.
2024-02-13 21:17:07 +01:00
Blake-Madden
b12977cb75 Fix minor problems in wxWebRequest documentation
Add missing "true" and consistently use "@true" alias for it.

Reword explanation about what "peer verification" means.

Closes #24300.
2024-02-13 21:10:18 +01:00
Blake-Madden
4e03291de2 Only add padding for shown panels on ribbon
When laying out panels on a ribbon, don't add padding for panels that
won't be drawn and used in the layout calculations.

Closes #24296.
2024-02-13 21:09:25 +01:00
Václav Slavík
6d48acb5f3 Add unit tests for wxTranslations language lookup 2024-02-13 18:24:43 +01:00
Václav Slavík
1f658ff729 Override GetPreferredUILanguages with WXLANGUAGE
Add support for overriding GetPreferredUILanguages() return value by
setting the WXLANGUAGE environment variable to a colon-separated list
of desired languages (same as GNU's LANGUAGE variable).

Primarily used for unit tests, but may be more generally useful.
2024-02-13 18:23:06 +01:00
Václav Slavík
f248f0593c Clarify GetAvailableTranslations() return value
Add a note explaining that the msgid language is not included.
2024-02-13 16:12:57 +01:00
Václav Slavík
f0ed987010 Warn about a GetBestAvailableTranslation() quirk 2024-02-13 16:12:57 +01:00
Václav Slavík
1030147aff Fix AddAvailableCatalog() API
Knowing msgIdLanguage is necessary for correct evaluation of preferred
languages order; without it, it would be possible to load undesirable
translation file.

See 2af36e9560 for details.
2024-02-13 16:12:56 +01:00
Václav Slavík
2af36e9560 Partially revert "Add AddAvailableCatalog() and use it in AddStdCatalog()"
This commit partially reverts 94b1a17aeb.

The above commit changed translation lookup logic to differentiate
between msgid and "available" translations (the latter being loaded from
a file or resource). It first attempted to use available translations
and only felt back to msgid language as the last resort.

Unfortunately, doing that broke lookup in cases when the user had msgid
language as not-last preference in their UI languages list, or even when
a similar translation was available. For example:

- msgid=en, user preference [cs,en,fr], only fr.po available: fr would
  be used instead of en
- msgid=en_US or en, user preference [en], but en_GB.po available:
  British English would be used even for US users

This commit fixes this by restoring the previous behavior where msgid
language was treated as a first-class citizen in lookup, while
preserving the API that allows distinguishing between the two cases.

It also reimplements AddStdCatalog() in a more straightforward way that
doesn't rely on AddAvailableCatalog().
2024-02-13 16:12:38 +01:00
Vadim Zeitlin
acee397e4c Avoid implicit "this" capture in a lambda to avoid C++20 warning
Implicitly capturing "this" is deprecated in C++20, so do it explicitly,
even if it also requires explicitly capturing everything else as
combining implicit capture with explicitly capturing "this" is not
allowed in the previous C++ versions.
2024-02-13 02:39:56 +01:00
Vadim Zeitlin
4261e1d07d Erase overlay contents when resetting it in wxOSX
Without this, the old contents continues to be shown for some time
before the display was refreshed.
2024-02-13 01:00:48 +01:00
Vadim Zeitlin
0217f54894 Initialize wxOverlayImpl members in their declarations
Ensure that all member variables are initialized instead of initializing
just some of them in the ctor and leaving others uninitialized, it's
simpler to just do this rather than to check if uninitialized values can
or not be used.
2024-02-13 00:43:54 +01:00
Vadim Zeitlin
c4658ec8f2 Get rid of IsLive() helper in wxSplitterWindow code
This was useful when we had AlwaysUsesLiveResize() and the related
complications, but now that live resizing is governed solely by
wxSP_LIVE_UPDATE again, it's not needed any longer.

No real changes.
2024-02-12 22:27:25 +01:00
Vadim Zeitlin
7584c04ff8 Inline DrawResizeHint() function into its only caller
It seems to be more clear to just draw the sash in DrawSashTracker()
itself instead of calling a function which does it.
2024-02-12 22:25:39 +01:00
Vadim Zeitlin
c1325983cf Avoid using "x2" and "y2" for sash width and height
This was confusing, so get rid of these variables and use more clearly
named "posSash" and "sizeSash" instead.

No real changes.
2024-02-12 22:23:40 +01:00
Alex Shvartzkop
bff40b6cb6 Blend mask with alpha for wxCursor initialized from wxImage on wxQt. 2024-02-12 20:11:26 +03:00
Alex Shvartzkop
6aa928d624 Call base class in SetLabel for some widgets on wxQt. 2024-02-12 18:57:33 +03:00
Alex Shvartzkop
afa4294ef1 Support SetLabel/GetLabel for wxRadioBox/wxRadioButton on wxQt. 2024-02-12 18:57:33 +03:00
Alex Shvartzkop
7a0149dfcb Show popup menu at cursor on wxQt if needed. 2024-02-12 18:42:49 +03:00
Alex Shvartzkop
94e73dace5 Protect non-editable wxComboBox from nullptr on wxQt. 2024-02-12 15:34:56 +03:00
Alex Shvartzkop
8730858eae Fix wxStatusBar crash when calling GetFieldRect early on wxQt. 2024-02-12 15:34:56 +03:00
Alex Shvartzkop
966b6e9460 Improve wxQt OpenGL canvas implementation:
- Support wxGLContext::SetCurrent.
- Pass GL canvas attributes via ParseAttribList to handle defaults.
- Remove OpenGL not implemented message.
- Prevent QGLWidget from changing OpenGL state before we paint.
- Set Qt::StrongFocus for wxQtGLWidget to allow keyboard input.
- Use QtCanPaintWithoutActivePainter to fix wxPaintDCImpl assert when using wxGLCanvas.
2024-02-12 15:34:56 +03:00
Vadim Zeitlin
4b1a129f6f Give bigger initial size to the XRC window in propgrid sample
It was too small to show much of anything by default, especially in high
DPI.
2024-02-12 00:51:26 +01:00
Vadim Zeitlin
d445d79508 Don't leave a border around wxPropertyGrid in sample XRC file
This looks ugly under wxMSW where the frame doesn't have the same
background and isn't really necessary.
2024-02-12 00:50:35 +01:00
Vadim Zeitlin
770481613f Fix wxPropertyGrid expand buttons height in high DPI
It was too small, and twice (at 200% scaling) smaller than width,
resulting in tiny and ugly buttons.
2024-02-12 00:49:32 +01:00
Vadim Zeitlin
09fe965219 Add support for custom button labels to Qt wxMessageDialog
Just set the label if it's specified.
2024-02-11 13:53:24 +01:00
Vadim Zeitlin
f3260b3b16 Add support for extended message to Qt wxMessageDialog
After the refactoring of the previous commit it has become trivial to
handle this too.
2024-02-11 13:47:43 +01:00
Vadim Zeitlin
b960271f97 Allow changing wxMessageDialog after creating it
Refactor the code to use wxMessageDialog attributes (such as label,
style etc) values at the moment when the dialog is shown, not when it is
created. This still doesn't handle changing them after showing the
dialog before showing them again, but this is a much more rare use case
than creating the dialog and then setting its attributes later.

There should be no changes in behaviour.
2024-02-11 13:45:42 +01:00
Vadim Zeitlin
4b577f2932 Fix indentation in wxQtMessageDialog
No real changes.
2024-02-11 13:32:52 +01:00
Vadim Zeitlin
d8d562ba1d Remove unnecessary QMessageBox forward declaration from header
This is not used at all.
2024-02-11 13:28:53 +01:00
Vadim Zeitlin
6cc4662651 Don't call PostCreation() for wxMessageDialog
Other dialogs don't do it and it doesn't seem to be really useful for
them.
2024-02-11 13:26:03 +01:00
Vadim Zeitlin
57349c2aaa Fix wxSearchCtrl::GTKGetWindow() added in the previous commit
Use the usual indent and, more importantly, avoid the warning about
unused parameter in wxGTK2 builds which broke CI.
2024-02-11 01:35:01 +01:00
Václav Slavík
34a90ba3af Fix GetBestAvailableTranslation to return no match
GetBestTranslation() and GetBestAvailableTranslation() are documented to
return an empty string if they find no match, but actually didn't do
that due to the way GetPreferredUILanguage() was implemented to always
fall back to the locale and return it without additional checks.
2024-02-10 12:55:12 +01:00
AliKet
bad07efa70 wxAuiManager::AlwaysUsesLiveResize() documentation updated
This is no longer true as wxAUI now uses wxOverlay to display the resizing hint
in non-live resize mode, which should work on all platforms.
2024-02-09 23:26:37 +01:00
AliKet
29c8bfc249 Use wxOverlay to show docking hint instead of transparent wxFrame
The main advantage of using wxOverlay over wxFrame, besides reduced
code complexity, is that the docking hint now works correctly under
Wayland which it didn't work before.

wxAUI_MGR_RECTANGLE_HINT now works everywhere (including wxGTK and wxOSX)

We simply use a bitmap to draw the venetian blinds hint instead of the
exotic and esoteric code using wxRegion.

wxGTK2 now uses graphics context for transparency. If not available, the hint
will be drawn using wxINVERT raster operation mode.
2024-02-09 23:26:36 +01:00
ali kettab
7491ac5b7a Make wxAUI and wxSplitterWindow work properly with wxOverlay under wxGTK2
This Workaround is needed because the DC used to draw on the wxOverlay clips
children by default under wxGTK2. This means that the sash will always appear
behind the sub-windows. making wxOverlay worthless under this platforms.

Notice that calling gdk_gc_set_subwindow() unconditionally in Destroy() is cheap
when DontClipSubWindows() has never been called.
2024-02-09 23:26:36 +01:00
ali kettab
a38175885c Use wxOverlay to show sash feedback in non-live resize mode in wxSplitterWindow
Make non-live resizing possible on all supported platforms thanks to wxOverlay.
Previously, live resizing was the only supported mode under these platforms:
wxMac, wxQt and wxGTK3 under Wayland.

Also remove no longer needed function AlwaysUsesLiveUpdate and its documentation.
2024-02-09 23:26:36 +01:00
ali kettab
fafc714057 Use wxOverlay to show sash feedback in non-live resize mode in wxAUI
Make non-live resizing possible on all supported platforms thanks to wxOverlay.
Previously, live resizing was the only supported mode under these platforms:
wxMac, wxQt and wxGTK3 under Wayland.
2024-02-09 23:26:35 +01:00