Respect panel's padding

This commit is contained in:
Clemens Manert 2023-05-02 00:39:16 +02:00 committed by uwerat
parent 684f9c91da
commit 87bfa8611f
3 changed files with 11 additions and 4 deletions

View File

@ -792,6 +792,8 @@ void Editor::setupDialogButtonBox()
void Editor::setupDrawer() { void Editor::setupDrawer() {
using Q = QskDrawer; using Q = QskDrawer;
setPadding( Q::Panel, 5_dp );
setGradient( Q::Panel, m_pal.background );
setAnimation( Q::Panel | QskAspect::Position, qskDuration ); setAnimation( Q::Panel | QskAspect::Position, qskDuration );
setHint( Q::Overlay | QskAspect::Style, false ); setHint( Q::Overlay | QskAspect::Style, false );
} }

View File

@ -736,6 +736,8 @@ void Editor::setupDialogButtonBox()
void Editor::setupDrawer() { void Editor::setupDrawer() {
using Q = QskDrawer; using Q = QskDrawer;
setPadding( Q::Panel, 5 );
setGradient( Q::Panel, m_pal.darker125 );
setAnimation( Q::Panel | QskAspect::Position, qskDuration ); setAnimation( Q::Panel | QskAspect::Position, qskDuration );
setHint( Q::Overlay | QskAspect::Style, false ); setHint( Q::Overlay | QskAspect::Style, false );
} }

View File

@ -65,7 +65,9 @@ void QskDrawer::setContent( QskControl* content ) {
} }
void QskDrawer::updateLayout() { void QskDrawer::updateLayout() {
const auto& contentSize = m_data->content->preferredSize(); const auto& padding = paddingHint( Panel );
const auto& contentSize = m_data->content->preferredSize()
.grownBy( padding );
const auto& parentSize = parentItem()->size(); const auto& parentSize = parentItem()->size();
switch( m_data->edge ) { switch( m_data->edge ) {
@ -111,7 +113,8 @@ void QskDrawer::updateLayout() {
break; break;
} }
} }
m_data->content->setGeometry( QPointF(), m_data->contentBox->size() ); m_data->content->setGeometry( QPointF( padding.left(), padding.top() ),
m_data->contentBox->size().shrunkBy( padding ) );
Inherited::updateLayout(); Inherited::updateLayout();
} }