| 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/libgtk2ui/gtk2_ui.h" | 5 #include "chrome/browser/ui/libgtk2ui/gtk2_ui.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <pango/pango.h> | 8 #include <pango/pango.h> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 897 UpdateDefaultFont(); | 897 UpdateDefaultFont(); |
| 898 | 898 |
| 899 // Build the various icon tints. | 899 // Build the various icon tints. |
| 900 GetNormalButtonTintHSL(&button_tint_); | 900 GetNormalButtonTintHSL(&button_tint_); |
| 901 GetNormalEntryForegroundHSL(&entry_tint_); | 901 GetNormalEntryForegroundHSL(&entry_tint_); |
| 902 GetSelectedEntryForegroundHSL(&selected_entry_tint_); | 902 GetSelectedEntryForegroundHSL(&selected_entry_tint_); |
| 903 SkColor frame_color = BuildFrameColors(); | 903 SkColor frame_color = BuildFrameColors(); |
| 904 | 904 |
| 905 if (ui::MaterialDesignController::IsModeMaterial()) { | 905 if (ui::MaterialDesignController::IsModeMaterial()) { |
| 906 colors_[ThemeProperties::COLOR_BACKGROUND_TAB_TEXT] = | 906 colors_[ThemeProperties::COLOR_BACKGROUND_TAB_TEXT] = |
| 907 color_utils::BlendTowardOppositeLuminance(label_color, 50); | 907 color_utils::BlendTowardOppositeLuma(label_color, 50); |
| 908 } else { | 908 } else { |
| 909 // The inactive frame color never occurs naturally in the theme, as it is a | 909 // The inactive frame color never occurs naturally in the theme, as it is a |
| 910 // tinted version of |frame_color|. We generate another color based on the | 910 // tinted version of |frame_color|. We generate another color based on the |
| 911 // background tab color, with the lightness and saturation moved in the | 911 // background tab color, with the lightness and saturation moved in the |
| 912 // opposite direction. (We don't touch the hue, since there should be subtle | 912 // opposite direction. (We don't touch the hue, since there should be subtle |
| 913 // hints of the color in the text.) | 913 // hints of the color in the text.) |
| 914 color_utils::HSL inactive_tab_text_hsl; | 914 color_utils::HSL inactive_tab_text_hsl; |
| 915 color_utils::SkColorToHSL( | 915 color_utils::SkColorToHSL( |
| 916 theme->GetSystemColor(ui::NativeTheme::kColorId_WindowBackground), | 916 theme->GetSystemColor(ui::NativeTheme::kColorId_WindowBackground), |
| 917 &inactive_tab_text_hsl); | 917 &inactive_tab_text_hsl); |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1379 // Blacklist scaling factors <130% (crbug.com/484400) and round | 1379 // Blacklist scaling factors <130% (crbug.com/484400) and round |
| 1380 // to 1 decimal to prevent rendering problems (crbug.com/485183). | 1380 // to 1 decimal to prevent rendering problems (crbug.com/485183). |
| 1381 return scale < 1.3f ? 1.0f : roundf(scale * 10) / 10; | 1381 return scale < 1.3f ? 1.0f : roundf(scale * 10) / 10; |
| 1382 } | 1382 } |
| 1383 | 1383 |
| 1384 } // namespace libgtk2ui | 1384 } // namespace libgtk2ui |
| 1385 | 1385 |
| 1386 views::LinuxUI* BuildGtk2UI() { | 1386 views::LinuxUI* BuildGtk2UI() { |
| 1387 return new libgtk2ui::Gtk2UI; | 1387 return new libgtk2ui::Gtk2UI; |
| 1388 } | 1388 } |
| OLD | NEW |