Skip to content

Commit

Permalink
improved UX
Browse files Browse the repository at this point in the history
* 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 c6caa29
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 28 deletions.
10 changes: 10 additions & 0 deletions src/app/qgsprojectproperties.cpp
Expand Up @@ -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 );
Expand Down
68 changes: 40 additions & 28 deletions src/ui/qgsprojectpropertiesbase.ui
Expand Up @@ -277,7 +277,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>563</width>
<width>676</width>
<height>833</height>
</rect>
</property>
Expand Down Expand Up @@ -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">
Expand Down Expand Up @@ -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">
Expand Down Expand Up @@ -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">
Expand All @@ -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>
Expand Down Expand Up @@ -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">
Expand Down Expand Up @@ -1641,7 +1653,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>603</width>
<width>676</width>
<height>2666</height>
</rect>
</property>
Expand Down

0 comments on commit c6caa29

Please sign in to comment.