]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
Merge commit '322b0c2ee485a5d787c60bfd34e5ed5567d98ec8' into garux-merge
authorThomas Debesse <dev@illwieckz.net>
Mon, 25 May 2020 23:50:50 +0000 (01:50 +0200)
committerThomas Debesse <dev@illwieckz.net>
Mon, 25 May 2020 23:50:50 +0000 (01:50 +0200)
1  2 
radiant/csg.cpp
radiant/gtkdlgs.cpp
radiant/mainframe.cpp
radiant/select.cpp

diff --cc radiant/csg.cpp
index 2b7d82be09393aa61933a59c37c0808761a19925,603f60836ee9cc74bdbcb9bc1d53b127d1f35a10..6ca051973c49ebdd731afefcdeb07842428cd5f3
@@@ -960,9 -1007,8 +1010,9 @@@ void CSG_Merge( void )
  struct CSGToolDialog
  {
        GtkSpinButton* spin;
 -      GtkWindow *window;
 +      bool allocated{false};
 +      ui::Window window{ui::null};
-       GtkToggleButton *radXYZ, *radX, *radY, *radZ, *caulk, *removeInner;
+       GtkToggleButton *radFaces, *radProj, *radCam, *caulk, *removeInner;
  };
  
  CSGToolDialog g_csgtool_dialog;
index 53d697f46aec0f24a75f6d10ab5716df9a0187bf,d4473b40667ca1e72a27c071a6c0383c4e255349..476e189f81af041ae8761d204d9b4e5bdb8b5540
@@@ -755,20 -791,20 +755,19 @@@ static void editor_close( ui::Widget wi
  }
  
  static void CreateGtkTextEditor(){
 -      GtkWidget *dlg;
 -      GtkWidget *vbox, *hbox, *button, *scr, *text;
 +      auto dlg = ui::Window( ui::window_type::TOP );
  
-       dlg.connect( "delete_event",
-                                         G_CALLBACK( editor_delete ), 0 );
-       gtk_window_set_default_size( dlg, 400, 300 );
 -      GtkWindow* dlg_wnd = create_dialog_window( MainFrame_getWindow(), "", G_CALLBACK( editor_delete ), 0, 400, 600 );
 -      dlg = GTK_WIDGET( dlg_wnd );
++      dlg.connect( "", G_CALLBACK( editor_delete ), 0 );
++      gtk_window_set_default_size( dlg, 400, 600 );
  
 -      vbox = gtk_vbox_new( FALSE, 5 );
 -      gtk_widget_show( vbox );
 -      gtk_container_add( GTK_CONTAINER( dlg ), GTK_WIDGET( vbox ) );
 +      auto vbox = ui::VBox( FALSE, 5 );
 +      vbox.show();
 +      dlg.add(vbox);
        gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 );
  
 -      scr = gtk_scrolled_window_new( 0, 0 );
 -      gtk_widget_show( scr );
 -      gtk_box_pack_start( GTK_BOX( vbox ), scr, TRUE, TRUE, 0 );
 +      auto scr = ui::ScrolledWindow(ui::New);
 +      scr.show();
 +      vbox.pack_start( scr, TRUE, TRUE, 0 );
        gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scr ), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
        gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW( scr ), GTK_SHADOW_IN );
  
index c2efdc3aa34452176c32071912c63f5273c03534,5442a8e58700973d16e9f3d3608576b0dc8a7651..4dd87b719fdf4efdf184da7c8f383b94ba75293b
@@@ -2217,9 -2068,12 +2217,12 @@@ ui::MenuItem create_selection_menu()
                create_menu_item_with_mnemonic( menu_in_menu, "Rotate X", "RotateSelectionX" );
                create_menu_item_with_mnemonic( menu_in_menu, "Rotate Y", "RotateSelectionY" );
                create_menu_item_with_mnemonic( menu_in_menu, "Rotate Z", "RotateSelectionZ" );
+               menu_separator( menu_in_menu );
+               create_menu_item_with_mnemonic( menu_in_menu, "Rotate Clockwise", "RotateSelectionClockwise" );
+               create_menu_item_with_mnemonic( menu_in_menu, "Rotate Anticlockwise", "RotateSelectionAnticlockwise" );
        }
        {
 -              GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic( menu, "Flip" );
 +              auto menu_in_menu = create_sub_menu_with_mnemonic( menu, "Flip" );
                if ( g_Layout_enableDetachableMenus.m_value ) {
                        menu_tearoff( menu_in_menu );
                }
@@@ -2470,16 -2327,21 +2476,21 @@@ void UndoRedo_constructToolbar( ui::Too
        toolbar_append_button( toolbar, "Redo (CTRL + Y)", "redo.png", "Redo" );
  }
  
 -void RotateFlip_constructToolbar( GtkToolbar* toolbar ){
 +void RotateFlip_constructToolbar( ui::Toolbar toolbar ){
-       toolbar_append_button( toolbar, "x-axis Flip", "brush_flipx.png", "MirrorSelectionX" );
-       toolbar_append_button( toolbar, "x-axis Rotate", "brush_rotatex.png", "RotateSelectionX" );
-       toolbar_append_button( toolbar, "y-axis Flip", "brush_flipy.png", "MirrorSelectionY" );
-       toolbar_append_button( toolbar, "y-axis Rotate", "brush_rotatey.png", "RotateSelectionY" );
-       toolbar_append_button( toolbar, "z-axis Flip", "brush_flipz.png", "MirrorSelectionZ" );
-       toolbar_append_button( toolbar, "z-axis Rotate", "brush_rotatez.png", "RotateSelectionZ" );
+ //    toolbar_append_button( toolbar, "x-axis Flip", "brush_flipx.png", "MirrorSelectionX" );
+ //    toolbar_append_button( toolbar, "x-axis Rotate", "brush_rotatex.png", "RotateSelectionX" );
+ //    toolbar_append_button( toolbar, "y-axis Flip", "brush_flipy.png", "MirrorSelectionY" );
+ //    toolbar_append_button( toolbar, "y-axis Rotate", "brush_rotatey.png", "RotateSelectionY" );
+ //    toolbar_append_button( toolbar, "z-axis Flip", "brush_flipz.png", "MirrorSelectionZ" );
+ //    toolbar_append_button( toolbar, "z-axis Rotate", "brush_rotatez.png", "RotateSelectionZ" );
+       toolbar_append_button( toolbar, "Flip Horizontally", "brush_flip_hor.png", "MirrorSelectionHorizontally" );
+       toolbar_append_button( toolbar, "Flip Vertically", "brush_flip_vert.png", "MirrorSelectionVertically" );
+       toolbar_append_button( toolbar, "Rotate Clockwise", "brush_rotate_clock.png", "RotateSelectionClockwise" );
+       toolbar_append_button( toolbar, "Rotate Anticlockwise", "brush_rotate_anti.png", "RotateSelectionAnticlockwise" );
  }
  
 -void Select_constructToolbar( GtkToolbar* toolbar ){
 +void Select_constructToolbar( ui::Toolbar toolbar ){
        toolbar_append_button( toolbar, "Select touching", "selection_selecttouching.png", "SelectTouching" );
        toolbar_append_button( toolbar, "Select inside", "selection_selectinside.png", "SelectInside" );
  }
@@@ -2522,61 -2384,44 +2533,61 @@@ ui::Toolbar create_main_toolbar( MainFr
  //    gtk_toolbar_set_show_arrow( toolbar, TRUE );
        //gtk_orientable_set_orientation( GTK_ORIENTABLE( toolbar ), GTK_ORIENTATION_HORIZONTAL );
        //toolbar_append_space( toolbar );
 -      gtk_widget_show( GTK_WIDGET( toolbar ) );
 +      toolbar.show();
 +
 +      auto space = [&]() {
 +              auto btn = ui::ToolItem::from(gtk_separator_tool_item_new());
 +              btn.show();
 +              toolbar.add(btn);
 +      };
  
        File_constructToolbar( toolbar );
 -      gtk_toolbar_append_space( toolbar );
 +
 +      space();
  
        UndoRedo_constructToolbar( toolbar );
 -      gtk_toolbar_append_space( toolbar );
 +
 +      space();
  
        RotateFlip_constructToolbar( toolbar );
 -      gtk_toolbar_append_space( toolbar );
 +
 +      space();
  
        Select_constructToolbar( toolbar );
 -      gtk_toolbar_append_space( toolbar );
 +
 +      space();
  
        CSG_constructToolbar( toolbar );
 -      gtk_toolbar_append_space( toolbar );
 +
 +      space();
  
        ComponentModes_constructToolbar( toolbar );
 -      gtk_toolbar_append_space( toolbar );
  
-       if ( style == MainFrame::eRegular || style == MainFrame::eRegularLeft ) {
+       if ( style != MainFrame::eSplit ) {
 +              space();
 +
                XYWnd_constructToolbar( toolbar );
 -              gtk_toolbar_append_space( toolbar );
        }
  
 +      space();
 +
        CamWnd_constructToolbar( toolbar );
 -      gtk_toolbar_append_space( toolbar );
 +
 +      space();
  
        Manipulators_constructToolbar( toolbar );
 -      gtk_toolbar_append_space( toolbar );
  
        if ( g_Layout_enablePatchToolbar.m_value ) {
 +              space();
 +
                Patch_constructToolbar( toolbar );
 -              gtk_toolbar_append_space( toolbar );
        }
  
 +      space();
 +
        toolbar_append_toggle_button( toolbar, "Texture Lock (SHIFT + T)", "texture_lock.png", "TogTexLock" );
 -      gtk_toolbar_append_space( toolbar );
 +
 +      space();
  
        toolbar_append_button( toolbar, "Entities (N)", "entities.png", "ToggleEntityInspector" );
        // disable the console and texture button in the regular layouts
@@@ -3561,47 -3395,37 +3572,43 @@@ void MainFrame_Construct()
  
  //    GlobalCommands_insert( "ShowHidden", FreeCaller<Select_ShowAllHidden>(), Accelerator( 'H', (GdkModifierType)GDK_SHIFT_MASK ) );
  //    GlobalCommands_insert( "HideSelected", FreeCaller<HideSelected>(), Accelerator( 'H' ) );
-       Hide_registerCommands();
 +
+       Select_registerCommands();
  
 -      GlobalToggles_insert( "DragVertices", FreeCaller<SelectVertexMode>(), ToggleItem::AddCallbackCaller( g_vertexMode_button ), Accelerator( 'V' ) );
 -      GlobalToggles_insert( "DragEdges", FreeCaller<SelectEdgeMode>(), ToggleItem::AddCallbackCaller( g_edgeMode_button ), Accelerator( 'E' ) );
 -      GlobalToggles_insert( "DragFaces", FreeCaller<SelectFaceMode>(), ToggleItem::AddCallbackCaller( g_faceMode_button ), Accelerator( 'F' ) );
 +      GlobalToggles_insert( "DragVertices", makeCallbackF(SelectVertexMode), ToggleItem::AddCallbackCaller( g_vertexMode_button ), Accelerator( 'V' ) );
 +      GlobalToggles_insert( "DragEdges", makeCallbackF(SelectEdgeMode), ToggleItem::AddCallbackCaller( g_edgeMode_button ), Accelerator( 'E' ) );
 +      GlobalToggles_insert( "DragFaces", makeCallbackF(SelectFaceMode), ToggleItem::AddCallbackCaller( g_faceMode_button ), Accelerator( 'F' ) );
  
-       GlobalCommands_insert( "MirrorSelectionX", makeCallbackF(Selection_Flipx) );
-       GlobalCommands_insert( "RotateSelectionX", makeCallbackF(Selection_Rotatex) );
-       GlobalCommands_insert( "MirrorSelectionY", makeCallbackF(Selection_Flipy) );
-       GlobalCommands_insert( "RotateSelectionY", makeCallbackF(Selection_Rotatey) );
-       GlobalCommands_insert( "MirrorSelectionZ", makeCallbackF(Selection_Flipz) );
-       GlobalCommands_insert( "RotateSelectionZ", makeCallbackF(Selection_Rotatez) );
 -      GlobalCommands_insert( "ArbitraryRotation", FreeCaller<DoRotateDlg>(), Accelerator( 'R', (GdkModifierType)GDK_SHIFT_MASK ) );
 -      GlobalCommands_insert( "ArbitraryScale", FreeCaller<DoScaleDlg>(), Accelerator( 'S', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
++      GlobalCommands_insert( "ArbitraryRotation", makeCallbackF(DoRotateDlg), Accelerator( 'R', (GdkModifierType)GDK_SHIFT_MASK ) );
++      GlobalCommands_insert( "ArbitraryScale", makeCallbackF(DoScaleDlg), Accelerator( 'S', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
  
 -      GlobalCommands_insert( "BuildMenuCustomize", FreeCaller<DoBuildMenu>() );
 -      GlobalCommands_insert( "Build_runRecentExecutedBuild", FreeCaller<Build_runRecentExecutedBuild>(), Accelerator( GDK_F5 ) );
 +      GlobalCommands_insert( "ArbitraryRotation", makeCallbackF(DoRotateDlg) );
 +      GlobalCommands_insert( "ArbitraryScale", makeCallbackF(DoScaleDlg) );
  
 -      GlobalCommands_insert( "FindBrush", FreeCaller<DoFind>() );
 +      GlobalCommands_insert( "BuildMenuCustomize", makeCallbackF(DoBuildMenu) );
 +      GlobalCommands_insert( "Build_runRecentExecutedBuild", makeCallbackF(Build_runRecentExecutedBuild), Accelerator( GDK_F5 ) );
  
 -      GlobalCommands_insert( "MapInfo", FreeCaller<DoMapInfo>(), Accelerator( 'M' ) );
 +      GlobalCommands_insert( "FindBrush", makeCallbackF(DoFind) );
  
 +      GlobalCommands_insert( "MapInfo", makeCallbackF(DoMapInfo), Accelerator( 'M' ) );
  
 -      GlobalToggles_insert( "ToggleClipper", FreeCaller<ClipperMode>(), ToggleItem::AddCallbackCaller( g_clipper_button ), Accelerator( 'X' ) );
  
 -      GlobalToggles_insert( "MouseTranslate", FreeCaller<TranslateMode>(), ToggleItem::AddCallbackCaller( g_translatemode_button ), Accelerator( 'W' ) );
 -      GlobalToggles_insert( "MouseRotate", FreeCaller<RotateMode>(), ToggleItem::AddCallbackCaller( g_rotatemode_button ), Accelerator( 'R' ) );
 -      GlobalToggles_insert( "MouseScale", FreeCaller<ScaleMode>(), ToggleItem::AddCallbackCaller( g_scalemode_button ) );
 -      GlobalToggles_insert( "MouseDrag", FreeCaller<DragMode>(), ToggleItem::AddCallbackCaller( g_dragmode_button ) );
 -      GlobalCommands_insert( "MouseRotateOrScale", FreeCaller<ToggleRotateScaleModes>() );
 -      GlobalCommands_insert( "MouseDragOrScale", FreeCaller<ToggleDragScaleModes>(), Accelerator( 'Q' ) );
 +      GlobalToggles_insert( "ToggleClipper", makeCallbackF(ClipperMode), ToggleItem::AddCallbackCaller( g_clipper_button ), Accelerator( 'X' ) );
  
 -      GlobalCommands_insert( "gtkThemeDlg", FreeCaller<gtkThemeDlg>() );
 -      GlobalCommands_insert( "ColorSchemeOriginal", FreeCaller<ColorScheme_Original>() );
 -      GlobalCommands_insert( "ColorSchemeQER", FreeCaller<ColorScheme_QER>() );
 -      GlobalCommands_insert( "ColorSchemeBlackAndGreen", FreeCaller<ColorScheme_Black>() );
 -      GlobalCommands_insert( "ColorSchemeYdnar", FreeCaller<ColorScheme_Ydnar>() );
 +      GlobalToggles_insert( "MouseTranslate", makeCallbackF(TranslateMode), ToggleItem::AddCallbackCaller( g_translatemode_button ), Accelerator( 'W' ) );
 +      GlobalToggles_insert( "MouseRotate", makeCallbackF(RotateMode), ToggleItem::AddCallbackCaller( g_rotatemode_button ), Accelerator( 'R' ) );
 +      GlobalToggles_insert( "MouseScale", makeCallbackF(ScaleMode), ToggleItem::AddCallbackCaller( g_scalemode_button ) );
 +      GlobalToggles_insert( "MouseDrag", makeCallbackF(DragMode), ToggleItem::AddCallbackCaller( g_dragmode_button ) );
 +      GlobalCommands_insert( "MouseRotateOrScale", makeCallbackF(ToggleRotateScaleModes) );
 +      GlobalCommands_insert( "MouseDragOrScale", makeCallbackF(ToggleDragScaleModes), Accelerator( 'Q' ) );
 +
 +#ifndef GARUX_DISABLE_GTKTHEME
 +      GlobalCommands_insert( "gtkThemeDlg", makeCallbackF(gtkThemeDlg) );
 +#endif
 +      GlobalCommands_insert( "ColorSchemeOriginal", makeCallbackF(ColorScheme_Original) );
 +      GlobalCommands_insert( "ColorSchemeQER", makeCallbackF(ColorScheme_QER) );
 +      GlobalCommands_insert( "ColorSchemeBlackAndGreen", makeCallbackF(ColorScheme_Black) );
 +      GlobalCommands_insert( "ColorSchemeYdnar", makeCallbackF(ColorScheme_Ydnar) );
        GlobalCommands_insert( "ChooseTextureBackgroundColor", makeCallback( g_ColoursMenu.m_textureback ) );
        GlobalCommands_insert( "ChooseGridBackgroundColor", makeCallback( g_ColoursMenu.m_xyback ) );
        GlobalCommands_insert( "ChooseGridMajorColor", makeCallback( g_ColoursMenu.m_gridmajor ) );
Simple merge