Commit Graph

72301 Commits

Author SHA1 Message Date
Paul Cornett
c10a70be67 Fix GTK version check 2022-03-25 12:01:12 -07:00
Paul Cornett
b3b43ad15b Fix drawing of TLW with wxBG_STYLE_TRANSPARENT on GTK
Default drawing of the background has to be disabled.
See #18592
2022-03-25 12:00:07 -07:00
Vadim Zeitlin
80a056a58b Improve "shaped" sample documentation
Also link to it from the functions shown in this sample.
2022-03-25 01:54:11 +01:00
Vadim Zeitlin
fffe5af903 Document SetTransparent() limitation under wxGTK
The first call to this function must happen before showing the window.
2022-03-25 01:48:16 +01:00
Vadim Zeitlin
279af795ed Make transparency window in the shaped sample work under MSW
Still show transparent window even if IsTransparentBackgroundSupported()
returns false, just don't make their background transparent and only use
SetTransparent() in this case. In fact, don't try to use transparent
background style at all by default and add a separate menu item to do it
if wanted.

Also add a slider to allow changing opacity of the window.

Finally, make the window big enough in high DPI under MSW by using
FromDIP().
2022-03-25 01:46:24 +01:00
Vadim Zeitlin
58800c09e4 Merge branch 'misc-dpi'
A couple of high DPI-related fixes.

See #22229.
2022-03-25 00:49:24 +01:00
Vadim Zeitlin
16d8e61d28 Render "Close" bitmap button correctly in high DPI
Define a custom wxBitmapBundle to represent this bitmap in order to be
able to draw it at any required size instead of scaling up the bitmap in
high DPI.

See #18822.
2022-03-24 21:40:44 +01:00
Vadim Zeitlin
debd3f338b Use high DPI icons in wxInfoBarGeneric if appropriate
Just switch to using wxArtProvider::GetBitmapBundle() instead of
GetBitmap() which returned standard-sized bitmap that was upscaled
later.

See #18822.
2022-03-24 21:40:44 +01:00
Vadim Zeitlin
49de73c10d Add example of wxEVT_DPI_CHANGED handler to the display sample
Just to allow testing that this event is received as expected.

See #19130.
2022-03-24 21:40:44 +01:00
Vadim Zeitlin
a48859e20c Merge branch 'uilocale-fixes'
wxUILocale-related fixes.

See #22222.
2022-03-24 21:39:34 +01:00
Vadim Zeitlin
387981e373 Merge branch 'generic-dvc-fixes'
Fixes to generic wxDataViewCtrl under GTK.

See #22220.
2022-03-24 21:39:09 +01:00
Vadim Zeitlin
66c52326d5 Merge branch 'dvc-add-item-error' of https://github.com/thesiv/wxWidgets
Fix adding items to collapsed nodes of wxDataViewCtrl in wxGTK too.

See #22228.
2022-03-24 21:37:15 +01:00
Vadim Zeitlin
886f8e58f0 Merge branch 'artprov-sizehint-dips'
wxArtProvider::GetSizeHints() improvements: use DIPs and get rid of
"bool platform_dependent = false".

Closes #22224.
2022-03-24 21:36:20 +01:00
Vadim Zeitlin
cacfcb1e61 Allow ignoring revisions when viewing blame on GitHub
Rename the existing file with the revisions to ignore to the name used
by GitHub in order to allow using it there too.
2022-03-24 21:35:39 +01:00
Vadim Zeitlin
108108e54e Add wxArtProvider::Get[Native]DIPSizeHint()
Also add "wxWindow* win = NULL" argument to the existing functions to
convert from DIPs using the given window instead of the default DPI
scaling factor.

Closes #22022.
2022-03-24 21:35:26 +01:00
Ilya Sinitsyn
946ad457e9 Fix items adding to a collapsed node of DVC under GTK
Note that `wxDataViewCtrlInternal_FindNode()` was removed to access
protected `wxDataViewCtrlInternal::BuildBranch()`.
2022-03-25 02:43:45 +07:00
Paul Cornett
a1a883b8e8 Fix SetTransparent() with GTK3
An RGBA visual is required for it to work, which may not be the default.
See #18592
2022-03-24 12:09:00 -07:00
Ilya Sinitsyn
7966eaf268 Fix nodes duplication in the generic DVC implementation
Don't create a subtree in `FindNode()` and just return as the subtree
will be realized when a parent node will be expanded.
2022-03-25 01:05:09 +07:00
Ilya Sinitsyn
861313f0e9 Handle the nodes duplication error in the DVC test 2022-03-25 00:55:37 +07:00
Vadim Zeitlin
506f292be2 Deprecate wxArtProvider::GetSizeHint(bool) overload
This was confusing and completely unnecessary as the version with the
non-default value of the bool argument was just equivalent to calling
GetNativeSizeHint() directly, so why even bother having it.
2022-03-24 00:10:08 +01:00
Vadim Zeitlin
4e4b80760b Move wxArtProvider::DoGetSizeHint() out of line and simplify it
This function has no need to be inline and it can be written in a more
clear way by just calling GetNativeSizeHint() directly instead of
passing by GetSizeHint(true).
2022-03-24 00:05:01 +01:00
Vadim Zeitlin
ca4131faac Document wxArtProvider::DoGetSizeHint()
This virtual function seems to be meant to be overridden in the derived
classes and so part of the public API and hence should be documented.
2022-03-24 00:02:53 +01:00
Vadim Zeitlin
db9756c562 Enable ValNum::Interactive test for MSW CI builds too
This test should work after the fix in the parent commit.
2022-03-23 18:48:35 +01:00
Vadim Zeitlin
8bc606ba73 Don't cache locale-specific data in wxNumberFormatter
This cache was never updated and so could be wrong and not using it at
all is the simplest (although also the slowest) fix for this.

Notably, it could result in failures in ValNum::Interactive unit test
because the thousands separator was set to nothing during a previous
test execution, instead of the expected comma.

This commit is best viewed ignoring whitespace-only changes.
2022-03-23 18:46:55 +01:00
Vadim Zeitlin
4a9da949ce Set C locale for wxLANGUAGE_DEFAULT under Unix too
This had been done before all the recent wxUILocale-related changed and
was still done for non-Unix systems, but not there because we explicitly
skipped calling setlocale() in this case with a comment saying that the
default locale was already in use -- however this comment was wrong and
we do need to call setlocale(LC_ALL, "") in this case for compatibility
and consistency.

Closes #22212.
2022-03-23 16:10:40 +01:00
taler21
af9e7fd460 Fix truncation of translated "Finish" button label in wxWizard
Ensure that the button is wide enough to show both "Next" and "Finish"
and also make all the buttons of the same size, as they look better like
this.

Co-authored-by: Vadim Zeitlin <vadim@wxwidgets.org>

Closes #22200.

Closes #22221.
2022-03-23 15:56:03 +01:00
Vadim Zeitlin
5f011b84c1 Merge branch 'tz-parse' of https://github.com/lanurmi/wxWidgets
Parse more time sonzes in wxDateTime::ParseDataTime().

See #22217.
2022-03-23 14:38:58 +01:00
Vadim Zeitlin
d77fd33e66 Merge branch 'imagelist-scale-factor'
Scale factor-related fixes to wxImageList and Mac wxDataViewCtrl.

See #22211.
2022-03-23 13:59:46 +01:00
Andriy Byelikov
3900ece2ee Renormalize .vcxproj.filters files
This fixes the problem with inconsistent file formats in the repository
apparently introduced in e3535d6481 (Mark MSVS *.vcxproj.filters files
as using CR LF as well, 2021-11-24), which resulted in the files changed
by this commit (sometimes) appearing modified in new clones.

Closes #22214.
2022-03-23 13:57:52 +01:00
Vadim Zeitlin
b91173f76e Fix comparing wxDataFormat with wxDF_INVALID in wxGTK
Define wxDataFormat::operator==(wxDataFormatId) instead of relying on
the implicit conversion from wxDataFormatId to wxDataFormat, as this
can't be done when the format ID is wxDF_INVALID because creating
wxDataFormat results in an assert failure in this case, while comparing
with wxDF_INVALID is clearly a perfectly valid operation.

Add a unit test checking for this.

Closes #22213.
2022-03-23 13:43:44 +01:00
Vadim Zeitlin
09a472e3ef Hide wxGenericDataViewCtrl helpers in anonymous namespace
This is a good idea anyhow, as these classes don't need to have extern
linkage and so shouldn't have it, and it also fixes some gcc 11
-Wsubobject-linkage warnings.
2022-03-23 13:35:41 +01:00
Vadim Zeitlin
83daf02f35 Update wxImageList documentation to mention high DPI concerns
First of all, document that this class is (informally) deprecated.

Also document that the various sizes are expressed in logical pixels.
2022-03-22 23:02:25 +01:00
Vadim Zeitlin
1a8906206e Use appropriately sized bitmaps in wxOSX wxDataViewCtrl
Select the bitmap of the required size from wxBitmapBundle instead of
selecting the bitmap with the default size and then possibly rescaling
it to get the bitmap of the needed size, resulting in fuzzy-looking
bitmaps.

Closes #22189.
2022-03-22 23:02:25 +01:00
Vadim Zeitlin
cc02b3cece Revert "Assure that all images in the generic wxImageList have the same scale factor"
This reverts commit b6d305e4f2 because
silently discarding images using a different scale factor is simply too
user-unfriendly: this can silently break the existing code, i.e. it can
still compile perfectly and not give any errors during run-time but not
show any images neither.

Also revert most of dc43d15cf7 (Add tests of storing HiDPI images in
generic wxImageList (wxOSX, wxGTK3), 2021-04-05) as these tests don't
pass any longer because the behaviour was intentionally changed.

See #22189.
2022-03-22 23:01:40 +01:00
Vadim Zeitlin
d9a48edc81 Restore the old default size of Tango art provider bitmaps
The default size of the bitmaps created from bitmap bundles returned by
the Tango art provider for the client strings different from wxART_MENU
and wxART_BUTTON was changed from 24x24 to 16x16 in 766fefeb34 (Use SVG
instead of PNGs in tango art provider, 2022-01-27), see #22067, without
any real need and perhaps even non intentionally at all.

Restore the old default size to restore the old behaviour.

See #22189.
2022-03-22 23:01:40 +01:00
Lauri Nurmi
fdd05c8b8b Parse also time zone in ParseDateTime(), if found
Accept the same kind of time zone specifiers that RFC822 timestamps
accept; most importantly the "+0200" style.

Added more tests, and changed the way tests compare dates:
Since some timestamps now specify a time zone, those need to be compared
as UTC to avoid the system's time zone affecting the tests. Others can
still be compared as local time, as before.
2022-03-22 19:12:48 +02:00
Lauri Nurmi
136b1713e1 Refactor time zone parsing into a separate function from ParseRfc822Date()
For now, the new function is private and undocumented.
2022-03-22 19:12:45 +02:00
Lauri Nurmi
770cf26afe Fix out-of-bounds with military and truncated time zones; add more tests
Out-of-bounds was already covered by the fact that the date is appended 32
zero-bytes in ParseRFC822Date() as a safety measure. But now the time zone
parsing section of the function no longer relies on those extra zeros
being present.

Added tests for RFC822 timestamps with military time zones, and more types
of truncated, invalid time zone specifiers.
2022-03-22 19:11:22 +02:00
Lauri Nurmi
89eec3cb80 Fix truncated time zone specifier tests for ParseRFC822Date()
Correction to the commit:
2153ffc (Test ParseRFC822Date() with truncated time zone specifiers,
2022-03-19)

The inputs failed as expected, but due to an unrelated reason (missing
comma).
2022-03-22 19:09:23 +02:00
Paul Cornett
6a3ccabf11 Fix unused parameter warning with GTK2 2022-03-21 12:22:26 -07:00
Paul Cornett
b4475c881a Avoid some -Wduplicated-branches warnings 2022-03-21 11:54:30 -07:00
Paul Cornett
e9e1023393 Simplify wxGtkImage scale handling
Since wxGtkImage is a GtkWidget, we can get the scale directly from it,
no need for an associated wxWindow pointer just to get the scale.
2022-03-21 11:52:01 -07:00
Vadim Zeitlin
7b8d40666b Add wxART_QUIT icon to Tango art provider
Gnome uses a variant of the "log out" icon for its standard "Exit" icon,
so it should be fine for us to do it too, contrary to what the comment
from back when Tango provider was added in c1d2466a79 (Add wxArtProvider
using Tango icons., 2010-12-31) was saying.
2022-03-20 21:52:25 +01:00
Vadim Zeitlin
616e7c8842 Update menu bitmaps when invoking window is set in wxOSX
Changing invoking window always needs to update the bitmaps because
the scale factor may need to be changed if this window is on a different
display, using different scaling, so do it automatically whenever
SetInvokingWindow() is called instead of having to remember to call
SetupBitmaps() manually everywhere SetInvokingWindow() is.

This required making the base class function virtual, but allows to get
rid of SetupBitmaps() call in wxWindow::DoPopupMenu(), as it can now
rely on this being already done by wxWindowBase::PopupMenu().
2022-03-20 17:34:51 +01:00
Vadim Zeitlin
53938a85d3 Fix wxTaskBarIconWindow::GetContentScaleFactor() in wxOSX
Don't crash if this function is called (which is not the case yet, but
will be after the upcoming commit, when it's going to be implicitly used
when updating the bitmaps for taskbar icon menu), but return the content
scale factor for the main screen, which should be the right thing to do
here.
2022-03-20 17:34:51 +01:00
Vadim Zeitlin
5eab94b7d6 Reuse wxMenuInvokingWindowSetter in wxOSX wxTaskBarIcon code
No real changes, just reuse the existing helper class doing the same
thing the code here was doing manually.
2022-03-20 17:17:11 +01:00
Vadim Zeitlin
b5cb056a03 Don't draw focus around AUI tabs under macOS
This currently doesn't work there because the focus rectangle doesn't
fit into the space reserved for it (which is a bug on its own, probably)
and would look very out of place even if it did work because the native
tabs don't use focus rectangle for the selected tab.

Closes #22190.
2022-03-20 16:21:35 +01:00
Vadim Zeitlin
4e885516b9 Update libpng and libtiff to fix warnings with latest clang
Get rid of -Wunused-but-set-variable in these libraries code given by
Apple clang version 13.1.6.

No real changes.
2022-03-20 16:01:31 +01:00
Vadim Zeitlin
65edeac31c Merge branch 'tbar-sample-fixes'
Fixes for changing toolbar icons style in wxMSW and toolbar sample.

See #22209.

Closes #22199.
2022-03-20 14:55:59 +01:00
Vadim Zeitlin
cf46f8809e Don't ignore custom formats in wxDataViewCtrl::EnableDropTarget()
Since the changes of 7129d2b11c (Accept multiple data formats via
drag-and-drop in wxDataViewCtrl, 2021-08-22) custom data formats were
simply ignored because CreateDataObject() helper didn't do anything for
them.

Fix this by simply continuing to handle them in the same way as before,
i.e. by creating a wxCustomDataObject for the specified format.

Closes #22112.
2022-03-20 14:53:56 +01:00