X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fnetradiant.git;a=blobdiff_plain;f=libs%2Fgtkutil%2Fmessagebox.cpp;h=56b401318e169d747674c2a4213bbf76e392cbd1;hp=334c4e78437f11662ed19526400160080db0b4c0;hb=a9e5bfdf2a458e89978ee52ebbd3711884b54b29;hpb=fd6b262a39ceeda3f991fc6bd8f767353d149374 diff --git a/libs/gtkutil/messagebox.cpp b/libs/gtkutil/messagebox.cpp index 334c4e78..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; } @@ -51,15 +51,13 @@ const char* messagebox_stock_icon( EMessageBoxIcon type ){ } } -EMessageBoxReturn gtk_MessageBox( ui::Widget parent, const char* text, const char* title, EMessageBoxType type, EMessageBoxIcon icon ){ +EMessageBoxReturn gtk_MessageBox( ui::Window parentWindow, const char* text, const char* title, EMessageBoxType type, EMessageBoxIcon icon ){ ModalDialog dialog; ModalDialogButton ok_button( dialog, eIDOK ); ModalDialogButton cancel_button( dialog, eIDCANCEL ); ModalDialogButton yes_button( dialog, eIDYES ); ModalDialogButton no_button( dialog, eIDNO ); - ui::Window parentWindow = ui::Window(parent ? GTK_WINDOW( parent ) : 0); - ui::Window window = create_fixedsize_modal_dialog_window( parentWindow, title, dialog, 400, 100 ); if ( parentWindow ) { @@ -110,8 +108,8 @@ EMessageBoxReturn gtk_MessageBox( ui::Widget parent, const char* text, const cha if ( type == eMB_OK ) { auto button = create_modal_dialog_button( "OK", ok_button ); hbox.pack_start( button, TRUE, FALSE, 0 ); - gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 ); - gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 ); + gtk_widget_add_accelerator( button , "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 ); + gtk_widget_add_accelerator( button , "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 ); widget_make_default( button ); button.show(); @@ -121,7 +119,7 @@ EMessageBoxReturn gtk_MessageBox( ui::Widget parent, const char* text, const cha { auto button = create_modal_dialog_button( "OK", ok_button ); hbox.pack_start( button, TRUE, FALSE, 0 ); - gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 ); + gtk_widget_add_accelerator( button , "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 ); widget_make_default( button ); button.show(); } @@ -129,7 +127,7 @@ EMessageBoxReturn gtk_MessageBox( ui::Widget parent, const char* text, const cha { auto button = create_modal_dialog_button( "OK", cancel_button ); hbox.pack_start( button, TRUE, FALSE, 0 ); - gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 ); + gtk_widget_add_accelerator( button , "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 ); button.show(); }