diff --git a/src/controls/QskSegmentedBarSkinlet.cpp b/src/controls/QskSegmentedBarSkinlet.cpp index b5934c22..a79442b0 100644 --- a/src/controls/QskSegmentedBarSkinlet.cpp +++ b/src/controls/QskSegmentedBarSkinlet.cpp @@ -16,19 +16,6 @@ #include #include -static inline Qt::Orientation qskOrientation( const QskSegmentedBar* bar ) -{ - // For the moment we only handle the orientation TODO ... - - const auto direction = bar->flagHint( - QskSegmentedBar::Panel | QskAspect::Direction, Qsk::LeftToRight ); - - if ( direction == Qsk::LeftToRight || direction == Qsk::RightToLeft ) - return Qt::Horizontal; - else - return Qt::Vertical; -} - namespace { QskGraphic graphicAt( const QskSegmentedBar* bar, const int index ) @@ -48,7 +35,7 @@ namespace { public: LayoutEngine( const QskSegmentedBar* bar, int index ) - : QskSubcontrolLayoutEngine( qskOrientation( bar ) ) + : QskSubcontrolLayoutEngine( bar->orientation() ) { setSpacing( bar->spacingHint( QskSegmentedBar::Panel ) ); @@ -56,8 +43,11 @@ namespace QskSegmentedBar::Text, bar->textAt( index ), QskSegmentedBar::Graphic, graphicAt( bar, index ).defaultSize() ); - const auto alignment = bar->alignmentHint( QskSegmentedBar::Panel, Qt::AlignCenter ); - setFixedContent( QskSegmentedBar::Text, Qt::Horizontal, alignment ); + if( bar->orientation() == Qt::Horizontal ) + { + const auto alignment = bar->alignmentHint( QskSegmentedBar::Panel, Qt::AlignCenter ); + setFixedContent( QskSegmentedBar::Text, Qt::Horizontal, alignment ); + } } }; } diff --git a/src/layouts/QskSubcontrolLayoutEngine.cpp b/src/layouts/QskSubcontrolLayoutEngine.cpp index 4c42b011..d7227df7 100644 --- a/src/layouts/QskSubcontrolLayoutEngine.cpp +++ b/src/layouts/QskSubcontrolLayoutEngine.cpp @@ -390,7 +390,7 @@ void QskSubcontrolLayoutEngine::setGraphicTextElements( const QskSkinnable* skin } else { - graphicElement->setSizePolicy( SP::Fixed, SP::Fixed ); + graphicElement->setSizePolicy( SP::Preferred, SP::Fixed ); textElement->setSizePolicy( SP::Preferred, SP::Constrained ); }