From: Thomas Debesse Date: Mon, 25 May 2020 14:44:53 +0000 (+0200) Subject: Merge commit '6592d65469e5386216a692ba3b5d6e7cc590c617' into garux-merge X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b8c3c38b6593cf013c8591d142854a842c79b1a2;p=xonotic%2Fnetradiant.git Merge commit '6592d65469e5386216a692ba3b5d6e7cc590c617' into garux-merge --- b8c3c38b6593cf013c8591d142854a842c79b1a2 diff --cc radiant/brushmanip.cpp index f90b0a4c,090ab4cf..7f71e752 --- a/radiant/brushmanip.cpp +++ b/radiant/brushmanip.cpp @@@ -555,32 -620,19 +555,10 @@@ void Scene_BrushFindReplaceShader_Compo } - class FaceFitTextureW - { - float m_s_repeat, m_t_repeat; - public: - FaceFitTextureW( float s_repeat, float t_repeat ) : m_s_repeat( s_repeat ), m_t_repeat( t_repeat ){ - } - void operator()( Face& face ) const { - face.FitTextureW( m_s_repeat, m_t_repeat ); - } - }; - - class FaceFitTextureH -class FaceFitTexture --{ --float m_s_repeat, m_t_repeat; --public: - FaceFitTextureH( float s_repeat, float t_repeat ) : m_s_repeat( s_repeat ), m_t_repeat( t_repeat ){ -FaceFitTexture( float s_repeat, float t_repeat ) : m_s_repeat( s_repeat ), m_t_repeat( t_repeat ){ --} --void operator()( Face& face ) const { - face.FitTextureH( m_s_repeat, m_t_repeat ); - face.FitTexture( m_s_repeat, m_t_repeat ); --} --}; -- void Scene_BrushFitTexture_Selected( scene::Graph& graph, float s_repeat, float t_repeat ){ - Scene_ForEachSelectedBrush_ForEachFace( graph, FaceFitTexture( s_repeat, t_repeat ) ); + Scene_ForEachSelectedBrush_ForEachFace(graph, [&](Face &face) { + face.FitTexture(s_repeat, t_repeat); + }); SceneChangeNotify(); } @@@ -591,28 -641,7 +569,8 @@@ void Scene_BrushFitTexture_Component_Se SceneChangeNotify(); } - void Scene_BrushFitTexture_SelectedW( scene::Graph& graph, float s_repeat, float t_repeat ){ - Scene_ForEachSelectedBrush_ForEachFace( graph, FaceFitTextureW( s_repeat, t_repeat ) ); - SceneChangeNotify(); - } - - void Scene_BrushFitTexture_Component_SelectedW( scene::Graph& graph, float s_repeat, float t_repeat ){ - Scene_ForEachSelectedBrushFace( graph, FaceFitTextureW( s_repeat, t_repeat ) ); - SceneChangeNotify(); - } - - void Scene_BrushFitTexture_SelectedH( scene::Graph& graph, float s_repeat, float t_repeat ){ - Scene_ForEachSelectedBrush_ForEachFace( graph, FaceFitTextureH( s_repeat, t_repeat ) ); - SceneChangeNotify(); - } - - void Scene_BrushFitTexture_Component_SelectedH( scene::Graph& graph, float s_repeat, float t_repeat ){ - Scene_ForEachSelectedBrushFace( graph, FaceFitTextureH( s_repeat, t_repeat ) ); - SceneChangeNotify(); - } - TextureProjection g_defaultTextureProjection; + const TextureProjection& TextureTransform_getDefault(){ TexDef_Construct_Default( g_defaultTextureProjection ); return g_defaultTextureProjection; diff --cc radiant/brushmanip.h index ac34e455,06f67271..5a1f62b0 --- a/radiant/brushmanip.h +++ b/radiant/brushmanip.h @@@ -71,14 -70,11 +71,10 @@@ void Scene_BrushSelectByShader( scene:: void Scene_BrushSelectByShader_Component( scene::Graph& graph, const char* name ); void Scene_BrushFitTexture_Selected( scene::Graph& graph, float s_repeat, float t_repeat ); void Scene_BrushFitTexture_Component_Selected( scene::Graph& graph, float s_repeat, float t_repeat ); - void Scene_BrushFitTexture_SelectedW( scene::Graph& graph, float s_repeat, float t_repeat ); - void Scene_BrushFitTexture_Component_SelectedW( scene::Graph& graph, float s_repeat, float t_repeat ); - void Scene_BrushFitTexture_SelectedH( scene::Graph& graph, float s_repeat, float t_repeat ); - void Scene_BrushFitTexture_Component_SelectedH( scene::Graph& graph, float s_repeat, float t_repeat ); -typedef struct _GtkMenu GtkMenu; -void Brush_constructMenu( GtkMenu* menu ); +void Brush_constructMenu( ui::Menu menu ); -extern Callback g_texture_lock_status_changed; +extern Callback g_texture_lock_status_changed; void BrushFilters_construct(); void Brush_registerCommands(); diff --cc radiant/build.cpp index 6462e382,793ab5a5..5e86dc85 --- a/radiant/build.cpp +++ b/radiant/build.cpp @@@ -651,7 -670,8 +651,8 @@@ class ProjectLis { public: Project& m_project; -GtkListStore* m_store; +ui::ListStore m_store{ui::null}; + GtkWidget* m_buildView; bool m_changed; ProjectList( Project& project ) : m_project( project ), m_changed( false ){ } @@@ -685,7 -705,10 +686,9 @@@ gboolean project_cell_edited(ui::CellRe project.push_back( Project::value_type( new_text, Build() ) ); gtk_list_store_set( projectList->m_store, &iter, 0, new_text, -1 ); - GtkTreeIter lastIter; - gtk_list_store_append( projectList->m_store, &lastIter ); + projectList->m_store.append(); + //make command field activatable + g_signal_emit_by_name( G_OBJECT( gtk_tree_view_get_selection( GTK_TREE_VIEW( projectList->m_buildView ) ) ), "changed" ); } gtk_tree_path_free( path ); @@@ -820,56 -847,63 +823,57 @@@ gboolean commands_key_press( ui::TreeVi } -GtkWindow* BuildMenuDialog_construct( ModalDialog& modal, ProjectList& projectList ){ - GtkWindow* window = create_dialog_window( MainFrame_getWindow(), "Build Menu", G_CALLBACK( dialog_delete_callback ), &modal, -1, 400 ); - - GtkWidget* buildView = 0; +ui::Window BuildMenuDialog_construct( ModalDialog& modal, ProjectList& projectList ){ + ui::Window window = MainFrame_getWindow().create_dialog_window("Build Menu", G_CALLBACK(dialog_delete_callback ), &modal, -1, 400 ); { - GtkTable* table1 = create_dialog_table( 2, 2, 4, 4, 4 ); - gtk_container_add( GTK_CONTAINER( window ), GTK_WIDGET( table1 ) ); + auto table1 = create_dialog_table( 2, 2, 4, 4, 4 ); + window.add(table1); { - GtkVBox* vbox = create_dialog_vbox( 4 ); - gtk_table_attach( table1, GTK_WIDGET( vbox ), 1, 2, 0, 1, - (GtkAttachOptions) ( GTK_FILL ), - (GtkAttachOptions) ( GTK_FILL ), 0, 0 ); + auto vbox = create_dialog_vbox( 4 ); + table1.attach(vbox, {1, 2, 0, 1}, {GTK_FILL, GTK_FILL}); { - GtkButton* button = create_dialog_button( "OK", G_CALLBACK( dialog_button_ok ), &modal ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + auto button = create_dialog_button( "OK", G_CALLBACK( dialog_button_ok ), &modal ); + vbox.pack_start( button, FALSE, FALSE, 0 ); } { - GtkButton* button = create_dialog_button( "Cancel", G_CALLBACK( dialog_button_cancel ), &modal ); - gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); + auto button = create_dialog_button( "Cancel", G_CALLBACK( dialog_button_cancel ), &modal ); + vbox.pack_start( button, FALSE, FALSE, 0 ); } } + auto buildViewStore = ui::ListStore::from(gtk_list_store_new( 1, G_TYPE_STRING )); + auto buildView = ui::TreeView( ui::TreeModel::from( buildViewStore._handle )); { - GtkFrame* frame = create_dialog_frame( "Build menu" ); - gtk_table_attach( table1, GTK_WIDGET( frame ), 0, 1, 0, 1, - (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), - (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); + auto frame = create_dialog_frame( "Build menu" ); + table1.attach(frame, {0, 1, 0, 1}); { - GtkScrolledWindow* scr = create_scrolled_window( GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC, 4 ); - gtk_container_add( GTK_CONTAINER( frame ), GTK_WIDGET( scr ) ); + auto scr = create_scrolled_window( ui::Policy::NEVER, ui::Policy::AUTOMATIC, 4 ); + frame.add(scr); { - GtkListStore* store = gtk_list_store_new( 1, G_TYPE_STRING ); + auto view = buildView; + auto store = buildViewStore; + gtk_tree_view_set_headers_visible(view, FALSE ); - GtkWidget* view = gtk_tree_view_new_with_model( GTK_TREE_MODEL( store ) ); - gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( view ), FALSE ); - - GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); + auto renderer = ui::CellRendererText(ui::New); object_set_boolean_property( G_OBJECT( renderer ), "editable", TRUE ); - g_signal_connect( renderer, "edited", G_CALLBACK( project_cell_edited ), &projectList ); + renderer.connect("edited", G_CALLBACK( project_cell_edited ), &projectList ); - GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( "", renderer, "text", 0, 0 ); - gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column ); + auto column = ui::TreeViewColumn( "", renderer, {{"text", 0}} ); + gtk_tree_view_append_column(view, column ); - GtkTreeSelection* selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( view ) ); + auto selection = gtk_tree_view_get_selection(view ); gtk_tree_selection_set_mode( selection, GTK_SELECTION_BROWSE ); - gtk_widget_show( view ); + view.show(); - buildView = view; + projectList.m_buildView = buildView; projectList.m_store = store; - gtk_container_add( GTK_CONTAINER( scr ), view ); + scr.add(view); - g_signal_connect( G_OBJECT( view ), "key_press_event", G_CALLBACK( project_key_press ), &projectList ); + view.connect( "key_press_event", G_CALLBACK( project_key_press ), &projectList ); - g_object_unref( G_OBJECT( store ) ); + store.unref(); } } } diff --cc radiant/entityinspector.cpp index d2acdc80,e187d803..1864e7c8 --- a/radiant/entityinspector.cpp +++ b/radiant/entityinspector.cpp @@@ -703,8 -715,10 +703,10 @@@ typedef MemberCaller(m_pStatusLabel)); + vbox.pack_end(main_statusbar, FALSE, TRUE, 2); GroupDialog_constructWindow( window ); + + /* want to realize it immediately; otherwise gtk paned splits positions wont be set correctly for floating group dlg */ + gtk_widget_realize ( GTK_WIDGET( GroupDialog_getWindow() ) ); + g_page_entity = GroupDialog_addPage( "Entities", EntityInspector_constructWindow( GroupDialog_getWindow() ), RawStringExportCaller( "Entities" ) ); if ( FloatingGroupDialog() ) { diff --cc radiant/patchdialog.cpp index 6a29298d,7ce797e7..ab228654 --- a/radiant/patchdialog.cpp +++ b/radiant/patchdialog.cpp @@@ -793,122 -900,133 +795,122 @@@ ui::Window PatchInspector::BuildDialog( // so we need to have at least one initialisation somewhere entry_set_float( entry, g_pi_globals.shift[0] ); - GtkAdjustment* adj = GTK_ADJUSTMENT( gtk_adjustment_new( 0, -8192, 8192, 1, 1, 0 ) ); - g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry ); - g_object_set_data( G_OBJECT( window ), "hshift_adj", adj ); - - GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( adj, 1, 0 ) ); - gtk_widget_show( GTK_WIDGET( spin ) ); - gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 0, 1, - (GtkAttachOptions)( 0 ), - (GtkAttachOptions)( 0 ), 0, 0 ); - gtk_widget_set_usize( GTK_WIDGET( spin ), 16, -2 ); - GTK_WIDGET_UNSET_FLAGS( spin, GTK_CAN_FOCUS ); + auto adj = ui::Adjustment( 0, -8192, 8192, 1, 1, 0 ); + adj.connect( "value_changed", G_CALLBACK( OnSpinChanged ), (gpointer) entry ); + g_object_set_data( G_OBJECT( window ), "hshift_adj", (gpointer) adj ); + + auto spin = ui::SpinButton( adj, 1, 0 ); + spin.show(); + table.attach(spin, {1, 2, 0, 1}, {0, 0}); - spin.dimensions(10, -1); ++ spin.dimensions(16, -2); + gtk_widget_set_can_focus( spin, false ); } { - GtkEntry* entry = GTK_ENTRY( gtk_entry_new() ); - gtk_widget_show( GTK_WIDGET( entry ) ); - gtk_table_attach( table, GTK_WIDGET( entry ), 0, 1, 1, 2, - (GtkAttachOptions)( GTK_FILL ), - (GtkAttachOptions)( 0 ), 0, 0 ); - gtk_widget_set_usize( GTK_WIDGET( entry ), 50, -2 ); + auto entry = ui::Entry(ui::New); + entry.show(); + table.attach(entry, {0, 1, 1, 2}, {GTK_FILL, 0}); + entry.dimensions(50, -1); entry_set_float( entry, g_pi_globals.shift[1] ); - GtkAdjustment* adj = GTK_ADJUSTMENT( gtk_adjustment_new( 0, -8192, 8192, 1, 1, 0 ) ); - g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry ); - g_object_set_data( G_OBJECT( window ), "vshift_adj", adj ); - - GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( adj, 1, 0 ) ); - gtk_widget_show( GTK_WIDGET( spin ) ); - gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 1, 2, - (GtkAttachOptions)( 0 ), - (GtkAttachOptions)( 0 ), 0, 0 ); - gtk_widget_set_usize( GTK_WIDGET( spin ), 16, -2 ); - GTK_WIDGET_UNSET_FLAGS( spin, GTK_CAN_FOCUS ); + auto adj = ui::Adjustment( 0, -8192, 8192, 1, 1, 0 ); + adj.connect( "value_changed", G_CALLBACK( OnSpinChanged ), entry ); + g_object_set_data( G_OBJECT( window ), "vshift_adj", (gpointer) adj ); + + auto spin = ui::SpinButton( adj, 1, 0 ); + spin.show(); + table.attach(spin, {1, 2, 1, 2}, {0, 0}); - spin.dimensions(10, -1); ++ spin.dimensions(16, -2); + gtk_widget_set_can_focus( spin, false ); } { - GtkEntry* entry = GTK_ENTRY( gtk_entry_new() ); - gtk_widget_show( GTK_WIDGET( entry ) ); - gtk_table_attach( table, GTK_WIDGET( entry ), 0, 1, 2, 3, - (GtkAttachOptions)( GTK_FILL ), - (GtkAttachOptions)( 0 ), 0, 0 ); - gtk_widget_set_usize( GTK_WIDGET( entry ), 50, -2 ); + auto entry = ui::Entry(ui::New); + entry.show(); + table.attach(entry, {0, 1, 2, 3}, {GTK_FILL, 0}); + entry.dimensions(50, -1); entry_set_float( entry, g_pi_globals.scale[0] ); - GtkAdjustment* adj = GTK_ADJUSTMENT( gtk_adjustment_new( 0, -1000, 1000, 1, 1, 0 ) ); - g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry ); - g_object_set_data( G_OBJECT( window ), "hscale_adj", adj ); - - GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( adj, 1, 0 ) ); - gtk_widget_show( GTK_WIDGET( spin ) ); - gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 2, 3, - (GtkAttachOptions)( 0 ), - (GtkAttachOptions)( 0 ), 0, 0 ); - gtk_widget_set_usize( GTK_WIDGET( spin ), 16, -2 ); - GTK_WIDGET_UNSET_FLAGS( spin, GTK_CAN_FOCUS ); + auto adj = ui::Adjustment( 0, -1000, 1000, 1, 1, 0 ); + adj.connect( "value_changed", G_CALLBACK( OnSpinChanged ), entry ); + g_object_set_data( G_OBJECT( window ), "hscale_adj", (gpointer) adj ); + + auto spin = ui::SpinButton( adj, 1, 0 ); + spin.show(); + table.attach(spin, {1, 2, 2, 3}, {0, 0}); - spin.dimensions(10, -1); ++ spin.dimensions(16, -2); + gtk_widget_set_can_focus( spin, false ); } { - GtkEntry* entry = GTK_ENTRY( gtk_entry_new() ); - gtk_widget_show( GTK_WIDGET( entry ) ); - gtk_table_attach( table, GTK_WIDGET( entry ), 0, 1, 3, 4, - (GtkAttachOptions)( GTK_FILL ), - (GtkAttachOptions)( 0 ), 0, 0 ); - gtk_widget_set_usize( GTK_WIDGET( entry ), 50, -2 ); + auto entry = ui::Entry(ui::New); + entry.show(); + table.attach(entry, {0, 1, 3, 4}, {GTK_FILL, 0}); + entry.dimensions(50, -1); entry_set_float( entry, g_pi_globals.scale[1] ); - GtkAdjustment* adj = GTK_ADJUSTMENT( gtk_adjustment_new( 0, -1000, 1000, 1, 1, 0 ) ); - g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry ); - g_object_set_data( G_OBJECT( window ), "vscale_adj", adj ); - - GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( adj, 1, 0 ) ); - gtk_widget_show( GTK_WIDGET( spin ) ); - gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 3, 4, - (GtkAttachOptions)( 0 ), - (GtkAttachOptions)( 0 ), 0, 0 ); - gtk_widget_set_usize( GTK_WIDGET( spin ), 16, -2 ); - GTK_WIDGET_UNSET_FLAGS( spin, GTK_CAN_FOCUS ); + auto adj = ui::Adjustment( 0, -1000, 1000, 1, 1, 0 ); + adj.connect( "value_changed", G_CALLBACK( OnSpinChanged ), entry ); + g_object_set_data( G_OBJECT( window ), "vscale_adj", (gpointer) adj ); + + auto spin = ui::SpinButton( adj, 1, 0 ); + spin.show(); + table.attach(spin, {1, 2, 3, 4}, {0, 0}); - spin.dimensions(10, -1); ++ spin.dimensions(16, -2); + gtk_widget_set_can_focus( spin, false ); } { - GtkEntry* entry = GTK_ENTRY( gtk_entry_new() ); - gtk_widget_show( GTK_WIDGET( entry ) ); - gtk_table_attach( table, GTK_WIDGET( entry ), 0, 1, 4, 5, - (GtkAttachOptions)( GTK_FILL ), - (GtkAttachOptions)( 0 ), 0, 0 ); - gtk_widget_set_usize( GTK_WIDGET( entry ), 50, -2 ); + auto entry = ui::Entry(ui::New); + entry.show(); + table.attach(entry, {0, 1, 4, 5}, {GTK_FILL, 0}); + entry.dimensions(50, -1); entry_set_float( entry, g_pi_globals.rotate ); - GtkAdjustment* adj = GTK_ADJUSTMENT( gtk_adjustment_new( 0, -1000, 1000, 1, 1, 0 ) ); // NOTE: Arnout - this really should be 360 but can't change it anymore as it could break existing maps - g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry ); - g_object_set_data( G_OBJECT( window ), "rotate_adj", adj ); - - GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( adj, 1, 0 ) ); - gtk_widget_show( GTK_WIDGET( spin ) ); - gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 4, 5, - (GtkAttachOptions)( 0 ), - (GtkAttachOptions)( 0 ), 0, 0 ); - gtk_widget_set_usize( GTK_WIDGET( spin ), 16, -2 ); - GTK_WIDGET_UNSET_FLAGS( spin, GTK_CAN_FOCUS ); + auto adj = ui::Adjustment( 0, -1000, 1000, 1, 1, 0 ); // NOTE: Arnout - this really should be 360 but can't change it anymore as it could break existing maps + adj.connect( "value_changed", G_CALLBACK( OnSpinChanged ), entry ); + g_object_set_data( G_OBJECT( window ), "rotate_adj", (gpointer) adj ); + + auto spin = ui::SpinButton( adj, 1, 0 ); + spin.show(); + table.attach(spin, {1, 2, 4, 5}, {0, 0}); - spin.dimensions(10, -1); ++ spin.dimensions(16, -2); + gtk_widget_set_can_focus( spin, false ); } } - GtkHBox* hbox2 = GTK_HBOX( gtk_hbox_new( TRUE, 5 ) ); - gtk_widget_show( GTK_WIDGET( hbox2 ) ); - gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( hbox2 ), TRUE, FALSE, 0 ); + auto hbox2 = ui::HBox( TRUE, 5 ); + hbox2.show(); + vbox2.pack_start( hbox2, TRUE, FALSE, 0 ); + { + auto button = ui::Button( "Auto Cap" ); + button.show(); + hbox2.pack_end(button, TRUE, FALSE, 0); + button.connect( "clicked", G_CALLBACK( OnBtnPatchAutoCap ), 0 ); + button.dimensions(60, -1); + } { - GtkButton* button = GTK_BUTTON( gtk_button_new_with_label( "CAP" ) ); - gtk_widget_show( GTK_WIDGET( button ) ); - gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 ); - g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchdetails ), 0 ); - gtk_widget_set_usize( GTK_WIDGET( button ), 60, -1 ); + auto button = ui::Button( "CAP" ); + button.show(); + hbox2.pack_end(button, TRUE, FALSE, 0); + button.connect( "clicked", G_CALLBACK( OnBtnPatchdetails ), 0 ); + button.dimensions(60, -1); } { - GtkButton* button = GTK_BUTTON( gtk_button_new_with_label( "Set..." ) ); - gtk_widget_show( GTK_WIDGET( button ) ); - gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 ); - g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchreset ), 0 ); - gtk_widget_set_usize( GTK_WIDGET( button ), 60, -1 ); + auto button = ui::Button( "Set..." ); + button.show(); + hbox2.pack_end(button, TRUE, FALSE, 0); + button.connect( "clicked", G_CALLBACK( OnBtnPatchreset ), 0 ); + button.dimensions(60, -1); } { - GtkButton* button = GTK_BUTTON( gtk_button_new_with_label( "Natural" ) ); - gtk_widget_show( GTK_WIDGET( button ) ); - gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 ); - g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchnatural ), 0 ); - gtk_widget_set_usize( GTK_WIDGET( button ), 60, -1 ); + auto button = ui::Button( "Natural" ); + button.show(); + hbox2.pack_end(button, TRUE, FALSE, 0); + button.connect( "clicked", G_CALLBACK( OnBtnPatchnatural ), 0 ); + button.dimensions(60, -1); } { - GtkButton* button = GTK_BUTTON( gtk_button_new_with_label( "Fit" ) ); - gtk_widget_show( GTK_WIDGET( button ) ); - gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 ); - g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchfit ), 0 ); - gtk_widget_set_usize( GTK_WIDGET( button ), 60, -1 ); + auto button = ui::Button( "Fit" ); + button.show(); + hbox2.pack_end(button, TRUE, FALSE, 0); + button.connect( "clicked", G_CALLBACK( OnBtnPatchfit ), 0 ); + button.dimensions(60, -1); } } } diff --cc radiant/surfacedialog.cpp index dbf3666e,d0ff4c1c..7d5f7774 --- a/radiant/surfacedialog.cpp +++ b/radiant/surfacedialog.cpp @@@ -438,10 -448,10 +438,10 @@@ void SurfaceInspector_FitTextureW() void SurfaceInspector_FitTextureH(){ UndoableCommand undo( "textureAutoFitH" ); - Select_FitTextureH( getSurfaceInspector().m_fitHorizontal, getSurfaceInspector().m_fitVertical ); + Select_FitTexture( 0, getSurfaceInspector().m_fitVertical ); } -static void OnBtnPatchdetails( GtkWidget *widget, gpointer data ){ +static void OnBtnPatchdetails( ui::Widget widget, gpointer data ){ Patch_CapTexture(); } diff --cc radiant/watchbsp.cpp index bbae3fab,79348257..4769bc5d --- a/radiant/watchbsp.cpp +++ b/radiant/watchbsp.cpp @@@ -489,8 -487,9 +489,9 @@@ void CWatchBSP::Reset() m_xmlInputBuffer = NULL; } m_eState = EIdle; - if ( s_routine_id ) { + if ( s_routine_id != 0 ) { - gtk_timeout_remove( s_routine_id ); + g_source_remove( s_routine_id ); + s_routine_id = 0; } }