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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutThemeMac.mm

Issue 2305133002: Mac: adjust sizes of progress bars to be equal to painted size. (Closed)
Patch Set: none Created 4 years, 3 months 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/LayoutThemeMac.mm
diff --git a/third_party/WebKit/Source/core/layout/LayoutThemeMac.mm b/third_party/WebKit/Source/core/layout/LayoutThemeMac.mm
index fbb224577b5dddf6bdd48c32592d99ae2509784b..32de0eeb4bc5980273748a9d5509a67b32efa77c 100644
--- a/third_party/WebKit/Source/core/layout/LayoutThemeMac.mm
+++ b/third_party/WebKit/Source/core/layout/LayoutThemeMac.mm
@@ -684,28 +684,12 @@ const int* LayoutThemeMac::popupButtonPadding(NSControlSize size) const
return padding[size];
}
-const IntSize* LayoutThemeMac::progressBarSizes() const
+const int* LayoutThemeMac::progressBarHeights() const
{
- static const IntSize sizes[3] = { IntSize(0, 20), IntSize(0, 12), IntSize(0, 12) };
+ static const int sizes[3] = { 20, 12, 12 };
return sizes;
}
-const int* LayoutThemeMac::progressBarMargins(NSControlSize controlSize) const
-{
- static const int margins[3][4] =
- {
- { 0, 0, 1, 0 },
- { 0, 0, 1, 0 },
- { 0, 0, 1, 0 },
- };
- return margins[controlSize];
-}
-
-int LayoutThemeMac::minimumProgressBarHeight(const ComputedStyle& style) const
-{
- return sizeForSystemFont(style, progressBarSizes()).height();
-}
-
double LayoutThemeMac::animationRepeatIntervalForProgressBar() const
{
return progressAnimationFrameRate;
@@ -925,6 +909,16 @@ int LayoutThemeMac::sliderTickOffsetFromTrackCenter() const
return -9;
}
+void LayoutThemeMac::adjustProgressBarBounds(ComputedStyle& style) const
+{
+ float zoomLevel = style.effectiveZoom();
+ NSControlSize controlSize = controlSizeForFont(style);
+ int height = progressBarHeights()[controlSize] * zoomLevel;
+
+ // Now inflate it to account for the shadow.
+ style.setMinHeight(Length(height + zoomLevel, Fixed));
+}
+
void LayoutThemeMac::adjustSliderThumbSize(ComputedStyle& style) const
{
float zoomLevel = style.effectiveZoom();
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutThemeMac.h ('k') | third_party/WebKit/Source/core/paint/ThemePainterMac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698