Use gtk_widget_set_opacity() with new enough wxGTK3
This function replaces gtk_window_set_opacity() and could presumably work better for the GTK+ versions supporting it. Also avoid deprecation warnings, if they're ever enabled later, for gtk_window_set_opacity() which we still have to use for older GTK+. Closes #17106.
This commit is contained in:
committed by
Vadim Zeitlin
parent
798ee9da83
commit
abd4d80ebe
@@ -1542,7 +1542,19 @@ bool wxTopLevelWindowGTK::SetTransparent(wxByte alpha)
|
||||
if (gtk_check_version(2,12,0) == NULL)
|
||||
#endif
|
||||
{
|
||||
gtk_window_set_opacity(GTK_WINDOW(m_widget), alpha / 255.0);
|
||||
#if GTK_CHECK_VERSION(3,8,0)
|
||||
if(gtk_check_version(3,8,0) == NULL)
|
||||
{
|
||||
gtk_widget_set_opacity(m_widget, alpha / 255.0);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
// Can't avoid using this deprecated function with older GTK+.
|
||||
wxGCC_WARNING_SUPPRESS(deprecated-declarations);
|
||||
gtk_window_set_opacity(GTK_WINDOW(m_widget), alpha / 255.0);
|
||||
wxGCC_WARNING_RESTORE();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#endif // GTK_CHECK_VERSION(2,12,0)
|
||||
|
Reference in New Issue
Block a user