OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/gtk_util.h" | 5 #include "app/gtk_util.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "base/env_var.h" | 10 #include "base/env_var.h" |
11 #include "base/linux_util.h" | |
12 #include "base/logging.h" | 11 #include "base/logging.h" |
13 #include "base/string_util.h" | 12 #include "base/string_util.h" |
| 13 #include "base/xdg_util.h" |
14 | 14 |
15 namespace gtk_util { | 15 namespace gtk_util { |
16 | 16 |
17 void GetWidgetSizeFromResources( | 17 void GetWidgetSizeFromResources( |
18 GtkWidget* widget, int width_chars, int height_lines, | 18 GtkWidget* widget, int width_chars, int height_lines, |
19 int* width, int* height) { | 19 int* width, int* height) { |
20 DCHECK(GTK_WIDGET_REALIZED(widget)) | 20 DCHECK(GTK_WIDGET_REALIZED(widget)) |
21 << " widget must be realized to compute font metrics correctly"; | 21 << " widget must be realized to compute font metrics correctly"; |
22 | 22 |
23 double chars = 0; | 23 double chars = 0; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 void ApplyMessageDialogQuirks(GtkWidget* dialog) { | 57 void ApplyMessageDialogQuirks(GtkWidget* dialog) { |
58 if (gtk_window_get_modal(GTK_WINDOW(dialog))) { | 58 if (gtk_window_get_modal(GTK_WINDOW(dialog))) { |
59 // Work around a KDE 3 window manager bug. | 59 // Work around a KDE 3 window manager bug. |
60 scoped_ptr<base::EnvVarGetter> env(base::EnvVarGetter::Create()); | 60 scoped_ptr<base::EnvVarGetter> env(base::EnvVarGetter::Create()); |
61 if (base::DESKTOP_ENVIRONMENT_KDE3 == GetDesktopEnvironment(env.get())) | 61 if (base::DESKTOP_ENVIRONMENT_KDE3 == GetDesktopEnvironment(env.get())) |
62 gtk_window_set_skip_taskbar_hint(GTK_WINDOW(dialog), FALSE); | 62 gtk_window_set_skip_taskbar_hint(GTK_WINDOW(dialog), FALSE); |
63 } | 63 } |
64 } | 64 } |
65 | 65 |
66 } // namespace gtk_util | 66 } // namespace gtk_util |
OLD | NEW |