OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/libgtkui/gtk_ui.h" | 5 #include "chrome/browser/ui/libgtkui/gtk_ui.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 #include <pango/pango.h> | 8 #include <pango/pango.h> |
9 #include <X11/Xcursor/Xcursor.h> | 9 #include <X11/Xcursor/Xcursor.h> |
10 | 10 |
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 focus_ring_color_ = frame_color; | 858 focus_ring_color_ = frame_color; |
859 | 859 |
860 SetScrollbarColors(); | 860 SetScrollbarColors(); |
861 | 861 |
862 // Some GTK themes only define the text selection colors on the GtkEntry | 862 // Some GTK themes only define the text selection colors on the GtkEntry |
863 // class, so we need to use that for getting selection colors. | 863 // class, so we need to use that for getting selection colors. |
864 active_selection_bg_color_ = native_theme_->GetSystemColor( | 864 active_selection_bg_color_ = native_theme_->GetSystemColor( |
865 ui::NativeTheme::kColorId_TextfieldSelectionBackgroundFocused); | 865 ui::NativeTheme::kColorId_TextfieldSelectionBackgroundFocused); |
866 active_selection_fg_color_ = native_theme_->GetSystemColor( | 866 active_selection_fg_color_ = native_theme_->GetSystemColor( |
867 ui::NativeTheme::kColorId_TextfieldSelectionColor); | 867 ui::NativeTheme::kColorId_TextfieldSelectionColor); |
| 868 #if GTK_MAJOR_VERSION == 2 |
868 inactive_selection_bg_color_ = native_theme_->GetSystemColor( | 869 inactive_selection_bg_color_ = native_theme_->GetSystemColor( |
869 ui::NativeTheme::kColorId_TextfieldReadOnlyBackground); | 870 ui::NativeTheme::kColorId_TextfieldReadOnlyBackground); |
870 inactive_selection_fg_color_ = native_theme_->GetSystemColor( | 871 inactive_selection_fg_color_ = native_theme_->GetSystemColor( |
871 ui::NativeTheme::kColorId_TextfieldReadOnlyColor); | 872 ui::NativeTheme::kColorId_TextfieldReadOnlyColor); |
| 873 #else |
| 874 inactive_selection_bg_color_ = |
| 875 GetBgColor("GtkEntry#entry:backdrop #selection:selected"); |
| 876 inactive_selection_fg_color_ = |
| 877 GetFgColor("GtkEntry#entry:backdrop #selection:selected"); |
| 878 #endif |
872 | 879 |
873 colors_[ThemeProperties::COLOR_TAB_THROBBER_SPINNING] = | 880 colors_[ThemeProperties::COLOR_TAB_THROBBER_SPINNING] = |
874 native_theme_->GetSystemColor( | 881 native_theme_->GetSystemColor( |
875 ui::NativeTheme::kColorId_ThrobberSpinningColor); | 882 ui::NativeTheme::kColorId_ThrobberSpinningColor); |
876 colors_[ThemeProperties::COLOR_TAB_THROBBER_WAITING] = | 883 colors_[ThemeProperties::COLOR_TAB_THROBBER_WAITING] = |
877 native_theme_->GetSystemColor( | 884 native_theme_->GetSystemColor( |
878 ui::NativeTheme::kColorId_ThrobberWaitingColor); | 885 ui::NativeTheme::kColorId_ThrobberWaitingColor); |
879 | 886 |
880 #if GTK_MAJOR_VERSION > 2 | 887 #if GTK_MAJOR_VERSION > 2 |
881 colors_[ThemeProperties::COLOR_TOOLBAR_BOTTOM_SEPARATOR] = | 888 colors_[ThemeProperties::COLOR_TOOLBAR_BOTTOM_SEPARATOR] = |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1046 | 1053 |
1047 float GtkUi::GetDeviceScaleFactor() const { | 1054 float GtkUi::GetDeviceScaleFactor() const { |
1048 return device_scale_factor_; | 1055 return device_scale_factor_; |
1049 } | 1056 } |
1050 | 1057 |
1051 } // namespace libgtkui | 1058 } // namespace libgtkui |
1052 | 1059 |
1053 views::LinuxUI* BuildGtkUi() { | 1060 views::LinuxUI* BuildGtkUi() { |
1054 return new libgtkui::GtkUi; | 1061 return new libgtkui::GtkUi; |
1055 } | 1062 } |
OLD | NEW |