Simplify GTK+ 2 version checks with a helper function
Use wx_is_at_least_gtk2(minor) instead of gtk_check_version(2, minor) because it is more clear and also works as expected (i.e. returns true) when using GTK+ 3 instead of creating difficult to notice bugs in the code by failing the version check in this case. See #18004.
This commit is contained in:
@@ -123,7 +123,7 @@ void wxControl::PostCreation(const wxSize& size)
|
||||
void wxControl::GTKFixSensitivity(bool WXUNUSED_IN_GTK3(onlyIfUnderMouse))
|
||||
{
|
||||
#ifndef __WXGTK3__
|
||||
if (gtk_check_version(2,14,0)
|
||||
if (!wx_is_at_least_gtk2(14)
|
||||
#if wxUSE_SYSTEM_OPTIONS
|
||||
&& (wxSystemOptions::GetOptionInt(wxT("gtk.control.disable-sensitivity-fix")) != 1)
|
||||
#endif
|
||||
@@ -348,7 +348,7 @@ wxPoint wxControl::GTKGetEntryMargins(GtkEntry* entry) const
|
||||
#if GTK_CHECK_VERSION(2,10,0)
|
||||
// The margins we have previously set
|
||||
const GtkBorder* border = NULL;
|
||||
if (gtk_check_version(2,10,0) == NULL)
|
||||
if (wx_is_at_least_gtk2(10))
|
||||
border = gtk_entry_get_inner_border(entry);
|
||||
|
||||
if ( border )
|
||||
|
Reference in New Issue
Block a user