Skip to content
Permalink
Browse files

[ui] Improve the load style dialog

- Remove harmful horizontal spacer to fix expanding
widget issues and location of help button
- Relocate the file widget to sit on top of the category
list (to harmonize with the save style dialog)
  • Loading branch information
nirvn committed Sep 7, 2020
1 parent 5c241c8 commit 27422fd71718d68544c56a47228a5d16310c2f9f
Showing with 14 additions and 50 deletions.
  1. +2 −1 src/gui/qgsmaplayerloadstyledialog.cpp
  2. +12 −49 src/ui/qgsvectorlayerloadstyledialog.ui
@@ -59,7 +59,8 @@ QgsMapLayerLoadStyleDialog::QgsMapLayerLoadStyleDialog( QgsMapLayer *layer, QWid
{
QgsVectorLayerProperties::StyleType type = currentStyleType();
QgsVectorLayer *vl = qobject_cast< QgsVectorLayer * >( mLayer );
mFromFileWidget->setVisible( !vl || type != QgsVectorLayerProperties::StyleType::DB );
mFileLabel->setVisible( !vl || type != QgsVectorLayerProperties::StyleType::DB );
mFileWidget->setVisible( !vl || type != QgsVectorLayerProperties::StyleType::DB );
if ( vl )
{
mFromDbWidget->setVisible( type == QgsVectorLayerProperties::StyleType::DB );
@@ -23,81 +23,44 @@
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="4" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="mStyleTypeComboBox"/>
</item>
<item row="2" column="0" colspan="2">
<widget class="QWidget" name="mFromFileWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="2" column="0">
<widget class="QLabel" name="mFileLabel">
<property name="text">
<string>File</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>File</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QgsFileWidget" name="mFileWidget" native="true"/>
</item>
</layout>
</widget>
</item>
<item row="2" column="1">
<widget class="QgsFileWidget" name="mFileWidget" native="true"/>
</item>
<item row="0" column="0">
<widget class="QLabel" name="mModeLabel">
<property name="text">
<string>Load style</string>
</property>
</widget>
</item>
<item row="1" column="0">
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Categories</string>
</property>
</widget>
</item>
<item row="1" column="1">
<item row="3" column="1">
<widget class="QListView" name="mStyleCategoriesListView">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<item row="1" column="0" colspan="2">
<widget class="QWidget" name="mFromDbWidget" native="true">
<layout class="QGridLayout" name="gridLayout_2">
<property name="leftMargin">
@@ -143,7 +106,7 @@
</layout>
</widget>
</item>
<item row="5" column="0" colspan="2">
<item row="4" column="0" colspan="2">
<widget class="QDialogButtonBox" name="mButtonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Close|QDialogButtonBox::Help|QDialogButtonBox::Open</set>

0 comments on commit 27422fd

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