From f1c77daea3ac41e46ef159aae6d655e5df98e879 Mon Sep 17 00:00:00 2001 From: "pevanhoj@pevanhoj-laptop" Date: Tue, 22 Apr 2008 12:33:33 +0300 Subject: [PATCH] Fix for dropdown focus drawing --- widget/src/qt/nsNativeThemeQt.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/widget/src/qt/nsNativeThemeQt.cpp b/widget/src/qt/nsNativeThemeQt.cpp index 445b71e489f8..7cf44490c7ec 100644 --- a/widget/src/qt/nsNativeThemeQt.cpp +++ b/widget/src/qt/nsNativeThemeQt.cpp @@ -338,6 +338,7 @@ nsNativeThemeQt::GetWidgetPadding(nsIDeviceContext* , aResult->SizeTo(2, 2, 2, 2); return PR_TRUE; } + return PR_FALSE; } @@ -396,13 +397,18 @@ nsNativeThemeQt::GetMinimumWidgetSize(nsIRenderingContext* aContext, nsIFrame* a break; } case NS_THEME_SCROLLBAR_BUTTON_UP: - case NS_THEME_SCROLLBAR_BUTTON_DOWN: - case NS_THEME_SCROLLBAR_BUTTON_LEFT: - case NS_THEME_SCROLLBAR_BUTTON_RIGHT: { + case NS_THEME_SCROLLBAR_BUTTON_DOWN: { (*aResult).width = s->pixelMetric(QStyle::PM_ScrollBarExtent); (*aResult).height = (*aResult).width; //*aIsOverridable = PR_FALSE; break; + } + case NS_THEME_SCROLLBAR_BUTTON_LEFT: + case NS_THEME_SCROLLBAR_BUTTON_RIGHT: { + (*aResult).height = s->pixelMetric(QStyle::PM_ScrollBarExtent); + (*aResult).width = (*aResult).height; + //*aIsOverridable = PR_FALSE; + break; } case NS_THEME_SCROLLBAR_THUMB_VERTICAL: { (*aResult).width = s->pixelMetric(QStyle::PM_ScrollBarExtent); @@ -462,7 +468,6 @@ nsNativeThemeQt::GetMinimumWidgetSize(nsIRenderingContext* aContext, nsIFrame* a break; } case NS_THEME_DROPDOWN_TEXT: { - qDebug("---"); QStyleOptionComboBox comboOpt; nsRect frameRect = aFrame->GetRect(); @@ -653,8 +658,7 @@ void nsNativeThemeQt::InitComboStyle(PRUint8 aWidgetType, nsIFrame* aFrame, QRect rect, - QStyleOptionComboBox &opt, - QStyle::State extraFlags /*= QStyle::State_None*/) + QStyleOptionComboBox &opt) { PRInt32 eventState = GetContentState(aFrame, aWidgetType); @@ -670,10 +674,8 @@ nsNativeThemeQt::InitComboStyle(PRUint8 aWidgetType, opt.state |= QStyle::State_Raised; if (!disabled && eventState & NS_EVENT_STATE_ACTIVE) // Don't allow sunken when disabled - opt.state |= QStyle::State_On; + opt.state |= QStyle::State_Sunken; opt.rect = rect; opt.palette = mNoBackgroundPalette; - - opt.state |= extraFlags; }