X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=contrib%2Fbrushexport%2Fsupport.cpp;h=d227b5baa2c0fdd89e6ed62215bdca1a8e2edddc;hb=9dfae1c9b270ee369c6362903a9205b30751b95f;hp=b2586177d969bf0bbbc97f160dab52052d4954d6;hpb=0a6d5683b0cfa1a0bd7ef64bada105dbe4ddd6e1;p=xonotic%2Fnetradiant.git diff --git a/contrib/brushexport/support.cpp b/contrib/brushexport/support.cpp index b2586177..d227b5ba 100644 --- a/contrib/brushexport/support.cpp +++ b/contrib/brushexport/support.cpp @@ -4,30 +4,29 @@ #include "support.h" ui::Widget -lookup_widget(ui::Widget widget, - const gchar *widget_name ){ +lookup_widget(ui::Widget widget, + const gchar *widget_name) +{ ui::Widget parent{ui::null}; - for (;; ) - { - if ( GTK_IS_MENU( widget ) ) { - parent = ui::Widget::from(gtk_menu_get_attach_widget( GTK_MENU( widget ) )); - } - else{ - parent = ui::Widget::from(gtk_widget_get_parent(widget)); - } - if ( !parent ) { - parent = ui::Widget::from(g_object_get_data( G_OBJECT( widget ), "GladeParentKey" )); - } - if ( parent == NULL ) { - break; - } - widget = parent; - } + for (;;) { + if (GTK_IS_MENU(widget)) { + parent = ui::Widget::from(gtk_menu_get_attach_widget(GTK_MENU(widget))); + } else { + parent = ui::Widget::from(gtk_widget_get_parent(widget)); + } + if (!parent) { + parent = ui::Widget::from(g_object_get_data(G_OBJECT(widget), "GladeParentKey")); + } + if (parent == NULL) { + break; + } + widget = parent; + } - auto found_widget = ui::Widget::from(g_object_get_data( G_OBJECT( widget ), widget_name )); - if ( !found_widget ) { - g_warning( "Widget not found: %s", widget_name ); - } - return found_widget; + auto found_widget = ui::Widget::from(g_object_get_data(G_OBJECT(widget), widget_name)); + if (!found_widget) { + g_warning("Widget not found: %s", widget_name); + } + return found_widget; }