]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - libs/gtkutil/messagebox.cpp
Merge commit '4645e19ce9e8f8034233ac965a4103a13b75714c' into garux-merge
[xonotic/netradiant.git] / libs / gtkutil / messagebox.cpp
index 28e29a147a35f0939f1e5fc41d54c9a87a435860..82d6dfe4b02ad2ddc49327f7cd4bc91e4911771c 100644 (file)
@@ -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 ) {
@@ -82,7 +80,7 @@ EMessageBoxReturn gtk_MessageBox( ui::Widget parent, const char* text, const cha
        auto iconBox = create_dialog_hbox( 16, 0 );
        hboxDummy.pack_start( iconBox, FALSE, FALSE, 0 );
 
-       auto image = ui::Image(GTK_IMAGE( gtk_image_new_from_stock( messagebox_stock_icon( icon ), GTK_ICON_SIZE_DIALOG ) ));
+       auto image = ui::Image::from( gtk_image_new_from_stock( messagebox_stock_icon( icon ), GTK_ICON_SIZE_DIALOG ) );
        image.show();
        iconBox.pack_start( image, FALSE, FALSE, 0 );