]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
Merge commit 'd079351041fe957ab2cf6b36dab38e5546003dc3' into garux-merge
authorThomas Debesse <dev@illwieckz.net>
Tue, 26 May 2020 14:36:16 +0000 (16:36 +0200)
committerThomas Debesse <dev@illwieckz.net>
Tue, 26 May 2020 14:36:16 +0000 (16:36 +0200)
1  2 
radiant/brush.h
radiant/filterbar.cpp
radiant/selection.cpp
radiant/texwindow.cpp

diff --cc radiant/brush.h
index 2ee498c008220d6b68f9e0adc1be0d9dff08795b,d26547e8a2116d7aa7f4bea10bf00520fb2da669..21988f370d82f85e8989c34611e4f991495c462d
@@@ -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 )
        {
index d6d9e8ed05fb592d04cc4e5db52630d43a8bb10d,22535702717cccb5b15a54b20c82f4cdfc656c09..d8fb9936cc789d97468ba4e301cf3091d238a3d9
@@@ -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 );
  
-                               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 );
 +                      space();
 +
 +                      {
++                              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" );
  
Simple merge
index 6eab79a4d26ee7c2f92698ac57fbd3ab38171340,366019ca897ff8752b3a29ca721f779c82ea6dc8..f0e331c4f68f399e672bf5aa7f499d1ba9b1696f
@@@ -1767,12 -1666,14 +1767,14 @@@ void TextureBrowser_createContextMenu( 
                                        gdk_event_get_time( (GdkEvent*)event ) );
  }
  
 -gboolean TreeViewTags_onButtonPressed( GtkWidget *treeview, GdkEventButton *event ){
+ void TextureBrowser_searchTags();
 +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 );