Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[ui] Revamp the symbol selector preview / layer tree / buttons
  • Loading branch information
nirvn committed May 17, 2019
1 parent 943c7d5 commit 13ec10e
Show file tree
Hide file tree
Showing 2 changed files with 147 additions and 114 deletions.
1 change: 1 addition & 0 deletions src/gui/symbology/qgssymbolselectordialog.cpp
Expand Up @@ -244,6 +244,7 @@ QgsSymbolSelectorWidget::QgsSymbolSelectorWidget( QgsSymbol *symbol, QgsStyle *s

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

// setup icons
btnAddLayer->setIcon( QIcon( QgsApplication::iconPath( "symbologyAdd.svg" ) ) );
Expand Down
260 changes: 146 additions & 114 deletions src/ui/qgssymbolselectordialogbase.ui
Expand Up @@ -14,112 +14,42 @@
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="0">
<layout class="QHBoxLayout" name="pushBtnBox">
<property name="spacing">
<number>6</number>
</property>
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="btnAddLayer">
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Add symbol layer</string>
<widget class="QLabel" name="lblPreview">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnRemoveLayer">
<property name="maximumSize">
<property name="minimumSize">
<size>
<width>50</width>
<height>16777215</height>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="toolTip">
<string>Remove symbol layer</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnLock">
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="toolTip">
<string>Lock layer's color</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnDuplicate">
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="toolTip">
<string>Duplicates the current layer</string>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnUp">
<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="btnDown">
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Move down</string>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</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>
</item>
</layout>
</item>
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QTreeView" name="layersTree">
<property name="sizePolicy">
Expand All @@ -140,36 +70,138 @@
</widget>
</item>
<item>
<widget class="QLabel" name="lblPreview">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<property name="text">
<string/>
<layout class="QVBoxLayout" name="pushBtnBox_1">
<property name="spacing">
<number>4</number>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
<item>
<widget class="QPushButton" name="btnAddLayer">
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Add symbol layer</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnRemoveLayer">
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Remove symbol layer</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnDuplicate">
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Duplicates the current layer</string>
</property>
<property name="text">
<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>50</height>
</size>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="pushBtnBox_2">
<property name="spacing">
<number>4</number>
</property>
</widget>
<item>
<widget class="QPushButton" name="btnUp">
<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="btnDown">
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Move down</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnLock">
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Lock layer's color</string>
</property>
<property name="checkable">
<bool>true</bool>
</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>50</height>
</size>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
<item row="2" column="0">
<item row="1" column="0">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
Expand Down

0 comments on commit 13ec10e

Please sign in to comment.