From: Clinton Freeman Date: Sun, 1 Apr 2012 20:54:44 +0000 (-0400) Subject: reorganized about dialog and updated logo. fixed X-Git-Tag: xonotic-v0.7.0~16^2~3^2~1^2^2~2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=adeab050ef4bf7e9fc01a0b67e385c72166399ef;p=xonotic%2Fnetradiant.git reorganized about dialog and updated logo. fixed broken links --- diff --git a/install/bitmaps/logo.png b/install/bitmaps/logo.png new file mode 100644 index 00000000..cfa570bd Binary files /dev/null and b/install/bitmaps/logo.png differ diff --git a/radiant/gtkdlgs.cpp b/radiant/gtkdlgs.cpp index 3c3ea0dd..7174c8d0 100644 --- a/radiant/gtkdlgs.cpp +++ b/radiant/gtkdlgs.cpp @@ -2497,6 +2497,8 @@ void DoThickenDlg(){ // ============================================================================= // About dialog (no program is complete without one) +static const int ABT_WIDGET_PADDING = 8; + void about_button_changelog( GtkWidget *widget, gpointer data ){ Str log; log = g_strAppPath; @@ -2512,11 +2514,15 @@ void about_button_credits( GtkWidget *widget, gpointer data ){ } void DoAbout(){ - GtkWidget *dlg, *vbox, *vbox2, *hbox, *frame, *table, *label, *pixmap, *button, *sc_extensions, *text_extensions; int loop = 1, ret = IDCANCEL; - dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); + GtkWidget *main_vbox, *button_hbox, *gl_ext_hbox, *gl_ext_sc, *gl_ext_text; + GtkWidget *frame, *button, *table, *label, *image; + + // dialog + GtkWidget *dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL ); gtk_window_set_title( GTK_WINDOW( dlg ), _( "About GtkRadiant" ) ); + gtk_window_set_resizable( GTK_WINDOW( dlg ), FALSE ); gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", @@ -2524,77 +2530,53 @@ void DoAbout(){ g_object_set_data( G_OBJECT( dlg ), "loop", &loop ); g_object_set_data( G_OBJECT( dlg ), "ret", &ret ); - vbox = gtk_vbox_new( FALSE, 10 ); - gtk_widget_show( vbox ); - gtk_container_add( GTK_CONTAINER( dlg ), vbox ); - gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 ); - - hbox = gtk_hbox_new( FALSE, 5 ); - gtk_widget_show( hbox ); - gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, TRUE, 0 ); - - vbox2 = gtk_vbox_new( FALSE, 5 ); - gtk_widget_show( vbox2 ); - gtk_box_pack_start( GTK_BOX( hbox ), vbox2, TRUE, FALSE, 0 ); - - frame = gtk_frame_new( NULL ); - gtk_widget_show( frame ); - gtk_box_pack_start( GTK_BOX( vbox2 ), frame, FALSE, FALSE, 0 ); - gtk_frame_set_shadow_type( GTK_FRAME( frame ), GTK_SHADOW_IN ); - - pixmap = new_pixmap( g_pParentWnd->m_pWidget, "logo.bmp" ); - gtk_widget_show( pixmap ); - gtk_container_add( GTK_CONTAINER( frame ), pixmap ); - - label = gtk_label_new( "GtkRadiant " RADIANT_VERSION "\n" - __DATE__ "\n\n" + // layout top logo and everything else vertically without border padding + GtkWidget *outer_vbox = gtk_vbox_new( FALSE, 0 ); + gtk_widget_show( outer_vbox ); + gtk_container_add( GTK_CONTAINER( dlg ), outer_vbox ); + gtk_container_set_border_width( GTK_CONTAINER( outer_vbox ), 0 ); + + // radiant logo + CString s = g_strBitmapsPath; + s += "logo.png"; + image = gtk_image_new_from_file( s.GetBuffer() ); + gtk_widget_show( image ); + gtk_box_pack_start( GTK_BOX( outer_vbox ), image, FALSE, FALSE, 0 ); + + // all other widgets layout + main_vbox = gtk_vbox_new( FALSE, ABT_WIDGET_PADDING ); + gtk_widget_show( main_vbox ); + gtk_box_pack_start( GTK_BOX( outer_vbox ), main_vbox, FALSE, FALSE, 0 ); + gtk_container_set_border_width( GTK_CONTAINER( main_vbox ), ABT_WIDGET_PADDING ); + + // informative text + GtkWidget *info_hbox = gtk_hbox_new( FALSE, 0 ); + gtk_widget_show( info_hbox ); + gtk_box_pack_start( GTK_BOX( main_vbox ), info_hbox, FALSE, FALSE, 0 ); + + label = gtk_label_new( "GtkRadiant " RADIANT_VERSION " - " __DATE__ "\n" RADIANT_ABOUTMSG "\n\n" - "By qeradiant.com\n\n" - "This product contains software technology\n" - "from id Software, Inc. ('id Technology').\n" - "id Technology 2000 id Software,Inc.\n\n" - "GtkRadiant is unsupported, however\n" - "you may report your problems at\n" - "http://zerowing.idsoftware.com/bugzilla" - ); + "By http://icculus.org/gtkradiant/\n\n" + "This product contains software technology from id Software, Inc.\n" + "('id Technology'). id Technology 2000 id Software, Inc.\n\n" + "GtkRadiant is unsupported, however you may report your\n" + "problems at https://github.com/TTimo/GtkRadiant/issues" ); gtk_widget_show( label ); - gtk_box_pack_start( GTK_BOX( hbox ), label, FALSE, FALSE, 0 ); - gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 ); + gtk_box_pack_start( GTK_BOX( info_hbox ), label, FALSE, FALSE, 0 ); gtk_label_set_justify( GTK_LABEL( label ), GTK_JUSTIFY_LEFT ); - vbox2 = gtk_vbox_new( FALSE, 5 ); - gtk_widget_show( vbox2 ); - gtk_box_pack_start( GTK_BOX( hbox ), vbox2, FALSE, TRUE, 0 ); - - button = gtk_button_new_with_label( _( "OK" ) ); - gtk_widget_show( button ); - gtk_box_pack_start( GTK_BOX( vbox2 ), button, FALSE, FALSE, 0 ); - gtk_signal_connect( GTK_OBJECT( button ), "clicked", - GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); - - button = gtk_button_new_with_label( _( "Credits" ) ); - gtk_widget_show( button ); - gtk_box_pack_start( GTK_BOX( vbox2 ), button, FALSE, FALSE, 0 ); - gtk_signal_connect( GTK_OBJECT( button ), "clicked", - GTK_SIGNAL_FUNC( about_button_credits ), NULL ); - - button = gtk_button_new_with_label( _( "Changelog" ) ); - gtk_widget_show( button ); - gtk_box_pack_start( GTK_BOX( vbox2 ), button, FALSE, FALSE, 0 ); - gtk_signal_connect( GTK_OBJECT( button ), "clicked", - GTK_SIGNAL_FUNC( about_button_changelog ), NULL ); - + // OpenGL properties frame = gtk_frame_new( _( "OpenGL Properties" ) ); gtk_widget_show( frame ); - gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, FALSE, 0 ); + gtk_box_pack_start( GTK_BOX( main_vbox ), frame, FALSE, FALSE, 0 ); table = gtk_table_new( 3, 2, FALSE ); gtk_widget_show( table ); gtk_container_add( GTK_CONTAINER( frame ), table ); - gtk_table_set_row_spacings( GTK_TABLE( table ), 5 ); - gtk_table_set_col_spacings( GTK_TABLE( table ), 5 ); - gtk_container_set_border_width( GTK_CONTAINER( table ), 5 ); + gtk_table_set_row_spacings( GTK_TABLE( table ), 4 ); + gtk_table_set_col_spacings( GTK_TABLE( table ), 4 ); + gtk_container_set_border_width( GTK_CONTAINER( table ), 4 ); label = gtk_label_new( _( "Vendor:" ) ); gtk_widget_show( label ); @@ -2638,28 +2620,52 @@ void DoAbout(){ (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 ); + // OpenGL extensions frame = gtk_frame_new( _( "OpenGL Extensions" ) ); gtk_widget_show( frame ); - gtk_box_pack_start( GTK_BOX( vbox ), frame, TRUE, TRUE, 0 ); + gtk_box_pack_start( GTK_BOX( main_vbox ), frame, TRUE, TRUE, 0 ); + + gl_ext_hbox = gtk_hbox_new( FALSE, ABT_WIDGET_PADDING ); + gtk_widget_show( gl_ext_hbox ); + gtk_container_add( GTK_CONTAINER( frame ), gl_ext_hbox ); + gtk_container_set_border_width( GTK_CONTAINER( gl_ext_hbox ), 4 ); + + gl_ext_sc = gtk_scrolled_window_new( NULL, NULL ); + gtk_box_pack_start( GTK_BOX( gl_ext_hbox ), gl_ext_sc, TRUE, TRUE, 0 ); + gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( gl_ext_sc ), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS ); + gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW( gl_ext_sc ), GTK_SHADOW_IN ); + gtk_widget_show( gl_ext_sc ); + + gl_ext_text = gtk_text_view_new(); + gtk_text_view_set_editable( GTK_TEXT_VIEW( gl_ext_text ), FALSE ); + gtk_container_add( GTK_CONTAINER( gl_ext_sc ), gl_ext_text ); + GtkTextBuffer* buffer = gtk_text_view_get_buffer( GTK_TEXT_VIEW( gl_ext_text ) ); + gtk_text_buffer_set_text( buffer, (char *)qglGetString( GL_EXTENSIONS ), -1 ); + gtk_text_view_set_wrap_mode( GTK_TEXT_VIEW( gl_ext_text ), GTK_WRAP_WORD );; + gtk_widget_show( gl_ext_text ); - hbox = gtk_hbox_new( FALSE, 5 ); - gtk_widget_show( hbox ); - gtk_container_add( GTK_CONTAINER( frame ), hbox ); - gtk_container_set_border_width( GTK_CONTAINER( hbox ), 5 ); + // buttons + button_hbox = gtk_hbox_new( FALSE, 4 ); + gtk_widget_show( button_hbox ); + gtk_box_pack_start( GTK_BOX( main_vbox ), button_hbox, FALSE, TRUE, 0 ); - sc_extensions = gtk_scrolled_window_new( NULL, NULL ); - gtk_box_pack_start( GTK_BOX( hbox ), sc_extensions, TRUE, TRUE, 0 ); - gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( sc_extensions ), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS ); - gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW( sc_extensions ), GTK_SHADOW_IN ); - gtk_widget_show( sc_extensions ); + button = gtk_button_new_with_label( _( "OK" ) ); + gtk_widget_show( button ); + gtk_box_pack_end( GTK_BOX( button_hbox ), button, FALSE, FALSE, 0 ); + gtk_signal_connect( GTK_OBJECT( button ), "clicked", + GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); - text_extensions = gtk_text_view_new(); - gtk_text_view_set_editable( GTK_TEXT_VIEW( text_extensions ), FALSE ); - gtk_container_add( GTK_CONTAINER( sc_extensions ), text_extensions ); - GtkTextBuffer* buffer = gtk_text_view_get_buffer( GTK_TEXT_VIEW( text_extensions ) ); - gtk_text_buffer_set_text( buffer, (char *)qglGetString( GL_EXTENSIONS ), -1 ); - gtk_text_view_set_wrap_mode( GTK_TEXT_VIEW( text_extensions ), GTK_WRAP_WORD );; - gtk_widget_show( text_extensions ); + button = gtk_button_new_with_label( _( "Credits" ) ); + gtk_widget_show( button ); + gtk_box_pack_end( GTK_BOX( button_hbox ), button, FALSE, FALSE, 0 ); + gtk_signal_connect( GTK_OBJECT( button ), "clicked", + GTK_SIGNAL_FUNC( about_button_credits ), NULL ); + + button = gtk_button_new_with_label( _( "Changelog" ) ); + gtk_widget_show( button ); + gtk_box_pack_end( GTK_BOX( button_hbox ), button, FALSE, FALSE, 0 ); + gtk_signal_connect( GTK_OBJECT( button ), "clicked", + GTK_SIGNAL_FUNC( about_button_changelog ), NULL ); gtk_grab_add( dlg ); gtk_widget_show( dlg );