X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=radiant%2Fmru.cpp;h=3a01d142ef7297069db4e5870d595693672081ee;hb=66dab04732db09384c0031d3271a78533811a184;hp=cb833010f3bc74fa0f0886269e423673ccf979d6;hpb=e4287c28bb2dafedc81c66e63951d947cfbeb225;p=xonotic%2Fnetradiant.git diff --git a/radiant/mru.cpp b/radiant/mru.cpp index cb833010..3a01d142 100644 --- a/radiant/mru.cpp +++ b/radiant/mru.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include "os/file.h" #include "generic/callback.h" @@ -121,7 +121,7 @@ void MRU_AddFile( const char *str ){ MRU_SetText( 0, str ); gtk_widget_set_sensitive( GTK_WIDGET( MRU_items[0] ), TRUE ); - gtk_widget_show( GTK_WIDGET( MRU_items[MRU_used - 1] ) ); + ui::Widget(GTK_WIDGET( MRU_items[MRU_used - 1] )).show(); } void MRU_Init(){ @@ -136,7 +136,7 @@ void MRU_AddWidget( GtkMenuItem *widget, std::size_t pos ){ if ( pos < MRU_used ) { MRU_updateWidget( pos, MRU_GetText( pos ) ); gtk_widget_set_sensitive( GTK_WIDGET( MRU_items[0] ), TRUE ); - gtk_widget_show( GTK_WIDGET( MRU_items[pos] ) ); + ui::Widget(GTK_WIDGET( MRU_items[pos] )).show(); } } } @@ -159,7 +159,8 @@ void MRU_Activate( std::size_t index ){ MRU_SetText( i, MRU_GetText( i + 1 ) ); if ( MRU_used == 0 ) { - gtk_label_set_text( GTK_LABEL( GTK_BIN( MRU_items[0] )->child ), "Recent Files" ); + auto label = ui::Label(GTK_LABEL(gtk_bin_get_child(GTK_BIN(MRU_items[0] )) )); + label.text("Recent Files"); gtk_widget_set_sensitive( GTK_WIDGET( MRU_items[0] ), FALSE ); } else @@ -191,7 +192,7 @@ LoadMRU g_load_mru2( 2 ); LoadMRU g_load_mru3( 3 ); LoadMRU g_load_mru4( 4 ); -void MRU_constructMenu( GtkMenu* menu ){ +void MRU_constructMenu( ui::Menu menu ){ { GtkMenuItem* item = create_menu_item_with_mnemonic( menu, "_1", LoadMRUCaller( g_load_mru1 ) ); gtk_widget_set_sensitive( GTK_WIDGET( item ), FALSE );