| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/gtk/about_chrome_dialog.h" | 5 #include "chrome/browser/ui/gtk/about_chrome_dialog.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 // Build the dialog. | 108 // Build the dialog. |
| 109 GtkWidget* dialog = gtk_dialog_new_with_buttons( | 109 GtkWidget* dialog = gtk_dialog_new_with_buttons( |
| 110 l10n_util::GetStringUTF8(IDS_ABOUT_CHROME_TITLE).c_str(), | 110 l10n_util::GetStringUTF8(IDS_ABOUT_CHROME_TITLE).c_str(), |
| 111 parent, | 111 parent, |
| 112 GTK_DIALOG_MODAL, | 112 GTK_DIALOG_MODAL, |
| 113 NULL); | 113 NULL); |
| 114 // Pick up the style set in gtk_util.cc:InitRCStyles(). | 114 // Pick up the style set in gtk_util.cc:InitRCStyles(). |
| 115 // The layout of this dialog is special because the logo should be flush | 115 // The layout of this dialog is special because the logo should be flush |
| 116 // with the edges of the window. | 116 // with the edges of the window. |
| 117 gtk_widget_set_name(dialog, "about-dialog"); | 117 gtk_widget_set_name(dialog, "about-dialog"); |
| 118 #if !GTK_CHECK_VERSION(2, 22, 0) |
| 118 gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE); | 119 gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE); |
| 120 #endif |
| 119 | 121 |
| 120 GtkWidget* close_button = gtk_dialog_add_button(GTK_DIALOG(dialog), | 122 GtkWidget* close_button = gtk_dialog_add_button(GTK_DIALOG(dialog), |
| 121 GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE); | 123 GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE); |
| 122 | 124 |
| 123 GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog)); | 125 GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog)); |
| 124 | 126 |
| 125 // Use an event box to get the background painting correctly | 127 // Use an event box to get the background painting correctly |
| 126 GtkWidget* ebox = gtk_event_box_new(); | 128 GtkWidget* ebox = gtk_event_box_new(); |
| 127 gtk_widget_set_app_paintable(ebox, TRUE); | 129 gtk_widget_set_app_paintable(ebox, TRUE); |
| 128 g_signal_connect(ebox, "expose-event", G_CALLBACK(OnEventBoxExpose), NULL); | 130 g_signal_connect(ebox, "expose-event", G_CALLBACK(OnEventBoxExpose), NULL); |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 ui::kContentAreaBorder, 0, | 274 ui::kContentAreaBorder, 0, |
| 273 ui::kContentAreaBorder, ui::kContentAreaBorder); | 275 ui::kContentAreaBorder, ui::kContentAreaBorder); |
| 274 gtk_container_add(GTK_CONTAINER(alignment), vbox); | 276 gtk_container_add(GTK_CONTAINER(alignment), vbox); |
| 275 gtk_box_pack_start(GTK_BOX(content_area), alignment, FALSE, FALSE, 0); | 277 gtk_box_pack_start(GTK_BOX(content_area), alignment, FALSE, FALSE, 0); |
| 276 | 278 |
| 277 g_signal_connect(dialog, "response", G_CALLBACK(OnResponse), NULL); | 279 g_signal_connect(dialog, "response", G_CALLBACK(OnResponse), NULL); |
| 278 gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); | 280 gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); |
| 279 gtk_widget_show_all(dialog); | 281 gtk_widget_show_all(dialog); |
| 280 gtk_widget_grab_focus(close_button); | 282 gtk_widget_grab_focus(close_button); |
| 281 } | 283 } |
| OLD | NEW |