Skip to content
Permalink
Browse files

[ui] Harmonize effects stack properties to match revamped symbol sele…

…ctor
  • Loading branch information
nirvn committed May 17, 2019
1 parent 13ec10e commit 395a82bdca0899c090cb8ab7df19c23ec092740d
@@ -107,6 +107,11 @@ QgsEffectStackPropertiesWidget::QgsEffectStackPropertiesWidget( QgsEffectStack *
mPresentWidget = nullptr;

setupUi( this );
this->layout()->setContentsMargins( 0, 0, 0, 0 );

mEffectsList->setMaximumHeight( static_cast< int >( Qgis::UI_SCALE_FACTOR * fontMetrics().height() * 7 ) );
mEffectsList->setMinimumHeight( mEffectsList->maximumHeight() );
lblPreview->setMaximumWidth( mEffectsList->maximumHeight() );

mAddButton->setIcon( QIcon( QgsApplication::iconPath( "symbologyAdd.svg" ) ) );
mRemoveButton->setIcon( QIcon( QgsApplication::iconPath( "symbologyRemove.svg" ) ) );
@@ -204,7 +209,7 @@ void QgsEffectStackPropertiesWidget::updateUi()
void QgsEffectStackPropertiesWidget::updatePreview()
{
QPainter painter;
QImage previewImage( 150, 150, QImage::Format_ARGB32 );
QImage previewImage( 100, 100, QImage::Format_ARGB32 );
previewImage.fill( Qt::transparent );
painter.begin( &previewImage );
painter.setRenderHint( QPainter::Antialiasing );
@@ -216,13 +221,13 @@ void QgsEffectStackPropertiesWidget::updatePreview()
previewPicPainter.begin( &previewPic );
previewPicPainter.setPen( Qt::red );
previewPicPainter.setBrush( QColor( 255, 100, 100, 255 ) );
previewPicPainter.drawEllipse( QPoint( 75, 75 ), 30, 30 );
previewPicPainter.drawEllipse( QPoint( 50, 50 ), 20, 20 );
previewPicPainter.end();
mStack->render( previewPic, context );
}
else
{
context.painter()->translate( 35, 35 );
context.painter()->translate( 20, 20 );
mStack->render( *mPreviewPicture, context );
}
painter.end();
@@ -319,7 +319,7 @@ void QgsLayerPropertiesWidget::emitSignalChanged()
mLayer->paintEffect()->setEnabled( false );
paintEffectToggled = true;
}
mEffectWidget->setPreviewPicture( QgsSymbolLayerUtils::symbolLayerPreviewPicture( mLayer, QgsUnitTypes::RenderMillimeters, QSize( 80, 80 ) ) );
mEffectWidget->setPreviewPicture( QgsSymbolLayerUtils::symbolLayerPreviewPicture( mLayer, QgsUnitTypes::RenderMillimeters, QSize( 60, 60 ) ) );
if ( paintEffectToggled )
{
mLayer->paintEffect()->setEnabled( true );
@@ -32,7 +32,7 @@
<item>
<widget class="QComboBox" name="mEffectTypeCombo">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@@ -16,43 +16,24 @@
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QListView" name="mEffectsList">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>150</height>
</size>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lblPreview">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>150</width>
<height>150</height>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>150</height>
<width>120</width>
<height>100</height>
</size>
</property>
<property name="frameShape">
@@ -71,84 +52,136 @@
<string/>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="pushBtnBox">
<property name="spacing">
<number>6</number>
</property>
<item>
<widget class="QPushButton" name="mAddButton">
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Add new effect</string>
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="mRemoveButton">
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Remove effect</string>
<widget class="QListView" name="mEffectsList">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="mUpButton">
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
<width>16777215</width>
<height>150</height>
</size>
</property>
<property name="toolTip">
<string>Move up</string>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="mDownButton">
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Move down</string>
</property>
</widget>
<layout class="QVBoxLayout" name="pushBtnBox_1">
<property name="spacing">
<number>4</number>
</property>
<item>
<widget class="QPushButton" name="mAddButton">
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Add new effect</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="mRemoveButton">
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Remove effect</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_1">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>80</height>
</size>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
<layout class="QVBoxLayout" name="pushBtnBox_2">
<property name="spacing">
<number>4</number>
</property>
<item>
<widget class="QPushButton" name="mUpButton">
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Move up</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="mDownButton">
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Move down</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>80</height>
</size>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QFrame" name="frame">
<property name="sizePolicy">

0 comments on commit 395a82b

Please sign in to comment.
You can’t perform that action at this time.