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 ) void QgsPhongMaterialWidget::setDiffuseVisible( bool visible )
{ {
label->setVisible( visible ); lblDiffuse->setVisible( visible );
btnDiffuse->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; << labelBillboardHeight << spinBillboardHeight << labelBillboardSymbol << btnChangeSymbol;


widgetMaterial->setEnabled( true ); widgetMaterial->setEnabled( true );
widgetMaterial->show(); materialsGroupBox->show();
transformationWidget->show(); transformationWidget->show();
QList<QWidget *> activeWidgets; QList<QWidget *> activeWidgets;
switch ( cboShape->currentIndex() ) switch ( cboShape->currentIndex() )
Expand Down Expand Up @@ -287,7 +287,7 @@ void QgsPoint3DSymbolWidget::onShapeChanged()
case 7: // billboard case 7: // billboard
activeWidgets << labelBillboardHeight << spinBillboardHeight << labelBillboardSymbol << btnChangeSymbol; activeWidgets << labelBillboardHeight << spinBillboardHeight << labelBillboardSymbol << btnChangeSymbol;
// Always hide material and transformationwidget for billboard // Always hide material and transformationwidget for billboard
widgetMaterial->hide(); materialsGroupBox->hide();
transformationWidget->hide(); transformationWidget->hide();
break; 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 ); widgetStack->addWidget( widgetPolygon );


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


connect( widgetLine, &QgsLine3DSymbolWidget::changed, this, &QgsSymbol3DWidget::widgetChanged ); 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 ); widgetSymbol = new QgsSymbol3DWidget( this );


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


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

0 comments on commit 958b982

Please sign in to comment.