diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-11-05 11:03:43 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-11-05 13:34:23 +0100 |
commit | d13712200e2c0cfee56afb6796f35e0fd15186e1 (patch) | |
tree | 5716ebe404e475ced622900505707fdac1469b68 | |
parent | 55bdb61f5219ea93dee00ab1a8a9735ca2ea7976 (diff) |
gtk4: move find_image_widget into utilities
Change-Id: I9a0187ff26171eb2133ea7b46f3638729198c869
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124740
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | vcl/unx/gtk3/gtkinst.cxx | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index 9c0ee3c1144d..3469ff87049b 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -4515,6 +4515,27 @@ namespace } return pLabel; } + + GtkWidget* find_image_widget(GtkWidget* pContainer) + { + GtkWidget* pImage = nullptr; + for (GtkWidget* pChild = gtk_widget_get_first_child(pContainer); + pChild; pChild = gtk_widget_get_next_sibling(pChild)) + { + if (GTK_IS_IMAGE(pChild)) + { + pImage = pChild; + break; + } + else + { + pImage = find_image_widget(pChild); + if (pImage) + break; + } + } + return pImage; + } #else GtkWidget* find_label_widget(GtkContainer* pContainer) { @@ -9908,29 +9929,6 @@ private: gtk_widget_show(GTK_WIDGET(m_pImage)); } -#if GTK_CHECK_VERSION(4, 0, 0) - static GtkWidget* find_image_widget(GtkWidget* pContainer) - { - GtkWidget* pImage = nullptr; - for (GtkWidget* pChild = gtk_widget_get_first_child(pContainer); - pChild; pChild = gtk_widget_get_next_sibling(pChild)) - { - if (GTK_IS_IMAGE(pChild)) - { - pImage = pChild; - break; - } - else - { - pImage = find_image_widget(pChild); - if (pImage) - break; - } - } - return pImage; - } -#endif - static void find_image(GtkWidget *pWidget, gpointer user_data) { GtkImage **ppImage = static_cast<GtkImage**>(user_data); |