minor fixes, workarounds
This commit is contained in:
parent
406e6ad08e
commit
70aa95dee6
|
@ -589,8 +589,6 @@ void Editor::setupSegmentedBar()
|
||||||
// Graphic
|
// Graphic
|
||||||
|
|
||||||
setSymbol( Q::Graphic, symbol( "segmented-button-check" ) );
|
setSymbol( Q::Graphic, symbol( "segmented-button-check" ) );
|
||||||
|
|
||||||
setPadding( Q::Graphic, 0_dp );
|
|
||||||
setStrutSize( Q::Graphic, 18_dp, 18_dp );
|
setStrutSize( Q::Graphic, 18_dp, 18_dp );
|
||||||
|
|
||||||
setGraphicRole( Q::Graphic, QskMaterial3Skin::GraphicRoleOnSurface );
|
setGraphicRole( Q::Graphic, QskMaterial3Skin::GraphicRoleOnSurface );
|
||||||
|
|
|
@ -362,14 +362,18 @@ void Editor::setupComboBox()
|
||||||
{
|
{
|
||||||
using Q = QskComboBox;
|
using Q = QskComboBox;
|
||||||
|
|
||||||
setAlignment( Q::Text, Qt::AlignLeft | Qt::AlignHCenter );
|
setAlignment( Q::Text, Qt::AlignLeft | Qt::AlignVCenter );
|
||||||
setColor( Q::Text, m_pal.themeForeground );
|
setColor( Q::Text, m_pal.themeForeground );
|
||||||
setColor( Q::Text | Q::Disabled, m_pal.darker200 );
|
setColor( Q::Text | Q::Disabled, m_pal.darker200 );
|
||||||
|
|
||||||
|
setStrutSize( Q::Panel, -1.0, 56_dp );
|
||||||
|
|
||||||
setPadding( Q::Panel, 5 );
|
setPadding( Q::Panel, 5 );
|
||||||
setBoxBorderMetrics( Q::Panel, 2 );
|
setBoxBorderMetrics( Q::Panel, 2 );
|
||||||
setBoxShape( Q::Panel, 4 );
|
setBoxShape( Q::Panel, 4 );
|
||||||
|
|
||||||
|
setSpacing( Q::Panel, 8_dp );
|
||||||
|
|
||||||
const QColor c = m_pal.theme.lighter( 120 );
|
const QColor c = m_pal.theme.lighter( 120 );
|
||||||
|
|
||||||
const QskBoxBorderColors borderColors(
|
const QskBoxBorderColors borderColors(
|
||||||
|
@ -613,9 +617,7 @@ void Editor::setupSegmentedBar()
|
||||||
|
|
||||||
setGraphicRole( Q::Graphic | Q::Disabled, DisabledSymbol );
|
setGraphicRole( Q::Graphic | Q::Disabled, DisabledSymbol );
|
||||||
setGraphicRole( Q::Graphic | Q::Selected, CursorSymbol );
|
setGraphicRole( Q::Graphic | Q::Selected, CursorSymbol );
|
||||||
#if 0
|
setStrutSize( Q::Graphic, -1, 30_dp );
|
||||||
setStrutSize( Q::Graphic, ... );
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -198,6 +198,17 @@ QSizeF QskSubcontrolLayoutEngine::TextElement::implicitSize( const QSizeF& const
|
||||||
hint = QskTextRenderer::textSize( m_text, font, textOptions );
|
hint = QskTextRenderer::textSize( m_text, font, textOptions );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 1
|
||||||
|
if ( hint.width() > 0.0 )
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
workaround for a rounding problem that might lead to
|
||||||
|
seeing dots, when being in elide mode. TODO ...
|
||||||
|
*/
|
||||||
|
hint.rwidth() += 1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return hint;
|
return hint;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -222,8 +233,8 @@ QSizeF QskSubcontrolLayoutEngine::GraphicElement::effectiveStrutSize() const
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QSizeF QskSubcontrolLayoutEngine::GraphicElement::implicitSize(
|
||||||
QSizeF QskSubcontrolLayoutEngine::GraphicElement::implicitSize( const QSizeF& constraint ) const
|
const QSizeF& constraint ) const
|
||||||
{
|
{
|
||||||
auto hint = m_sourceSize;
|
auto hint = m_sourceSize;
|
||||||
|
|
||||||
|
@ -246,8 +257,8 @@ QSizeF QskSubcontrolLayoutEngine::GraphicElement::implicitSize( const QSizeF& co
|
||||||
return hint;
|
return hint;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static QskLayoutChain::CellData qskCell(
|
||||||
static QskLayoutChain::CellData qskCell( const QskSubcontrolLayoutEngine::LayoutElement* element,
|
const QskSubcontrolLayoutEngine::LayoutElement* element,
|
||||||
Qt::Orientation orientation, bool isLayoutOrientation, qreal constraint )
|
Qt::Orientation orientation, bool isLayoutOrientation, qreal constraint )
|
||||||
{
|
{
|
||||||
QskLayoutChain::CellData cell;
|
QskLayoutChain::CellData cell;
|
||||||
|
@ -411,16 +422,15 @@ void QskSubcontrolLayoutEngine::setGraphicTextElements( const QskSkinnable* skin
|
||||||
void QskSubcontrolLayoutEngine::setFixedContent(
|
void QskSubcontrolLayoutEngine::setFixedContent(
|
||||||
QskAspect::Subcontrol subcontrol, Qt::Orientation orientation, Qt::Alignment alignment )
|
QskAspect::Subcontrol subcontrol, Qt::Orientation orientation, Qt::Alignment alignment )
|
||||||
{
|
{
|
||||||
if( auto* e = element( subcontrol ) )
|
if( auto e = element( subcontrol ) )
|
||||||
{
|
|
||||||
e->setSizePolicy( QskSizePolicy::Maximum, e->sizePolicy().verticalPolicy() );
|
e->setSizePolicy( QskSizePolicy::Maximum, e->sizePolicy().verticalPolicy() );
|
||||||
}
|
|
||||||
|
|
||||||
Qt::Edges extraSpacing;
|
Qt::Edges extraSpacing;
|
||||||
|
|
||||||
switch( orientation )
|
switch( orientation )
|
||||||
{
|
{
|
||||||
case Qt::Horizontal:
|
case Qt::Horizontal:
|
||||||
|
{
|
||||||
extraSpacing |= ( extraSpacingAt() & ( Qt::TopEdge | Qt::BottomEdge ) );
|
extraSpacing |= ( extraSpacingAt() & ( Qt::TopEdge | Qt::BottomEdge ) );
|
||||||
|
|
||||||
if( alignment & Qt::AlignLeft )
|
if( alignment & Qt::AlignLeft )
|
||||||
|
@ -436,7 +446,9 @@ void QskSubcontrolLayoutEngine::setFixedContent(
|
||||||
extraSpacing |= Qt::LeftEdge | Qt::RightEdge;
|
extraSpacing |= Qt::LeftEdge | Qt::RightEdge;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case Qt::Vertical:
|
case Qt::Vertical:
|
||||||
|
{
|
||||||
extraSpacing |= ( extraSpacingAt() & ( Qt::LeftEdge | Qt::RightEdge ) );
|
extraSpacing |= ( extraSpacingAt() & ( Qt::LeftEdge | Qt::RightEdge ) );
|
||||||
|
|
||||||
if( alignment & Qt::AlignTop )
|
if( alignment & Qt::AlignTop )
|
||||||
|
@ -453,6 +465,7 @@ void QskSubcontrolLayoutEngine::setFixedContent(
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
setExtraSpacingAt( extraSpacing );
|
setExtraSpacingAt( extraSpacing );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue