Skip to content
Permalink
Browse files

improved UX

* checkbox placement
* capitalize text in buttns
* place holder for line edit
* enable/disable buttons depending on selection
  • Loading branch information
3nids committed Sep 2, 2018
1 parent 9cefd3a commit c6caa291409befdd54fa818c692620cabbaf9f41
Showing with 50 additions and 28 deletions.
  1. +10 −0 src/app/qgsprojectproperties.cpp
  2. +40 −28 src/ui/qgsprojectpropertiesbase.ui
@@ -363,9 +363,19 @@ QgsProjectProperties::QgsProjectProperties( QgsMapCanvas *mapCanvas, QWidget *pa
mLayerCapabilitiesTree->setSelectionBehavior( QAbstractItemView::SelectItems );
mLayerCapabilitiesTree->setSelectionMode( QAbstractItemView::MultiSelection );
mLayerCapabilitiesTree->expandAll();
connect( mLayerCapabilitiesTree->selectionModel(), &QItemSelectionModel::selectionChanged, this,
[ = ]( const QItemSelection & selected, const QItemSelection & deselected )
{
Q_UNUSED( selected );
Q_UNUSED( deselected );
bool hasSelection = !mLayerCapabilitiesTree->selectionModel()->selectedIndexes().isEmpty();
mLayerCapabilitiesCheckButton->setEnabled( hasSelection );
mLayerCapabilitiesUncheckButton->setEnabled( hasSelection );
} );

mLayerCapabilitiesTreeFilterLineEdit->setShowClearButton( true );
mLayerCapabilitiesTreeFilterLineEdit->setShowSearchIcon( true );
mLayerCapabilitiesTreeFilterLineEdit->setPlaceholderText( tr( "Filter layers…" ) );
connect( mLayerCapabilitiesTreeFilterLineEdit, &QgsFilterLineEdit::textChanged, this, [ = ]( const QString & filterText )
{
mLayerCapabilitiesModel->setFilterText( filterText );
@@ -277,7 +277,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>563</width>
<width>676</width>
<height>833</height>
</rect>
</property>
@@ -875,8 +875,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>547</width>
<height>152</height>
<width>676</width>
<height>764</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_7">
@@ -950,8 +950,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>271</width>
<height>597</height>
<width>676</width>
<height>764</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_12">
@@ -1411,8 +1411,31 @@
<string>Project Layers</string>
</property>
<layout class="QGridLayout" name="gridLayout_20">
<item row="3" column="3">
<widget class="QgsFilterLineEdit" name="mLayerCapabilitiesTreeFilterLineEdit"/>
<property name="verticalSpacing">
<number>0</number>
</property>
<item row="1" column="0" colspan="4">
<widget class="QTreeView" name="mLayerCapabilitiesTree"/>
</item>
<item row="3" column="1">
<widget class="QPushButton" name="mLayerCapabilitiesCheckButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Check Selected</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QPushButton" name="mLayerCapabilitiesUncheckButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Uncheck Selected</string>
</property>
</widget>
</item>
<item row="3" column="2">
<spacer name="horizontalSpacer_5">
@@ -1427,30 +1450,19 @@
</property>
</spacer>
</item>
<item row="3" column="0">
<widget class="QPushButton" name="mLayerCapabilitiesUncheckButton">
<property name="text">
<string>uncheck selection</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QPushButton" name="mLayerCapabilitiesCheckButton">
<property name="text">
<string>check selection</string>
</property>
</widget>
<item row="3" column="3">
<widget class="QgsFilterLineEdit" name="mLayerCapabilitiesTreeFilterLineEdit"/>
</item>
<item row="2" column="3">
<item row="4" column="3">
<widget class="QCheckBox" name="mShowSpatialLayersCheckBox">
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="text">
<string>show spatial layers only</string>
<string>Show spatial layers only</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="4">
<widget class="QTreeView" name="mLayerCapabilitiesTree"/>
</item>
</layout>
</widget>
</item>
@@ -1579,8 +1591,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>157</width>
<height>59</height>
<width>676</width>
<height>764</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_17">
@@ -1641,7 +1653,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>603</width>
<width>676</width>
<height>2666</height>
</rect>
</property>

0 comments on commit c6caa29

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