Skip to content

Commit

Permalink
Align 3D View properties tab rendering with common properties tabs
Browse files Browse the repository at this point in the history
* using groupbox for items instead of line separator
* reducing the oversized margins
  • Loading branch information
DelazJ authored and nyalldawson committed Mar 5, 2020
1 parent 7ca97f3 commit 958b982
Show file tree
Hide file tree
Showing 9 changed files with 500 additions and 391 deletions.
2 changes: 1 addition & 1 deletion src/app/3d/qgsphongmaterialwidget.cpp
Expand Up @@ -33,7 +33,7 @@ QgsPhongMaterialWidget::QgsPhongMaterialWidget( QWidget *parent )

void QgsPhongMaterialWidget::setDiffuseVisible( bool visible )
{
label->setVisible( visible );
lblDiffuse->setVisible( visible );
btnDiffuse->setVisible( visible );
}

Expand Down
4 changes: 2 additions & 2 deletions src/app/3d/qgspoint3dsymbolwidget.cpp
Expand Up @@ -257,7 +257,7 @@ void QgsPoint3DSymbolWidget::onShapeChanged()
<< labelBillboardHeight << spinBillboardHeight << labelBillboardSymbol << btnChangeSymbol;

widgetMaterial->setEnabled( true );
widgetMaterial->show();
materialsGroupBox->show();
transformationWidget->show();
QList<QWidget *> activeWidgets;
switch ( cboShape->currentIndex() )
Expand Down Expand Up @@ -287,7 +287,7 @@ void QgsPoint3DSymbolWidget::onShapeChanged()
case 7: // billboard
activeWidgets << labelBillboardHeight << spinBillboardHeight << labelBillboardSymbol << btnChangeSymbol;
// Always hide material and transformationwidget for billboard
widgetMaterial->hide();
materialsGroupBox->hide();
transformationWidget->hide();
break;
}
Expand Down
1 change: 1 addition & 0 deletions src/app/3d/qgssymbol3dwidget.cpp
Expand Up @@ -42,6 +42,7 @@ QgsSymbol3DWidget::QgsSymbol3DWidget( QWidget *parent ) : QWidget( parent )
widgetStack->addWidget( widgetPolygon );

QVBoxLayout *layout = new QVBoxLayout( this );
layout->setContentsMargins( 0, 0, 0, 0 );
layout->addWidget( widgetStack );

connect( widgetLine, &QgsLine3DSymbolWidget::changed, this, &QgsSymbol3DWidget::widgetChanged );
Expand Down
1 change: 1 addition & 0 deletions src/app/3d/qgsvectorlayer3drendererwidget.cpp
Expand Up @@ -38,6 +38,7 @@ QgsSingleSymbol3DRendererWidget::QgsSingleSymbol3DRendererWidget( QWidget *paren
widgetSymbol = new QgsSymbol3DWidget( this );

QVBoxLayout *layout = new QVBoxLayout( this );
layout->setContentsMargins( 0, 0, 0, 0 );
layout->addWidget( widgetSymbol );

connect( widgetSymbol, &QgsSymbol3DWidget::widgetChanged, this, &QgsSingleSymbol3DRendererWidget::widgetChanged );
Expand Down
56 changes: 45 additions & 11 deletions src/ui/3d/line3dsymbolwidget.ui
Expand Up @@ -6,18 +6,21 @@
<rect>
<x>0</x>
<y>0</y>
<width>538</width>
<height>547</height>
<width>382</width>
<height>264</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="margin">
<number>0</number>
</property>
<item>
<layout class="QFormLayout" name="formLayout">
<item row="1" column="0">
<widget class="QLabel" name="label">
<widget class="QLabel" name="labelHeight">
<property name="text">
<string>Height</string>
</property>
Expand All @@ -34,7 +37,7 @@
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<widget class="QLabel" name="labelExtrusion">
<property name="text">
<string>Extrusion</string>
</property>
Expand All @@ -48,7 +51,7 @@
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<widget class="QLabel" name="labelClamping">
<property name="text">
<string>Altitude clamping</string>
</property>
Expand All @@ -74,7 +77,7 @@
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_4">
<widget class="QLabel" name="labelBinding">
<property name="text">
<string>Altitude binding</string>
</property>
Expand All @@ -95,7 +98,7 @@
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_5">
<widget class="QLabel" name="labelWidth">
<property name="text">
<string>Width</string>
</property>
Expand All @@ -118,14 +121,39 @@
</widget>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<widget class="QgsCollapsibleGroupBox" name="groupShading">
<property name="title">
<string>Shading</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="margin">
<number>0</number>
</property>
<item row="3" column="0" colspan="2">
<widget class="QgsPhongMaterialWidget" name="widgetMaterial" native="true">
<property name="minimumSize">
<size>
<width>10</width>
<height>10</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QgsPhongMaterialWidget" name="widgetMaterial" native="true"/>
<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>
</layout>
</widget>
Expand All @@ -141,6 +169,12 @@
<extends>QDoubleSpinBox</extends>
<header>qgsdoublespinbox.h</header>
</customwidget>
<customwidget>
<class>QgsCollapsibleGroupBox</class>
<extends>QGroupBox</extends>
<header>qgscollapsiblegroupbox.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>spinWidth</tabstop>
Expand Down
10 changes: 8 additions & 2 deletions src/ui/3d/map3dconfigwidget.ui
Expand Up @@ -36,8 +36,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>521</width>
<height>685</height>
<width>539</width>
<height>693</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_4">
Expand Down Expand Up @@ -160,6 +160,9 @@
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QgsPhongMaterialWidget" name="widgetTerrainMaterial" native="true"/>
</item>
Expand Down Expand Up @@ -198,6 +201,9 @@
<string>Lights</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QgsLightsWidget" name="widgetLights" native="true"/>
</item>
Expand Down
12 changes: 6 additions & 6 deletions src/ui/3d/phongmaterialwidget.ui
Expand Up @@ -6,16 +6,16 @@
<rect>
<x>0</x>
<y>0</y>
<width>334</width>
<height>252</height>
<width>338</width>
<height>138</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<widget class="QLabel" name="lblDiffuse">
<property name="text">
<string>Diffuse</string>
</property>
Expand All @@ -38,7 +38,7 @@
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<widget class="QLabel" name="lblAmbient">
<property name="text">
<string>Ambient</string>
</property>
Expand All @@ -61,7 +61,7 @@
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<widget class="QLabel" name="lblSpecular">
<property name="text">
<string>Specular</string>
</property>
Expand All @@ -84,7 +84,7 @@
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<widget class="QLabel" name="lblShininess">
<property name="text">
<string>Shininess</string>
</property>
Expand Down

0 comments on commit 958b982

Please sign in to comment.