Skip to content

Commit

Permalink
Some layout changes
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Sep 29, 2017
1 parent d5e0b18 commit 7410fbb
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 93 deletions.
28 changes: 13 additions & 15 deletions src/app/qgsattributesformproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,28 @@
QgsAttributesFormProperties::QgsAttributesFormProperties( QgsVectorLayer *layer, QWidget *parent )
: QWidget( parent )
, mLayer( layer )
, mAvailableWidgetsTree( nullptr )
, mFormLayoutTree( nullptr )
, mAttributeTypeDialog( nullptr )
{
if ( !layer )
return;

setupUi( this );

// drag tree (not mixup with drag queen)
QGridLayout *mDragListWidgetLayout = new QGridLayout;
mAvailableWidgetsTree = new DnDTree( mLayer, mDragListWidget );
mDragListWidgetLayout->addWidget( mAvailableWidgetsTree );
mDragListWidget->setLayout( mDragListWidgetLayout );
// available widgets tree
QGridLayout *availableWidgetsWidgetLayout = new QGridLayout;
mAvailableWidgetsTree = new DnDTree( mLayer );
availableWidgetsWidgetLayout->addWidget( mAvailableWidgetsTree );
availableWidgetsWidgetLayout->setMargin( 0 );
mAvailableWidgetsWidget->setLayout( availableWidgetsWidgetLayout );
mAvailableWidgetsTree->setHeaderLabels( QStringList() << tr( "Available Widgets" ) );
mAvailableWidgetsTree->setType( DnDTree::Type::Drag );

// drop tree
QGridLayout *mDropListWidgetLayout = new QGridLayout;
mFormLayoutTree = new DnDTree( mLayer, mDropListWidget );
mDropListWidgetLayout->addWidget( mFormLayoutTree );
mDropListWidgetLayout->setMargin( 0 );
mDropListWidget->setLayout( mDropListWidgetLayout );
mFormLayoutTree->setHeaderLabels( QStringList() << tr( "Form Structure" ) );
// form layout tree
QGridLayout *formLayoutWidgetLayout = new QGridLayout;
mFormLayoutTree = new DnDTree( mLayer );
mFormLayoutWidget->setLayout( formLayoutWidgetLayout );
formLayoutWidgetLayout->addWidget( mFormLayoutTree );
formLayoutWidgetLayout->setMargin( 0 );
mFormLayoutTree->setHeaderLabels( QStringList() << tr( "Form Layout" ) );
mFormLayoutTree->setType( DnDTree::Type::Drop );

// AttributeTypeDialog
Expand Down
166 changes: 88 additions & 78 deletions src/ui/qgsattributesformproperties.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,101 +6,86 @@
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
<width>625</width>
<height>359</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<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="QSplitter" name="splitter">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<widget class="QWidget" name="mDragListWidget" native="true"/>
<widget class="QWidget" name="widget_2" native="true">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<item>
<widget class="QWidget" name="widget" native="true">
<property name="maximumSize">
<widget class="QWidget" name="widget" native="true">
<layout class="QGridLayout" name="gridLayout_3">
<item row="2" column="1">
<widget class="QToolButton" name="mRemoveTabOrGroupButton">
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/symbologyRemove.svg</normaloff>:/images/themes/default/symbologyRemove.svg</iconset>
</property>
</widget>
</item>
<item row="3" column="1">
<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">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>16777215</width>
<width>20</width>
<height>40</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<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>
<widget class="QToolButton" name="mRemoveTabOrGroupButton">
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/symbologyRemove.svg</normaloff>:/images/themes/default/symbologyRemove.svg</iconset>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="mAddTabOrGroupButton">
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/symbologyAdd.svg</normaloff>:/images/themes/default/symbologyAdd.svg</iconset>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</spacer>
</item>
<item row="1" column="1">
<widget class="QToolButton" name="mAddTabOrGroupButton">
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/symbologyAdd.svg</normaloff>:/images/themes/default/symbologyAdd.svg</iconset>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="mDropListWidget" native="true"/>
<item row="0" column="2" rowspan="4">
<widget class="QWidget" name="mFormLayoutWidget" native="true"/>
</item>
<item row="0" column="0" rowspan="4">
<widget class="QWidget" name="mAvailableWidgetsWidget" native="true"/>
</item>
</layout>
</widget>
Expand All @@ -113,6 +98,31 @@
</widget>
<resources>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
</resources>
<connections/>
</ui>

0 comments on commit 7410fbb

Please sign in to comment.