diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-05 14:34:32 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-05 14:34:32 -0800 |
commit | 635860845790a19bf50bbc51ba8fb66a96dde068 (patch) | |
tree | ef6ad9ff73a5b57f65249d4232a202fa77e6a140 /WebCore/platform/qt/RenderThemeQt.cpp | |
parent | 8e35f3cfc7fba1d1c829dc557ebad6409cbe16a2 (diff) | |
download | external_webkit-635860845790a19bf50bbc51ba8fb66a96dde068.zip external_webkit-635860845790a19bf50bbc51ba8fb66a96dde068.tar.gz external_webkit-635860845790a19bf50bbc51ba8fb66a96dde068.tar.bz2 |
auto import from //depot/cupcake/@136594
Diffstat (limited to 'WebCore/platform/qt/RenderThemeQt.cpp')
-rw-r--r-- | WebCore/platform/qt/RenderThemeQt.cpp | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/WebCore/platform/qt/RenderThemeQt.cpp b/WebCore/platform/qt/RenderThemeQt.cpp index 2a33e45..eee8c86 100644 --- a/WebCore/platform/qt/RenderThemeQt.cpp +++ b/WebCore/platform/qt/RenderThemeQt.cpp @@ -6,6 +6,7 @@ * Copyright (C) 2006 Zack Rusin <zack@kde.org> * 2006 Dirk Mueller <mueller@kde.org> * 2006 Nikolas Zimmermann <zimmermann@kde.org> + * Copyright (C) 2008 Holger Hans Peter Freyther * * All rights reserved. * @@ -45,7 +46,9 @@ #include <QStyleOptionFrameV2> #include "Color.h" +#include "CSSStyleSelector.h" #include "CSSStyleSheet.h" +#include "FontSelector.h" #include "Document.h" #include "Page.h" #include "Font.h" @@ -53,6 +56,7 @@ #include "GraphicsContext.h" #include "HTMLMediaElement.h" #include "HTMLNames.h" +#include "RenderBox.h" namespace WebCore { @@ -151,9 +155,12 @@ bool RenderThemeQt::supportsFocusRing(const RenderStyle* style) const int RenderThemeQt::baselinePosition(const RenderObject* o) const { + if (!o->isBox()) + return 0; + if (o->style()->appearance() == CheckboxPart || o->style()->appearance() == RadioPart) - return o->marginTop() + o->height() - 2; // Same as in old khtml + return toRenderBox(o)->marginTop() + toRenderBox(o)->height() - 2; // Same as in old khtml return RenderTheme::baselinePosition(o); } @@ -398,6 +405,7 @@ void RenderThemeQt::adjustButtonStyle(CSSStyleSelector* selector, RenderStyle* s fontFamily.setFamily(m_buttonFontFamily); fontDescription.setFamily(fontFamily); style->setFontDescription(fontDescription); + style->font().update(selector->fontSelector()); style->setLineHeight(RenderStyle::initialLineHeight()); setButtonSize(style); @@ -567,8 +575,6 @@ bool RenderThemeQt::paintMenuList(RenderObject* o, const RenderObject::PaintInfo opt.rect.moveTo(QPoint(0,0)); opt.rect.setSize(r.size()); - opt.frame = false; - p.drawComplexControl(QStyle::CC_ComboBox, opt); p.painter->translate(-topLeft); return false; @@ -715,8 +721,10 @@ ControlPart RenderThemeQt::applyTheme(QStyleOption& option, RenderObject* o) con // Readonly is supported on textfields. option.state |= QStyle::State_ReadOnly; - if (supportsFocus(o->style()->appearance()) && isFocused(o)) + if (supportsFocus(o->style()->appearance()) && isFocused(o)) { option.state |= QStyle::State_HasFocus; + option.state |= QStyle::State_KeyboardFocusChange; + } if (isHovered(o)) option.state |= QStyle::State_MouseOver; @@ -754,16 +762,18 @@ ControlPart RenderThemeQt::applyTheme(QStyleOption& option, RenderObject* o) con return result; } -void RenderTheme::adjustDefaultStyleSheet(CSSStyleSheet* style) +#if ENABLE(VIDEO) + +String RenderThemeQt::extraMediaControlsStyleSheet() { - QFile platformStyleSheet(":/webcore/resources/html4-adjustments-qt.css"); + QFile platformStyleSheet(QLatin1String(":/webcore/css/mediaControls-extras.css")); if (platformStyleSheet.open(QFile::ReadOnly)) { QByteArray sheetData = platformStyleSheet.readAll(); - style->parseString(QString::fromUtf8(sheetData.constData(), sheetData.length())); + return QString::fromUtf8(sheetData.constData(), sheetData.length()); } -} -#if ENABLE(VIDEO) + return String(); +} // Helper class to transform the painter's world matrix to the object's content area, scaled to 0,0,100,100 class WorldMatrixTransformer @@ -942,6 +952,11 @@ void RenderThemeQt::adjustSliderThumbSize(RenderObject* o) const } } +double RenderThemeQt::caretBlinkInterval() const +{ + return QApplication::cursorFlashTime() / 1000.0 / 2.0; +} + } // vim: ts=4 sw=4 et |