Kaydet (Commit) 7ab2350d authored tarafından Jan-Marek Glogowski's avatar Jan-Marek Glogowski

KDE4 use correct ComboBox frame pixel metric

Change-Id: I03fa5489ffc5cd5bb386bb321519c61058db4fda
üst b82f4373
...@@ -142,16 +142,18 @@ namespace ...@@ -142,16 +142,18 @@ namespace
QApplication::style()->drawComplexControl(element, option, &painter); QApplication::style()->drawComplexControl(element, option, &painter);
} }
void lcl_drawFrame(QStyle::PrimitiveElement element, QImage* image, QStyle::State const & state) void lcl_drawFrame( QStyle::PrimitiveElement element, QImage* image, QStyle::State const & state,
QStyle::PixelMetric eLineMetric = QStyle::PM_DefaultFrameWidth )
{ {
#if ( QT_VERSION >= QT_VERSION_CHECK( 4, 5, 0 ) ) #if ( QT_VERSION >= QT_VERSION_CHECK( 4, 5, 0 ) )
QStyleOptionFrameV3 option; QStyleOptionFrameV3 option;
option.frameShape = QFrame::StyledPanel; option.frameShape = QFrame::StyledPanel;
option.state = QStyle::State_Sunken; option.state = QStyle::State_Sunken;
option.lineWidth = QApplication::style()->pixelMetric( eLineMetric );
#else #else
QStyleOptionFrame option; QStyleOptionFrame option;
QFrame aFrame( NULL ); QFrame aFrame( nullptr );
aFrame.setFrameRect( QRect(0, 0, image->width(), image->height()) ); aFrame.setFrameRect( QRect(0, 0, image->width(), image->height()) );
aFrame.setFrameStyle( QFrame::StyledPanel | QFrame::Sunken ); aFrame.setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );
aFrame.ensurePolished(); aFrame.ensurePolished();
...@@ -160,7 +162,6 @@ namespace ...@@ -160,7 +162,6 @@ namespace
option.lineWidth = aFrame.lineWidth(); option.lineWidth = aFrame.lineWidth();
option.midLineWidth = aFrame.midLineWidth(); option.midLineWidth = aFrame.midLineWidth();
#endif #endif
draw(element, &option, image, state); draw(element, &option, image, state);
} }
} }
...@@ -422,10 +423,12 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, ...@@ -422,10 +423,12 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
else if (type == ControlType::Listbox) else if (type == ControlType::Listbox)
{ {
QStyleOptionComboBox option; QStyleOptionComboBox option;
option.editable = false;
switch (part) { switch (part) {
case ControlPart::ListboxWindow: case ControlPart::ListboxWindow:
lcl_drawFrame( QStyle::PE_Frame, m_image.get(), lcl_drawFrame( QStyle::PE_Frame, m_image.get(),
vclStateValue2StateFlag(nControlState, value) ); vclStateValue2StateFlag(nControlState, value),
QStyle::PM_ComboBoxFrameWidth );
break; break;
case ControlPart::SubEdit: case ControlPart::SubEdit:
draw( QStyle::CE_ComboBoxLabel, &option, m_image.get(), draw( QStyle::CE_ComboBoxLabel, &option, m_image.get(),
...@@ -773,9 +776,6 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part, ...@@ -773,9 +776,6 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
retVal = true; retVal = true;
break; break;
} }
case ControlPart::ListboxWindow:
retVal = true;
break;
default: default:
break; break;
} }
......
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