Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Side by Side Diff: chrome/browser/ui/libgtkui/gtk_ui.cc

Issue 2505833002: Allow 1.2 scale factor on linux (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after
1047 void Gtk2UI::ResetStyle() { 1047 void Gtk2UI::ResetStyle() {
1048 LoadGtkValues(); 1048 LoadGtkValues();
1049 NativeThemeGtk2::instance()->NotifyObservers(); 1049 NativeThemeGtk2::instance()->NotifyObservers();
1050 } 1050 }
1051 1051
1052 void Gtk2UI::UpdateDeviceScaleFactor() { 1052 void Gtk2UI::UpdateDeviceScaleFactor() {
1053 // Note: Linux chrome currently does not support dynamic DPI 1053 // Note: Linux chrome currently does not support dynamic DPI
1054 // changes. This is to allow flags to override the DPI settings 1054 // changes. This is to allow flags to override the DPI settings
1055 // during startup. 1055 // during startup.
1056 float scale = GetRawDeviceScaleFactor(); 1056 float scale = GetRawDeviceScaleFactor();
1057 1057 // Blacklist scaling factors <120% (crbug.com/484400) and round
1058 // Blacklist scaling factors <130% (crbug.com/484400) and round
1059 // to 1 decimal to prevent rendering problems (crbug.com/485183). 1058 // to 1 decimal to prevent rendering problems (crbug.com/485183).
1060 device_scale_factor_ = scale < 1.3f ? 1.0f : roundf(scale * 10) / 10; 1059 device_scale_factor_ = scale < 1.2f ? 1.0f : roundf(scale * 10) / 10;
1061 UpdateDefaultFont(); 1060 UpdateDefaultFont();
1062 } 1061 }
1063 1062
1064 float Gtk2UI::GetDeviceScaleFactor() const { 1063 float Gtk2UI::GetDeviceScaleFactor() const {
1065 return device_scale_factor_; 1064 return device_scale_factor_;
1066 } 1065 }
1067 1066
1068 } // namespace libgtkui 1067 } // namespace libgtkui
1069 1068
1070 views::LinuxUI* BuildGtk2UI() { 1069 views::LinuxUI* BuildGtk2UI() {
1071 return new libgtkui::Gtk2UI; 1070 return new libgtkui::Gtk2UI;
1072 } 1071 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698