From: Thomas Debesse Date: Tue, 26 May 2020 14:36:16 +0000 (+0200) Subject: Merge commit 'd079351041fe957ab2cf6b36dab38e5546003dc3' into garux-merge X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6352fbdd7968d7dffa2ba4c57ee5cade250e04ed;p=xonotic%2Fnetradiant.git Merge commit 'd079351041fe957ab2cf6b36dab38e5546003dc3' into garux-merge --- 6352fbdd7968d7dffa2ba4c57ee5cade250e04ed diff --cc radiant/brush.h index 2ee498c0,d26547e8..21988f37 --- a/radiant/brush.h +++ b/radiant/brush.h @@@ -3531,20 -3431,11 +3553,12 @@@ void testSelectComponents( Selector& se void selectPlanes( Selector& selector, SelectionTest& test, const PlaneCallback& selectedPlaneCallback ){ test.BeginMesh( localToWorld() ); - PlanePointer brushPlanes[c_brush_maxFaces]; - PlanesIterator j = brushPlanes; - - for ( Brush::const_iterator i = m_brush.begin(); i != m_brush.end(); ++i ) - { - *j++ = &( *i )->plane3(); - } - for ( FaceInstances::iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i ) { - ( *i ).selectPlane( selector, Line( test.getNear(), test.getFar() ), brushPlanes, j, selectedPlaneCallback ); + ( *i ).selectPlane( selector, Line( test.getNear(), test.getFar() ), selectedPlaneCallback ); } } + void selectReversedPlanes( Selector& selector, const SelectedPlanes& selectedPlanes ){ for ( FaceInstances::iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i ) { diff --cc radiant/filterbar.cpp index d6d9e8ed,22535702..d8fb9936 --- a/radiant/filterbar.cpp +++ b/radiant/filterbar.cpp @@@ -200,47 -193,37 +200,53 @@@ gboolean Hide_button_press( GtkWidget * return FALSE; } -GtkToolbar* create_filter_toolbar(){ - GtkToolbar* toolbar = GTK_TOOLBAR( gtk_toolbar_new() ); +ui::Toolbar create_filter_toolbar(){ + auto toolbar = ui::Toolbar::from( gtk_toolbar_new() ); + gtk_orientable_set_orientation( GTK_ORIENTABLE(toolbar), GTK_ORIENTATION_HORIZONTAL ); gtk_toolbar_set_style( toolbar, GTK_TOOLBAR_ICONS ); // gtk_toolbar_set_show_arrow( toolbar, TRUE ); - gtk_widget_show( GTK_WIDGET( toolbar ) ); - g_signal_connect( G_OBJECT( toolbar ), "enter_notify_event", G_CALLBACK( ToggleActions0 ), 0 ); + toolbar.show(); - GtkToggleButton* button; - toolbar_append_toggle_button( toolbar, "World (ALT + 1)", "f-world.png", "FilterWorldBrushes" ); - - button = toolbar_append_toggle_button( toolbar, "Structural (CTRL + SHIFT + D)\nRightClick: MakeStructural", "f-structural.png", "FilterStructural" ); - g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Structural_button_press ), 0 ); + auto space = [&]() { + auto btn = ui::ToolItem::from(gtk_separator_tool_item_new()); + btn.show(); + toolbar.add(btn); + }; - button = toolbar_append_toggle_button( toolbar, "Details (CTRL + D)\nRightClick: MakeDetail", "f-details.png", "FilterDetails" ); - g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Detail_button_press ), 0 ); + g_signal_connect( G_OBJECT( toolbar ), "enter_notify_event", G_CALLBACK( ToggleActions0 ), 0 ); - button = toolbar_append_toggle_button( toolbar, "Func_Groups\nRightClick: create func_group", "f-funcgroups.png", "FilterFuncGroups" ); - g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Func_Groups_button_press ), 0 ); + toolbar_append_toggle_button( toolbar, "World (ALT + 1)", "f-world.png", "FilterWorldBrushes" ); - toolbar_append_toggle_button( toolbar, "Patches (CTRL + P)", "patch_wireframe.png", "FilterPatches" ); - gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) ); + { + auto button = toolbar_append_toggle_button( toolbar, "Structural (CTRL + SHIFT + D)\nRightClick: MakeStructural", "f-structural.png", "FilterStructural" ); + g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Structural_button_press ), 0 ); + } - if ( g_pGameDescription->mGameType == "doom3" ) { - button = toolbar_append_toggle_button( toolbar, "Visportals (ALT + 3)\nRightClick: toggle tex\n\tnoDraw\n\tnoDrawNonSolid", "f-areaportal.png", "FilterVisportals" ); + { + auto button = toolbar_append_toggle_button( toolbar, "Details (CTRL + D)\nRightClick: MakeDetail", "f-details.png", "FilterDetails" ); + g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Detail_button_press ), 0 ); } - else{ - button = toolbar_append_toggle_button( toolbar, "Areaportals (ALT + 3)\nRightClick: toggle tex\n\tnoDraw\n\tnoDrawNonSolid", "f-areaportal.png", "FilterAreaportals" ); + + { + auto button = toolbar_append_toggle_button( toolbar, "Func_Groups\nRightClick: create func_group", "f-funcgroups.png", "FilterFuncGroups" ); + g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Func_Groups_button_press ), 0 ); + + toolbar_append_toggle_button( toolbar, "Patches (CTRL + P)", "patch_wireframe.png", "FilterPatches" ); } - g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Areaportals_button_press ), 0 ); + space(); + + { - auto button = toolbar_append_toggle_button( toolbar, "Areaportals (ALT + 3)\nRightClick: toggle tex\n\tnoDraw\n\tnoDrawNonSolid", "f-areaportal.png", "FilterAreaportals" ); - g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Areaportals_button_press ), 0 ); ++ if ( g_pGameDescription->mGameType == "doom3" ) { ++ auto button = toolbar_append_toggle_button( toolbar, "Areaportals (ALT + 3)\nRightClick: toggle tex\n\tnoDraw\n\tnoDrawNonSolid", "f-areaportal.png", "FilterVisportals" ); ++ g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Areaportals_button_press ), 0 ); ++ } ++ else{ ++ auto button = toolbar_append_toggle_button( toolbar, "Areaportals (ALT + 3)\nRightClick: toggle tex\n\tnoDraw\n\tnoDrawNonSolid", "f-areaportal.png", "FilterAreaportals" ); ++ g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Areaportals_button_press ), 0 ); ++ } + } toolbar_append_toggle_button( toolbar, "Translucent (ALT + 4)", "f-translucent.png", "FilterTranslucent" ); diff --cc radiant/texwindow.cpp index 6eab79a4,366019ca..f0e331c4 --- a/radiant/texwindow.cpp +++ b/radiant/texwindow.cpp @@@ -1767,12 -1666,14 +1767,14 @@@ void TextureBrowser_createContextMenu( gdk_event_get_time( (GdkEvent*)event ) ); } + void TextureBrowser_searchTags(); + -gboolean TreeViewTags_onButtonPressed( GtkWidget *treeview, GdkEventButton *event ){ +gboolean TreeViewTags_onButtonPressed( ui::TreeView treeview, GdkEventButton *event ){ if ( event->type == GDK_BUTTON_PRESS && event->button == 3 ) { GtkTreePath *path; - GtkTreeSelection* selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( treeview ) ); + auto selection = gtk_tree_view_get_selection(treeview ); - if ( gtk_tree_view_get_path_at_pos( GTK_TREE_VIEW( treeview ), event->x, event->y, &path, NULL, NULL, NULL ) ) { + if ( gtk_tree_view_get_path_at_pos(treeview, event->x, event->y, &path, NULL, NULL, NULL ) ) { gtk_tree_selection_unselect_all( selection ); gtk_tree_selection_select_path( selection, path ); gtk_tree_path_free( path );