From: TimePath Date: Sat, 30 Dec 2017 04:44:11 +0000 (+1100) Subject: GTK: wrap gtk_widget_set_size_request X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a9e5bfdf2a458e89978ee52ebbd3711884b54b29;p=xonotic%2Fnetradiant.git GTK: wrap gtk_widget_set_size_request --- diff --git a/contrib/camera/dialogs.cpp b/contrib/camera/dialogs.cpp index 5c998b49..5bcd984d 100644 --- a/contrib/camera/dialogs.cpp +++ b/contrib/camera/dialogs.cpp @@ -1247,7 +1247,7 @@ GtkWidget *CreateCameraInspectorDialog( void ){ hbox.show(); auto scr = w = ui::ScrolledWindow(); - gtk_widget_set_size_request( w, 0, 150 ); + w.dimensions( 0, 150 ); gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( w ), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC ); hbox.pack_start( w, TRUE, TRUE, 0 ); w.show(); diff --git a/contrib/gtkgensurf/gendlgs.cpp b/contrib/gtkgensurf/gendlgs.cpp index 5f49a545..e64a6598 100644 --- a/contrib/gtkgensurf/gendlgs.cpp +++ b/contrib/gtkgensurf/gendlgs.cpp @@ -1474,21 +1474,21 @@ GtkWidget* create_main_dialog(){ entry = ui::Entry(); entry.show(); table2.attach(entry, {1, 2, 0, 1}); - gtk_widget_set_size_request( entry, 50, -1 ); + entry.dimensions( 50, -1 ); g_object_set_data( G_OBJECT( dlg ), "wavelength", entry ); entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &WaveLength ); entry = ui::Entry(); entry.show(); table2.attach(entry, {1, 2, 1, 2}); - gtk_widget_set_size_request( entry, 50, -1 ); + entry.dimensions( 50, -1 ); g_object_set_data( G_OBJECT( dlg ), "amplitude", entry ); entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Amplitude ); entry = ui::Entry(); entry.show(); table2.attach(entry, {1, 2, 2, 3}); - gtk_widget_set_size_request( entry, 50, -1 ); + entry.dimensions( 50, -1 ); g_object_set_data( G_OBJECT( dlg ), "roughness", entry ); entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Roughness ); @@ -1497,7 +1497,7 @@ GtkWidget* create_main_dialog(){ spin = ui::SpinButton( adj, 1, 0 ); spin.show(); table2.attach(spin, {1, 2, 3, 4}); - gtk_widget_set_size_request( spin, 60, -1 ); + spin.dimensions( 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "random", spin ); vbox = ui::VBox( FALSE, 5 ); @@ -1554,28 +1554,28 @@ GtkWidget* create_main_dialog(){ entry = ui::Entry(); entry.show(); table.attach(entry, {1, 2, 1, 2}); - gtk_widget_set_size_request( entry, 50, -1 ); + entry.dimensions( 50, -1 ); g_object_set_data( G_OBJECT( dlg ), "hmin", entry ); entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Hll ); entry = ui::Entry(); entry.show(); table.attach(entry, {3, 4, 1, 2}); - gtk_widget_set_size_request( entry, 50, -1 ); + entry.dimensions( 50, -1 ); g_object_set_data( G_OBJECT( dlg ), "hmax", entry ); entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Hur ); entry = ui::Entry(); entry.show(); table.attach(entry, {1, 2, 2, 3}); - gtk_widget_set_size_request( entry, 50, -1 ); + entry.dimensions( 50, -1 ); g_object_set_data( G_OBJECT( dlg ), "vmin", entry ); entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Vll ); entry = ui::Entry(); entry.show(); table.attach(entry, {3, 4, 2, 3}); - gtk_widget_set_size_request( entry, 50, -1 ); + entry.dimensions( 50, -1 ); g_object_set_data( G_OBJECT( dlg ), "vmax", entry ); entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Vur ); @@ -1605,7 +1605,7 @@ GtkWidget* create_main_dialog(){ spin = ui::SpinButton( adj, 1, 0 ); spin.show(); table.attach(spin, {1, 2, 0, 1}); - gtk_widget_set_size_request( spin, 60, -1 ); + spin.dimensions( 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "nh", spin ); adj = ui::Adjustment( 8, 1, MAX_ROWS, 1, 10, 0 ); @@ -1613,7 +1613,7 @@ GtkWidget* create_main_dialog(){ spin = ui::SpinButton( adj, 1, 0 ); spin.show(); table.attach(spin, {1, 2, 1, 2}); - gtk_widget_set_size_request( spin, 60, -1 ); + spin.dimensions( 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "nv", spin ); check = ui::CheckButton( "Use Bezier patches" ); @@ -1633,7 +1633,7 @@ GtkWidget* create_main_dialog(){ spin = ui::SpinButton( adj, 1, 0 ); spin.show(); vbox.pack_start( spin, FALSE, TRUE, 0 ); - gtk_widget_set_size_request( spin, 60, -1 ); + spin.dimensions( 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "sp", spin ); // ^Fishman - End of Snap to grid code. @@ -1685,28 +1685,28 @@ GtkWidget* create_main_dialog(){ entry = ui::Entry(); entry.show(); table.attach(entry, {1, 2, 0, 1}); - gtk_widget_set_size_request( entry, 50, -1 ); + entry.dimensions( 50, -1 ); g_object_set_data( G_OBJECT( dlg ), "z01", entry ); entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Z01 ); entry = ui::Entry(); entry.show(); table.attach(entry, {1, 2, 1, 2}); - gtk_widget_set_size_request( entry, 50, -1 ); + entry.dimensions( 50, -1 ); g_object_set_data( G_OBJECT( dlg ), "z00", entry ); entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Z00 ); entry = ui::Entry(); entry.show(); table.attach(entry, {3, 4, 0, 1}); - gtk_widget_set_size_request( entry, 50, -1 ); + entry.dimensions( 50, -1 ); g_object_set_data( G_OBJECT( dlg ), "z11", entry ); entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Z11 ); entry = ui::Entry(); entry.show(); table.attach(entry, {3, 4, 1, 2}); - gtk_widget_set_size_request( entry, 50, -1 ); + entry.dimensions( 50, -1 ); g_object_set_data( G_OBJECT( dlg ), "z10", entry ); entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Z10 ); @@ -1754,14 +1754,14 @@ GtkWidget* create_main_dialog(){ button = ui::Button( "Browse..." ); button.show(); hbox2.pack_start( button, FALSE, FALSE, 0 ); - gtk_widget_set_size_request( button, 60, -1 ); + button.dimensions( 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "bmp_file_browse", button ); button.connect( "clicked", G_CALLBACK( bitmap_browse ), NULL ); button = ui::Button( "Reload" ); button.show(); hbox2.pack_start( button, FALSE, FALSE, 0 ); - gtk_widget_set_size_request( button, 60, -1 ); + button.dimensions( 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "bmp_reload", button ); button.connect( "clicked", G_CALLBACK( bitmap_reload ), NULL ); @@ -1793,7 +1793,7 @@ GtkWidget* create_main_dialog(){ entry = ui::Entry(); entry.show(); hbox2.pack_start( entry, FALSE, FALSE, 0 ); - gtk_widget_set_size_request( entry, 50, -1 ); + entry.dimensions( 50, -1 ); g_object_set_data( G_OBJECT( dlg ), "bmp_black", entry ); entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &gbmp.black_value ); @@ -1804,7 +1804,7 @@ GtkWidget* create_main_dialog(){ entry = ui::Entry(); entry.show(); hbox2.pack_start( entry, FALSE, FALSE, 0 ); - gtk_widget_set_size_request( entry, 50, -1 ); + entry.dimensions( 50, -1 ); g_object_set_data( G_OBJECT( dlg ), "bmp_white", entry ); entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &gbmp.white_value ); @@ -1855,35 +1855,35 @@ GtkWidget* create_main_dialog(){ spin = ui::SpinButton( adj, 1, 0 ); spin.show(); table.attach(spin, {1, 2, 0, 1}, {GTK_EXPAND, GTK_EXPAND}); - gtk_widget_set_size_request( spin, 60, -1 ); + spin.dimensions( 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "fix_value", spin ); spin.connect( "focus_out_event", G_CALLBACK( fix_value_entryfocusout ), NULL ); entry = ui::Entry(); entry.show(); table.attach(entry, {1, 2, 1, 2}, {GTK_EXPAND, GTK_FILL}); - gtk_widget_set_size_request( entry, 60, -1 ); + entry.dimensions( 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "fix_range", entry ); entry.connect( "focus_out_event", G_CALLBACK( fix_range_entryfocusout ), NULL ); entry = ui::Entry(); entry.show(); table.attach(entry, {1, 2, 2, 3}, {GTK_EXPAND, GTK_FILL}); - gtk_widget_set_size_request( entry, 60, -1 ); + entry.dimensions( 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "fix_rate", entry ); entry.connect( "focus_out_event", G_CALLBACK( fix_rate_entryfocusout ), NULL ); button = ui::Button( "Free" ); button.show(); table.attach(button, {2, 3, 0, 1}, {GTK_EXPAND, GTK_FILL}); - gtk_widget_set_size_request( button, 60, -1 ); + button.dimensions( 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "fix_free", button ); button.connect( "clicked", G_CALLBACK( fix_free ), NULL ); button = ui::Button( "Free All" ); button.show(); table.attach(button, {2, 3, 1, 2}, {GTK_EXPAND, GTK_FILL}); - gtk_widget_set_size_request( button, 60, -1 ); + button.dimensions( 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "fix_freeall", button ); button.connect( "clicked", G_CALLBACK( fix_freeall ), NULL ); @@ -1920,21 +1920,21 @@ GtkWidget* create_main_dialog(){ entry = ui::Entry(); entry.show(); table.attach(entry, {1, 2, 0, 1}, {GTK_EXPAND | GTK_FILL, GTK_FILL}); - gtk_widget_set_size_request( entry, 60, -1 ); + entry.dimensions( 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "texture1", entry ); entry.connect( "focus_out_event", G_CALLBACK( texture_entryfocusout ), GINT_TO_POINTER( 0 ) ); entry = ui::Entry(); entry.show(); table.attach(entry, {1, 2, 1, 2}, {GTK_EXPAND | GTK_FILL, GTK_FILL}); - gtk_widget_set_size_request( entry, 60, -1 ); + entry.dimensions( 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "texture2", entry ); entry.connect( "focus_out_event", G_CALLBACK( texture_entryfocusout ), GINT_TO_POINTER( 1 ) ); entry = ui::Entry(); entry.show(); table.attach(entry, {1, 2, 2, 3}, {GTK_EXPAND | GTK_FILL, GTK_FILL}); - gtk_widget_set_size_request( entry, 60, -1 ); + entry.dimensions( 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "texture3", entry ); hbox2 = ui::HBox( FALSE, 5 ); @@ -1968,25 +1968,25 @@ GtkWidget* create_main_dialog(){ entry = ui::Entry(); entry.show(); table.attach(entry, {0, 1, 1, 2}, {GTK_EXPAND | GTK_FILL, GTK_FILL}); - gtk_widget_set_size_request( entry, 60, -1 ); + entry.dimensions( 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "texoffsetx", entry ); entry = ui::Entry(); entry.show(); table.attach(entry, {1, 2, 1, 2}, {GTK_EXPAND | GTK_FILL, GTK_FILL}); - gtk_widget_set_size_request( entry, 60, -1 ); + entry.dimensions( 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "texoffsety", entry ); entry = ui::Entry(); entry.show(); table.attach(entry, {2, 3, 1, 2}, {GTK_EXPAND | GTK_FILL, GTK_FILL}); - gtk_widget_set_size_request( entry, 60, -1 ); + entry.dimensions( 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "texscalex", entry ); entry = ui::Entry(); entry.show(); table.attach(entry, {3, 4, 1, 2}, {GTK_EXPAND | GTK_FILL, GTK_FILL}); - gtk_widget_set_size_request( entry, 60, -1 ); + entry.dimensions( 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "texscaley", entry ); @@ -2017,7 +2017,7 @@ GtkWidget* create_main_dialog(){ button = ui::Button( "OK" ); button.show(); vbox.pack_start( button, FALSE, TRUE, 0 ); - gtk_widget_set_size_request( button, 60, -1 ); + button.dimensions( 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "go", button ); button.connect( "clicked", G_CALLBACK( main_go ), NULL ); diff --git a/contrib/prtview/ConfigDialog.cpp b/contrib/prtview/ConfigDialog.cpp index 64f539c7..0d3a3920 100644 --- a/contrib/prtview/ConfigDialog.cpp +++ b/contrib/prtview/ConfigDialog.cpp @@ -398,7 +398,7 @@ void DoConfigDialog(){ button.show(); hbox.pack_start( button, FALSE, FALSE, 0 ); button.connect( "clicked", G_CALLBACK( OnColor2d ), NULL ); - gtk_widget_set_size_request( button, 60, -1 ); + button.dimensions(60, -1); auto aa2check = ui::CheckButton( "Anti-Alias (May not work on some video cards)" ); aa2check.show(); @@ -423,7 +423,7 @@ void DoConfigDialog(){ hbox.pack_end(button, FALSE, FALSE, 0); button.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); - gtk_widget_set_size_request( button, 60, -1 ); + button.dimensions(60, -1); // initialize dialog gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( show2check ), portals.show_2d ); diff --git a/contrib/prtview/LoadPortalFileDialog.cpp b/contrib/prtview/LoadPortalFileDialog.cpp index 0d095a74..890658e1 100644 --- a/contrib/prtview/LoadPortalFileDialog.cpp +++ b/contrib/prtview/LoadPortalFileDialog.cpp @@ -113,7 +113,7 @@ int DoLoadPortalFileDialog(){ button.show(); hbox.pack_end(button, FALSE, FALSE, 0); button.connect( "clicked", G_CALLBACK( change_clicked ), entry ); - gtk_widget_set_size_request( button, 60, -1 ); + button.dimensions(60, -1); hbox = ui::HBox( FALSE, 5 ); hbox.show(); @@ -124,14 +124,14 @@ int DoLoadPortalFileDialog(){ hbox.pack_end(button, FALSE, FALSE, 0); button.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); - gtk_widget_set_size_request( button, 60, -1 ); + button.dimensions(60, -1); button = ui::Button( "OK" ); button.show(); hbox.pack_end(button, FALSE, FALSE, 0); button.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); - gtk_widget_set_size_request( button, 60, -1 ); + button.dimensions(60, -1); strcpy( portals.fn, GlobalRadiant().getMapName() ); char* fn = strrchr( portals.fn, '.' ); diff --git a/libs/gtkutil/dialog.cpp b/libs/gtkutil/dialog.cpp index 4c50e7b9..6200ba64 100644 --- a/libs/gtkutil/dialog.cpp +++ b/libs/gtkutil/dialog.cpp @@ -58,7 +58,7 @@ ui::Table create_dialog_table( unsigned int rows, unsigned int columns, unsigned ui::Button create_dialog_button( const char* label, GCallback func, gpointer data ){ auto button = ui::Button( label ); - gtk_widget_set_size_request( button , 64, -1 ); + button.dimensions(64, -1); button.show(); button.connect( "clicked", func, data ); return button; @@ -118,7 +118,7 @@ ui::Window create_fixedsize_modal_dialog_window( ui::Window parent, const char* window_remove_minmax( window ); - //gtk_widget_set_size_request(window, width, height); + //window.dimensions(width, height); //gtk_window_set_default_size(window, width, height); //gtk_window_resize(window, width, height); //GdkGeometry geometry = { width, height, -1, -1, width, height, -1, -1, -1, -1, GDK_GRAVITY_STATIC, }; diff --git a/libs/gtkutil/messagebox.cpp b/libs/gtkutil/messagebox.cpp index d71dfadb..56b40131 100644 --- a/libs/gtkutil/messagebox.cpp +++ b/libs/gtkutil/messagebox.cpp @@ -30,7 +30,7 @@ ui::Widget create_padding( int width, int height ){ ui::Alignment widget = ui::Alignment( 0.0, 0.0, 0.0, 0.0 ); widget.show(); - gtk_widget_set_size_request( widget, width, height ); + widget.dimensions(width, height); return widget; } diff --git a/radiant/console.cpp b/radiant/console.cpp index 8c72bcd7..e12b4733 100644 --- a/radiant/console.cpp +++ b/radiant/console.cpp @@ -111,7 +111,7 @@ ui::Widget Console_constructWindow( ui::Window toplevel ){ { auto text = ui::TextView(ui::New); - gtk_widget_set_size_request( text, 0, -1 ); // allow shrinking + text.dimensions(0, -1); // allow shrinking gtk_text_view_set_wrap_mode( text, GTK_WRAP_WORD ); gtk_text_view_set_editable( text, FALSE ); scr.add(text); diff --git a/radiant/dialog.cpp b/radiant/dialog.cpp index 769b4e67..c6672ae4 100644 --- a/radiant/dialog.cpp +++ b/radiant/dialog.cpp @@ -50,7 +50,7 @@ ui::Entry DialogEntry_new(){ auto entry = ui::Entry(ui::New); entry.show(); - gtk_widget_set_size_request( entry , 64, -1 ); + entry.dimensions(64, -1); return entry; } @@ -83,7 +83,7 @@ ui::SpinButton DialogSpinner_new( double value, double lower, double upper, int } auto spin = ui::SpinButton( ui::Adjustment( value, lower, upper, step, 10, 0 ), step, digits ); spin.show(); - gtk_widget_set_size_request( spin , 64, -1 ); + spin.dimensions(64, -1); return spin; } diff --git a/radiant/entityinspector.cpp b/radiant/entityinspector.cpp index cc523adf..8fd73db5 100644 --- a/radiant/entityinspector.cpp +++ b/radiant/entityinspector.cpp @@ -1352,7 +1352,7 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){ { auto text = ui::TextView(ui::New); - gtk_widget_set_size_request( text , 0, -1 ); // allow shrinking + text.dimensions(0, -1); // allow shrinking gtk_text_view_set_wrap_mode( text, GTK_WRAP_WORD ); gtk_text_view_set_editable( text, FALSE ); text.show(); diff --git a/radiant/findtexturedialog.cpp b/radiant/findtexturedialog.cpp index 14dc5406..e4bf2f12 100644 --- a/radiant/findtexturedialog.cpp +++ b/radiant/findtexturedialog.cpp @@ -189,14 +189,14 @@ ui::Window FindTextureDialog::BuildDialog(){ vbox.pack_start( button, FALSE, FALSE, 0 ); button.connect( "clicked", G_CALLBACK( OnApply ), 0 ); - gtk_widget_set_size_request( button, 60, -1 ); + button.dimensions(60, -1); button = ui::Button( "Close" ); button.show(); vbox.pack_start( button, FALSE, FALSE, 0 ); button.connect( "clicked", G_CALLBACK( OnClose ), 0 ); - gtk_widget_set_size_request( button, 60, -1 ); + button.dimensions(60, -1); return dlg; } diff --git a/radiant/gtkdlgs.cpp b/radiant/gtkdlgs.cpp index fdecfc99..8338c203 100644 --- a/radiant/gtkdlgs.cpp +++ b/radiant/gtkdlgs.cpp @@ -738,14 +738,14 @@ static void CreateGtkTextEditor(){ hbox.pack_end(button, FALSE, FALSE, 0); button.connect( "clicked", G_CALLBACK( editor_close ), dlg ); - gtk_widget_set_size_request( button, 60, -1 ); + button.dimensions(60, -1); button = ui::Button( "Save" ); button.show(); hbox.pack_end(button, FALSE, FALSE, 0); button.connect( "clicked", G_CALLBACK( editor_save ), dlg ); - gtk_widget_set_size_request( button, 60, -1 ); + button.dimensions(60, -1); text_editor = dlg; text_widget = text; diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index eae58cdd..f23f7323 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -1631,7 +1631,7 @@ WaitDialog create_wait_dialog( const char* title, const char* text ){ gtk_misc_set_alignment( GTK_MISC( dialog.m_label ), 0.0, 0.5 ); gtk_label_set_justify( dialog.m_label, GTK_JUSTIFY_LEFT ); dialog.m_label.show(); - gtk_widget_set_size_request( dialog.m_label , 200, -1 ); + dialog.m_label.dimensions(200, -1); dialog.m_window.add(dialog.m_label); } @@ -2674,7 +2674,7 @@ ui::Window create_splash(){ image.show(); window.add(image); - gtk_widget_set_size_request( window , -1, -1 ); + window.dimensions(-1, -1); window.show(); return window; diff --git a/radiant/patchdialog.cpp b/radiant/patchdialog.cpp index c38469e3..b4af86de 100644 --- a/radiant/patchdialog.cpp +++ b/radiant/patchdialog.cpp @@ -609,7 +609,7 @@ ui::Window PatchInspector::BuildDialog(){ combo.show(); table.attach(combo, {0, 1, 1, 2}, {(GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0)}, {0, 0}); - gtk_widget_set_size_request( combo , 60, -1 ); + combo.dimensions(60, -1); m_pRowCombo = combo; } @@ -620,7 +620,7 @@ ui::Window PatchInspector::BuildDialog(){ combo.show(); table.attach(combo, {1, 2, 1, 2}, {(GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0)}, {0, 0}); - gtk_widget_set_size_request( combo , 60, -1 ); + combo.dimensions(60, -1); m_pColCombo = combo; } } @@ -806,7 +806,7 @@ ui::Window PatchInspector::BuildDialog(){ button.show(); table.attach(button, {3, 4, 2, 3}, {GTK_FILL, 0}); button.connect( "clicked", G_CALLBACK( OnBtnPatchFlipX ), 0 ); - gtk_widget_set_size_request( button , 60, -1 ); + button.dimensions(60, -1); } { auto label = ui::Label( "Vertical Stretch Step" ); @@ -819,7 +819,7 @@ ui::Window PatchInspector::BuildDialog(){ button.show(); table.attach(button, {3, 4, 3, 4}, {GTK_FILL, 0}); button.connect( "clicked", G_CALLBACK( OnBtnPatchFlipY ), 0 ); - gtk_widget_set_size_request( button , 60, -1 ); + button.dimensions(60, -1); } { auto label = ui::Label( "Rotate Step" ); @@ -831,7 +831,7 @@ ui::Window PatchInspector::BuildDialog(){ auto entry = ui::Entry(ui::New); entry.show(); table.attach(entry, {0, 1, 0, 1}, {GTK_FILL, 0}); - gtk_widget_set_size_request( entry , 50, -1 ); + entry.dimensions(50, -1); g_object_set_data( G_OBJECT( window ), "hshift_entry", (void *) entry ); // we fill in this data, if no patch is selected the widgets are unmodified when the inspector is raised // so we need to have at least one initialisation somewhere @@ -844,14 +844,14 @@ ui::Window PatchInspector::BuildDialog(){ auto spin = ui::SpinButton( adj, 1, 0 ); spin.show(); table.attach(spin, {1, 2, 0, 1}, {0, 0}); - gtk_widget_set_size_request( spin , 10, -1 ); + spin.dimensions(10, -1); gtk_widget_set_can_focus( spin, false ); } { auto entry = ui::Entry(ui::New); entry.show(); table.attach(entry, {0, 1, 1, 2}, {GTK_FILL, 0}); - gtk_widget_set_size_request( entry , 50, -1 ); + entry.dimensions(50, -1); entry_set_float( entry, g_pi_globals.shift[1] ); auto adj = ui::Adjustment( 0, -8192, 8192, 1, 1, 0 ); @@ -861,14 +861,14 @@ ui::Window PatchInspector::BuildDialog(){ auto spin = ui::SpinButton( adj, 1, 0 ); spin.show(); table.attach(spin, {1, 2, 1, 2}, {0, 0}); - gtk_widget_set_size_request( spin , 10, -1 ); + spin.dimensions(10, -1); gtk_widget_set_can_focus( spin, false ); } { auto entry = ui::Entry(ui::New); entry.show(); table.attach(entry, {0, 1, 2, 3}, {GTK_FILL, 0}); - gtk_widget_set_size_request( entry , 50, -1 ); + entry.dimensions(50, -1); entry_set_float( entry, g_pi_globals.scale[0] ); auto adj = ui::Adjustment( 0, -1000, 1000, 1, 1, 0 ); @@ -878,14 +878,14 @@ ui::Window PatchInspector::BuildDialog(){ auto spin = ui::SpinButton( adj, 1, 0 ); spin.show(); table.attach(spin, {1, 2, 2, 3}, {0, 0}); - gtk_widget_set_size_request( spin , 10, -1 ); + spin.dimensions(10, -1); gtk_widget_set_can_focus( spin, false ); } { auto entry = ui::Entry(ui::New); entry.show(); table.attach(entry, {0, 1, 3, 4}, {GTK_FILL, 0}); - gtk_widget_set_size_request( entry , 50, -1 ); + entry.dimensions(50, -1); entry_set_float( entry, g_pi_globals.scale[1] ); auto adj = ui::Adjustment( 0, -1000, 1000, 1, 1, 0 ); @@ -895,14 +895,14 @@ ui::Window PatchInspector::BuildDialog(){ auto spin = ui::SpinButton( adj, 1, 0 ); spin.show(); table.attach(spin, {1, 2, 3, 4}, {0, 0}); - gtk_widget_set_size_request( spin , 10, -1 ); + spin.dimensions(10, -1); gtk_widget_set_can_focus( spin, false ); } { auto entry = ui::Entry(ui::New); entry.show(); table.attach(entry, {0, 1, 4, 5}, {GTK_FILL, 0}); - gtk_widget_set_size_request( entry , 50, -1 ); + entry.dimensions(50, -1); entry_set_float( entry, g_pi_globals.rotate ); 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 @@ -912,7 +912,7 @@ ui::Window PatchInspector::BuildDialog(){ auto spin = ui::SpinButton( adj, 1, 0 ); spin.show(); table.attach(spin, {1, 2, 4, 5}, {0, 0}); - gtk_widget_set_size_request( spin , 10, -1 ); + spin.dimensions(10, -1); gtk_widget_set_can_focus( spin, false ); } } @@ -924,35 +924,35 @@ ui::Window PatchInspector::BuildDialog(){ button.show(); hbox2.pack_end(button, TRUE, FALSE, 0); button.connect( "clicked", G_CALLBACK( OnBtnPatchAutoCap ), 0 ); - gtk_widget_set_size_request( button , 60, -1 ); + button.dimensions(60, -1); } { auto button = ui::Button( "CAP" ); button.show(); hbox2.pack_end(button, TRUE, FALSE, 0); button.connect( "clicked", G_CALLBACK( OnBtnPatchdetails ), 0 ); - gtk_widget_set_size_request( button , 60, -1 ); + button.dimensions(60, -1); } { auto button = ui::Button( "Set..." ); button.show(); hbox2.pack_end(button, TRUE, FALSE, 0); button.connect( "clicked", G_CALLBACK( OnBtnPatchreset ), 0 ); - gtk_widget_set_size_request( button , 60, -1 ); + button.dimensions(60, -1); } { auto button = ui::Button( "Natural" ); button.show(); hbox2.pack_end(button, TRUE, FALSE, 0); button.connect( "clicked", G_CALLBACK( OnBtnPatchnatural ), 0 ); - gtk_widget_set_size_request( button , 60, -1 ); + button.dimensions(60, -1); } { auto button = ui::Button( "Fit" ); button.show(); hbox2.pack_end(button, TRUE, FALSE, 0); button.connect( "clicked", G_CALLBACK( OnBtnPatchfit ), 0 ); - gtk_widget_set_size_request( button , 60, -1 ); + button.dimensions(60, -1); } } } diff --git a/radiant/select.cpp b/radiant/select.cpp index 98565705..7b4319c6 100644 --- a/radiant/select.cpp +++ b/radiant/select.cpp @@ -941,7 +941,7 @@ void DoRotateDlg(){ auto spin = ui::SpinButton( adj, 1, 0 ); spin.show(); table.attach(spin, {1, 2, 0, 1}, {GTK_EXPAND | GTK_FILL, 0}); - gtk_widget_set_size_request( spin , 64, -1 ); + spin.dimensions(64, -1); gtk_spin_button_set_wrap( spin, TRUE ); gtk_widget_grab_focus( spin ); @@ -953,7 +953,7 @@ void DoRotateDlg(){ auto spin = ui::SpinButton( adj, 1, 0 ); spin.show(); table.attach(spin, {1, 2, 1, 2}, {GTK_EXPAND | GTK_FILL, 0}); - gtk_widget_set_size_request( spin , 64, -1 ); + spin.dimensions(64, -1); gtk_spin_button_set_wrap( spin, TRUE ); g_rotate_dialog.y = spin; @@ -963,7 +963,7 @@ void DoRotateDlg(){ auto spin = ui::SpinButton( adj, 1, 0 ); spin.show(); table.attach(spin, {1, 2, 2, 3}, {GTK_EXPAND | GTK_FILL, 0}); - gtk_widget_set_size_request( spin , 64, -1 ); + spin.dimensions(64, -1); gtk_spin_button_set_wrap( spin, TRUE ); g_rotate_dialog.z = spin; diff --git a/radiant/surfacedialog.cpp b/radiant/surfacedialog.cpp index ccf5663b..22e83b27 100644 --- a/radiant/surfacedialog.cpp +++ b/radiant/surfacedialog.cpp @@ -637,7 +637,7 @@ ui::Window SurfaceInspector::BuildDialog(){ m_hshiftSpinner.connect( spin ); spin.show(); table.attach(spin, {1, 2, 0, 1}, {GTK_EXPAND | GTK_FILL, 0}); - gtk_widget_set_size_request( spin , 60, -1 ); + spin.dimensions(60, -1); } { ui::Widget label = ui::Label( "Step" ); @@ -649,7 +649,7 @@ ui::Window SurfaceInspector::BuildDialog(){ auto entry = ui::Entry(ui::New); entry.show(); table.attach(entry, {3, 4, 0, 1}, {GTK_EXPAND | GTK_FILL, 0}); - gtk_widget_set_size_request( entry , 50, -1 ); + entry.dimensions(50, -1); m_hshiftIncrement.m_entry = entry; m_hshiftEntry.connect( entry ); } @@ -665,7 +665,7 @@ ui::Window SurfaceInspector::BuildDialog(){ m_vshiftSpinner.connect( spin ); spin.show(); table.attach(spin, {1, 2, 1, 2}, {GTK_FILL, 0}); - gtk_widget_set_size_request( spin , 60, -1 ); + spin.dimensions(60, -1); } { ui::Widget label = ui::Label( "Step" ); @@ -677,7 +677,7 @@ ui::Window SurfaceInspector::BuildDialog(){ auto entry = ui::Entry(ui::New); entry.show(); table.attach(entry, {3, 4, 1, 2}, {GTK_FILL, 0}); - gtk_widget_set_size_request( entry , 50, -1 ); + entry.dimensions(50, -1); m_vshiftIncrement.m_entry = entry; m_vshiftEntry.connect( entry ); } @@ -693,7 +693,7 @@ ui::Window SurfaceInspector::BuildDialog(){ m_hscaleSpinner.connect( spin ); spin.show(); table.attach(spin, {1, 2, 2, 3}, {GTK_FILL, 0}); - gtk_widget_set_size_request( spin , 60, -1 ); + spin.dimensions(60, -1); } { ui::Widget label = ui::Label( "Step" ); @@ -705,7 +705,7 @@ ui::Window SurfaceInspector::BuildDialog(){ auto entry = ui::Entry(ui::New); entry.show(); table.attach(entry, {3, 4, 2, 3}, {GTK_FILL, 0}); - gtk_widget_set_size_request( entry , 50, -1 ); + entry.dimensions(50, -1); m_hscaleIncrement.m_entry = entry; m_hscaleEntry.connect( entry ); } @@ -721,7 +721,7 @@ ui::Window SurfaceInspector::BuildDialog(){ m_vscaleSpinner.connect( spin ); spin.show(); table.attach(spin, {1, 2, 3, 4}, {GTK_FILL, 0}); - gtk_widget_set_size_request( spin , 60, -1 ); + spin.dimensions(60, -1); } { ui::Widget label = ui::Label( "Step" ); @@ -733,7 +733,7 @@ ui::Window SurfaceInspector::BuildDialog(){ auto entry = ui::Entry(ui::New); entry.show(); table.attach(entry, {3, 4, 3, 4}, {GTK_FILL, 0}); - gtk_widget_set_size_request( entry , 50, -1 ); + entry.dimensions(50, -1); m_vscaleIncrement.m_entry = entry; m_vscaleEntry.connect( entry ); } @@ -749,7 +749,7 @@ ui::Window SurfaceInspector::BuildDialog(){ m_rotateSpinner.connect( spin ); spin.show(); table.attach(spin, {1, 2, 4, 5}, {GTK_FILL, 0}); - gtk_widget_set_size_request( spin , 60, -1 ); + spin.dimensions(60, -1); gtk_spin_button_set_wrap( spin, TRUE ); } { @@ -762,7 +762,7 @@ ui::Window SurfaceInspector::BuildDialog(){ auto entry = ui::Entry(ui::New); entry.show(); table.attach(entry, {3, 4, 4, 5}, {GTK_FILL, 0}); - gtk_widget_set_size_request( entry , 50, -1 ); + entry.dimensions(50, -1); m_rotateIncrement.m_entry = entry; m_rotateEntry.connect( entry ); } @@ -812,7 +812,7 @@ ui::Window SurfaceInspector::BuildDialog(){ table.attach(button, {0, 1, 1, 2}, {GTK_EXPAND | GTK_FILL, 0}); button.connect( "clicked", G_CALLBACK( OnBtnAxial ), 0 ); - gtk_widget_set_size_request( button, 60, -1 ); + button.dimensions(60, -1); } { ui::Widget button = ui::Button( "Fit" ); @@ -820,7 +820,7 @@ ui::Window SurfaceInspector::BuildDialog(){ table.attach(button, {1, 2, 1, 2}, {GTK_EXPAND | GTK_FILL, 0}); button.connect( "clicked", G_CALLBACK( OnBtnFaceFit ), 0 ); - gtk_widget_set_size_request( button, 60, -1 ); + button.dimensions(60, -1); } { ui::Widget button = ui::Button( "CAP" ); @@ -828,7 +828,7 @@ ui::Window SurfaceInspector::BuildDialog(){ table.attach(button, {0, 1, 3, 4}, {GTK_EXPAND | GTK_FILL, 0}); button.connect( "clicked", G_CALLBACK( OnBtnPatchdetails ), 0 ); - gtk_widget_set_size_request( button, 60, -1 ); + button.dimensions(60, -1); } { ui::Widget button = ui::Button( "Set..." ); @@ -836,7 +836,7 @@ ui::Window SurfaceInspector::BuildDialog(){ table.attach(button, {1, 2, 3, 4}, {GTK_EXPAND | GTK_FILL, 0}); button.connect( "clicked", G_CALLBACK( OnBtnPatchreset ), 0 ); - gtk_widget_set_size_request( button, 60, -1 ); + button.dimensions(60, -1); } { ui::Widget button = ui::Button( "Natural" ); @@ -844,7 +844,7 @@ ui::Window SurfaceInspector::BuildDialog(){ table.attach(button, {2, 3, 3, 4}, {GTK_EXPAND | GTK_FILL, 0}); button.connect( "clicked", G_CALLBACK( OnBtnPatchnatural ), 0 ); - gtk_widget_set_size_request( button, 60, -1 ); + button.dimensions(60, -1); } { ui::Widget button = ui::Button( "Fit" ); @@ -852,20 +852,20 @@ ui::Window SurfaceInspector::BuildDialog(){ table.attach(button, {3, 4, 3, 4}, {GTK_EXPAND | GTK_FILL, 0}); button.connect( "clicked", G_CALLBACK( OnBtnPatchFit ), 0 ); - gtk_widget_set_size_request( button, 60, -1 ); + button.dimensions(60, -1); } { auto spin = ui::SpinButton( ui::Adjustment( 1, 0, 1 << 16, 1, 10, 0 ), 0, 6 ); spin.show(); table.attach(spin, {2, 3, 1, 2}, {GTK_EXPAND | GTK_FILL, 0}); - gtk_widget_set_size_request( spin, 60, -1 ); + spin.dimensions(60, -1); AddDialogData( *GTK_SPIN_BUTTON( spin ), m_fitHorizontal ); } { auto spin = ui::SpinButton( ui::Adjustment( 1, 0, 1 << 16, 1, 10, 0 ), 0, 6 ); spin.show(); table.attach(spin, {3, 4, 1, 2}, {GTK_EXPAND | GTK_FILL, 0}); - gtk_widget_set_size_request( spin, 60, -1 ); + spin.dimensions(60, -1); AddDialogData( *GTK_SPIN_BUTTON( spin ), m_fitVertical ); } } @@ -977,7 +977,7 @@ ui::Window SurfaceInspector::BuildDialog(){ gtk_widget_set_can_focus( TexTool::g_textoolWin, true ); // <-- end stuff... TexTool::g_textoolWin.show(); - gtk_widget_set_size_request( TexTool::g_textoolWin, -1, 240 ); //Yeah! + TexTool::g_textoolWin.dimensions( -1, 240 ); //Yeah! frame.add(TexTool::g_textoolWin); TexTool::g_textoolWin.connect( "size_allocate", G_CALLBACK( TexTool::size_allocate ), NULL ); diff --git a/radiant/texwindow.cpp b/radiant/texwindow.cpp index 7607c4b9..20c5bd9c 100644 --- a/radiant/texwindow.cpp +++ b/radiant/texwindow.cpp @@ -2182,8 +2182,8 @@ ui::Widget TextureBrowser_constructWindow( ui::Window toplevel ){ m_btn_right.add(m_arrow_right); // workaround. the size of the tag frame depends of the requested size of the arrow buttons. - gtk_widget_set_size_request( m_arrow_left, -1, 68 ); - gtk_widget_set_size_request( m_arrow_right, -1, 68 ); + m_arrow_left.dimensions(-1, 68); + m_arrow_right.dimensions(-1, 68); frame_table.attach(m_btn_left, {1, 2, 1, 2}, {GTK_SHRINK, GTK_EXPAND}); frame_table.attach(m_btn_right, {1, 2, 2, 3}, {GTK_SHRINK, GTK_EXPAND});