Commit 631c2fb2 authored by eric@webkit.org's avatar eric@webkit.org
Browse files

2010-06-04 Anders Bakken <agbakken@gmail.com>

        Reviewed by Eric Seidel.

        [Qt] ScrollbarThemeQt.cpp has coding-style errors
        https://bugs.webkit.org/show_bug.cgi?id=39764

        * platform/qt/ScrollbarThemeQt.cpp:
        (WebCore::scPart):
        (WebCore::scrollbarPart):
        (WebCore::styleOptionSlider):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@60737 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 10b9187d
2010-06-04 Anders Bakken <agbakken@gmail.com>
Reviewed by Eric Seidel.
[Qt] ScrollbarThemeQt.cpp has coding-style errors
https://bugs.webkit.org/show_bug.cgi?id=39764
* platform/qt/ScrollbarThemeQt.cpp:
(WebCore::scPart):
(WebCore::scrollbarPart):
(WebCore::styleOptionSlider):
2010-06-04 Anders Bakken <agbakken@gmail.com>
Reviewed by Eric Seidel.
......
......@@ -22,7 +22,7 @@
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
......@@ -31,15 +31,15 @@
#include "GraphicsContext.h"
#include "PlatformMouseEvent.h"
#include "RenderThemeQt.h"
#include "Scrollbar.h"
#include "ScrollView.h"
#include "Scrollbar.h"
#include <QApplication>
#include <QDebug>
#include <QMenu>
#include <QPainter>
#include <QStyle>
#include <QStyleOptionSlider>
#include <QMenu>
namespace WebCore {
......@@ -56,20 +56,20 @@ ScrollbarThemeQt::~ScrollbarThemeQt()
static QStyle::SubControl scPart(const ScrollbarPart& part)
{
switch (part) {
case NoPart:
return QStyle::SC_None;
case BackButtonStartPart:
case BackButtonEndPart:
return QStyle::SC_ScrollBarSubLine;
case BackTrackPart:
return QStyle::SC_ScrollBarSubPage;
case ThumbPart:
return QStyle::SC_ScrollBarSlider;
case ForwardTrackPart:
return QStyle::SC_ScrollBarAddPage;
case ForwardButtonStartPart:
case ForwardButtonEndPart:
return QStyle::SC_ScrollBarAddLine;
case NoPart:
return QStyle::SC_None;
case BackButtonStartPart:
case BackButtonEndPart:
return QStyle::SC_ScrollBarSubLine;
case BackTrackPart:
return QStyle::SC_ScrollBarSubPage;
case ThumbPart:
return QStyle::SC_ScrollBarSlider;
case ForwardTrackPart:
return QStyle::SC_ScrollBarAddPage;
case ForwardButtonStartPart:
case ForwardButtonEndPart:
return QStyle::SC_ScrollBarAddLine;
}
return QStyle::SC_None;
......@@ -78,18 +78,18 @@ static QStyle::SubControl scPart(const ScrollbarPart& part)
static ScrollbarPart scrollbarPart(const QStyle::SubControl& sc)
{
switch (sc) {
case QStyle::SC_None:
return NoPart;
case QStyle::SC_ScrollBarSubLine:
return BackButtonStartPart;
case QStyle::SC_ScrollBarSubPage:
return BackTrackPart;
case QStyle::SC_ScrollBarSlider:
return ThumbPart;
case QStyle::SC_ScrollBarAddPage:
return ForwardTrackPart;
case QStyle::SC_ScrollBarAddLine:
return ForwardButtonStartPart;
case QStyle::SC_None:
return NoPart;
case QStyle::SC_ScrollBarSubLine:
return BackButtonStartPart;
case QStyle::SC_ScrollBarSubPage:
return BackTrackPart;
case QStyle::SC_ScrollBarSlider:
return ThumbPart;
case QStyle::SC_ScrollBarAddPage:
return ForwardTrackPart;
case QStyle::SC_ScrollBarAddLine:
return ForwardButtonStartPart;
}
return NoPart;
}
......@@ -122,9 +122,9 @@ static QStyleOptionSlider* styleOptionSlider(Scrollbar* scrollbar, QWidget* widg
ScrollbarPart hoveredPart = scrollbar->hoveredPart();
if (pressedPart != NoPart) {
opt.activeSubControls = scPart(scrollbar->pressedPart());
if (pressedPart == BackButtonStartPart || pressedPart == ForwardButtonStartPart ||
pressedPart == BackButtonEndPart || pressedPart == ForwardButtonEndPart ||
pressedPart == ThumbPart)
if (pressedPart == BackButtonStartPart || pressedPart == ForwardButtonStartPart
|| pressedPart == BackButtonEndPart || pressedPart == ForwardButtonEndPart
|| pressedPart == ThumbPart)
opt.state |= QStyle::State_Sunken;
} else
opt.activeSubControls = scPart(hoveredPart);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment