Skip to content

Commit 0178a53

Browse files
committed
RenderTheme cleanup
1 parent 2dca0ea commit 0178a53

File tree

6 files changed

+8
-63
lines changed

6 files changed

+8
-63
lines changed

Source/WebCore/platform/qt/RenderThemeQStyle.cpp

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -454,15 +454,9 @@ void RenderThemeQStyle::paintMenuListButtonDecorations(const RenderBox& o, const
454454
p.paintComboBoxArrow();
455455
}
456456

457-
Seconds RenderThemeQStyle::animationDurationForProgressBar(const RenderProgress& renderProgress) const
457+
Seconds RenderThemeQStyle::animationDurationForProgressBar() const
458458
{
459-
if (renderProgress.position() >= 0)
460-
return 0_s;
461-
462-
IntSize size = roundedIntSize(renderProgress.size());
463-
// FIXME: Until http://bugreports.qt.nokia.com/browse/QTBUG-9171 is fixed,
464-
// we simulate one square animating across the progress bar.
465-
return animationRepeatIntervalForProgressBar(renderProgress) * (size.width() / m_qStyle->progressBarChunkWidth(size));
459+
return Seconds(2.475);
466460
}
467461

468462
bool RenderThemeQStyle::paintProgressBar(const RenderObject& o, const PaintInfo& pi, const IntRect& r)
@@ -583,20 +577,6 @@ bool RenderThemeQStyle::paintSearchFieldResultsDecorationPart(const RenderBox& o
583577
return RenderTheme::paintSearchFieldResultsDecorationPart(o, pi, r);
584578
}
585579

586-
#ifndef QT_NO_SPINBOX
587-
588-
bool RenderThemeQStyle::paintInnerSpinButton(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& rect)
589-
{
590-
StylePainterQStyle p(this, paintInfo, o);
591-
if (!p.isValid())
592-
return true;
593-
594-
p.styleOption.rect = rect;
595-
p.paintInnerSpinButton(isSpinUpButtonPartPressed(o));
596-
return false;
597-
}
598-
#endif
599-
600580
StyleAppearance RenderThemeQStyle::initializeCommonQStyleOptions(QStyleFacadeOption &option, const RenderObject& o) const
601581
{
602582
// Default bits: no focus, no mouse over, enabled

Source/WebCore/platform/qt/RenderThemeQStyle.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class RenderThemeQStyle final : public RenderThemeQt {
6666
void adjustMenuListButtonStyle(RenderStyle&, const Element*) const final;
6767

6868
// Returns the duration of the animation for the progress bar.
69-
Seconds animationDurationForProgressBar(const RenderProgress&) const final;
69+
Seconds animationDurationForProgressBar() const final;
7070
bool paintProgressBar(const RenderObject&, const PaintInfo&, const IntRect&) final;
7171

7272
bool paintSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&) final;
@@ -83,10 +83,6 @@ class RenderThemeQStyle final : public RenderThemeQt {
8383
void adjustSearchFieldResultsDecorationPartStyle(RenderStyle&, const Element*) const final;
8484
bool paintSearchFieldResultsDecorationPart(const RenderBox&, const PaintInfo&, const IntRect&) final;
8585

86-
#ifndef QT_NO_SPINBOX
87-
bool paintInnerSpinButton(const RenderObject&, const PaintInfo&, const IntRect&) final;
88-
#endif
89-
9086
protected:
9187
void computeSizeBasedOnStyle(RenderStyle&) const final;
9288

Source/WebCore/platform/qt/RenderThemeQt.cpp

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -274,21 +274,11 @@ int RenderThemeQt::minimumMenuListSize(const RenderStyle&) const
274274
return fm.width(QLatin1Char('x'));
275275
}
276276

277-
void RenderThemeQt::setCheckboxSize(RenderStyle& style) const
278-
{
279-
computeSizeBasedOnStyle(style);
280-
}
281-
282277
bool RenderThemeQt::paintCheckbox(const RenderObject& o, const PaintInfo& i, const FloatRect& r)
283278
{
284279
return paintButton(o, i, IntRect(r));
285280
}
286281

287-
void RenderThemeQt::setRadioSize(RenderStyle& style) const
288-
{
289-
computeSizeBasedOnStyle(style);
290-
}
291-
292282
bool RenderThemeQt::paintRadio(const RenderObject& o, const PaintInfo& i, const FloatRect& r)
293283
{
294284
return paintButton(o, i, IntRect(r));
@@ -493,16 +483,6 @@ bool RenderThemeQt::paintSearchFieldResultsDecorationPart(const RenderBox& o, co
493483
return RenderTheme::paintSearchFieldResultsDecorationPart(o, pi, r);
494484
}
495485

496-
#ifndef QT_NO_SPINBOX
497-
void RenderThemeQt::adjustInnerSpinButtonStyle(RenderStyle& style, const Element*) const
498-
{
499-
// Use the same width as our native scrollbar
500-
int width = ScrollbarTheme::theme().scrollbarThickness();
501-
style.setWidth(Length(width, LengthType::Fixed));
502-
style.setMinWidth(Length(width, LengthType::Fixed));
503-
}
504-
#endif
505-
506486
bool RenderThemeQt::supportsFocus(StyleAppearance appearance) const
507487
{
508488
switch (appearance) {

Source/WebCore/platform/qt/RenderThemeQt.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,7 @@ class RenderThemeQt : public RenderTheme {
103103

104104
protected:
105105
bool paintCheckbox(const RenderObject&, const PaintInfo&, const FloatRect&) override;
106-
void setCheckboxSize(RenderStyle&) const override;
107-
108106
bool paintRadio(const RenderObject&, const PaintInfo&, const FloatRect&) override;
109-
void setRadioSize(RenderStyle&) const override;
110107

111108
void adjustTextFieldStyle(RenderStyle&, const Element*) const override;
112109

@@ -137,10 +134,6 @@ class RenderThemeQt : public RenderTheme {
137134
void adjustSearchFieldResultsDecorationPartStyle(RenderStyle&, const Element*) const override;
138135
bool paintSearchFieldResultsDecorationPart(const RenderBox&, const PaintInfo&, const IntRect&) override;
139136

140-
#ifndef QT_NO_SPINBOX
141-
void adjustInnerSpinButtonStyle(RenderStyle&, const Element*) const override;
142-
#endif
143-
144137
String m_mediaControlsStyleSheet;
145138

146139
#if 0 //ENABLE(VIDEO)

Source/WebCore/platform/qt/RenderThemeQtMobile.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ bool RenderThemeQtMobile::isControlStyled(const RenderStyle& style, const Render
659659
}
660660
}
661661

662-
LengthBox RenderThemeQtMobile::popupInternalPaddingBox(const RenderStyle&, const Settings&) const
662+
LengthBox RenderThemeQtMobile::popupInternalPaddingBox(const RenderStyle&) const
663663
{
664664
return { 0, 0, 1, 0 };
665665
}
@@ -852,13 +852,9 @@ bool RenderThemeQtMobile::paintMenuListButton(RenderObject& o, const PaintInfo&
852852
return false;
853853
}
854854

855-
Seconds RenderThemeQtMobile::animationDurationForProgressBar(const RenderProgress& renderProgress) const
855+
Seconds RenderThemeQtMobile::animationDurationForProgressBar() const
856856
{
857-
if (renderProgress.isDeterminate())
858-
return 0_s;
859-
// Our animation goes back and forth so we need to make it last twice as long
860-
// and we need the numerator to be an odd number to ensure we get a progress value of 0.5.
861-
return animationRepeatIntervalForProgressBar(renderProgress) * (progressAnimationGranularity * 2 + 1) / progressBarChunkPercentage;
857+
return Seconds(2.475);
862858
}
863859

864860
bool RenderThemeQtMobile::paintProgressBar(const RenderObject& o, const PaintInfo& pi, const IntRect& r)

Source/WebCore/platform/qt/RenderThemeQtMobile.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class RenderThemeQtMobile final : public RenderThemeQt {
4848

4949
bool isControlStyled(const RenderStyle&, const RenderStyle&) const final;
5050

51-
LengthBox popupInternalPaddingBox(const RenderStyle&, const Settings&) const final;
51+
LengthBox popupInternalPaddingBox(const RenderStyle&) const final;
5252

5353
bool delegatesMenuListRendering() const final { return true; }
5454

@@ -71,7 +71,7 @@ class RenderThemeQtMobile final : public RenderThemeQt {
7171
virtual bool paintMenuListButton(RenderObject&, const PaintInfo&, const IntRect&);
7272

7373
// Returns the duration of the animation for the progress bar.
74-
Seconds animationDurationForProgressBar(const RenderProgress&) const final;
74+
Seconds animationDurationForProgressBar() const final;
7575
bool paintProgressBar(const RenderObject&, const PaintInfo&, const IntRect&) final;
7676

7777
bool paintSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&) final;

0 commit comments

Comments
 (0)