mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-06 00:07:29 -04:00
Add minor UI improvements
Debug camera info is always shown Debug depth map widget's default position is moved to bottom left corner, so it won't collide with axis widget Docking icon is moved to the last position Toolbar icon size is finally correct, changes with the window docked state as it should
This commit is contained in:
parent
edac3f7f7b
commit
7292ba50f8
@ -995,7 +995,7 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec
|
||||
double mDebugShadowMapSize = 0.2;
|
||||
|
||||
bool mDebugDepthMapEnabled = false;
|
||||
Qt::Corner mDebugDepthMapCorner = Qt::Corner::TopRightCorner;
|
||||
Qt::Corner mDebugDepthMapCorner = Qt::Corner::BottomLeftCorner;
|
||||
double mDebugDepthMapSize = 0.2;
|
||||
|
||||
bool mTerrainRenderingEnabled = true;
|
||||
|
@ -57,21 +57,6 @@ Qgs3DDebugWidget::Qgs3DDebugWidget( Qgs3DMapCanvas *canvas, QWidget *parent ) :
|
||||
mLookingX->setRange( std::numeric_limits<float>::lowest(), std::numeric_limits<float>::max() );
|
||||
mLookingY->setRange( std::numeric_limits<float>::lowest(), std::numeric_limits<float>::max() );
|
||||
mLookingZ->setRange( std::numeric_limits<float>::lowest(), std::numeric_limits<float>::max() );
|
||||
|
||||
// hide camera info on first render
|
||||
for ( QWidget *childWidget : mCameraInfoGroupBox->findChildren<QWidget *>() )
|
||||
{
|
||||
childWidget->setVisible( false );
|
||||
}
|
||||
|
||||
// hide or show camera info on toggle
|
||||
connect( mCameraInfoGroupBox, &QGroupBox::toggled, this, [ = ]( const bool enabled )
|
||||
{
|
||||
for ( QWidget *childWidget : mCameraInfoGroupBox->findChildren<QWidget *>() )
|
||||
{
|
||||
childWidget->setVisible( enabled );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -66,7 +66,7 @@ Qgs3DMapCanvasWidget::Qgs3DMapCanvasWidget( const QString &name, bool isDocked )
|
||||
const QgsSettings setting;
|
||||
|
||||
QToolBar *toolBar = new QToolBar( this );
|
||||
toolBar->setIconSize( QgisApp::instance()->iconSize( true ) );
|
||||
toolBar->setIconSize( QgisApp::instance()->iconSize( isDocked ) );
|
||||
|
||||
QAction *actionCameraControl = toolBar->addAction( QIcon( QgsApplication::iconPath( "mActionPan.svg" ) ),
|
||||
tr( "Camera Control" ), this, &Qgs3DMapCanvasWidget::cameraControl );
|
||||
@ -308,6 +308,19 @@ Qgs3DMapCanvasWidget::Qgs3DMapCanvasWidget( const QString &name, bool isDocked )
|
||||
|
||||
onTotalPendingJobsCountChanged();
|
||||
|
||||
QAction *toggleDebugPanel = toolBar->addAction(
|
||||
QgsApplication::getThemeIcon( QStringLiteral( "/propertyicons/general.svg" ) ),
|
||||
tr( "Toggle On-Screen Debug Information" ) );
|
||||
|
||||
toggleDebugPanel->setCheckable( true );
|
||||
toggleDebugPanel->setChecked(
|
||||
setting.value( QStringLiteral( "/3D/debugWidget/visibility" ), false, QgsSettings::Gui ).toBool()
|
||||
);
|
||||
toggleDebugWidget(
|
||||
setting.value( QStringLiteral( "/3D/debugWidget/visibility" ), false, QgsSettings::Gui ).toBool()
|
||||
);
|
||||
connect( toggleDebugPanel, &QAction::toggled, this, &Qgs3DMapCanvasWidget::toggleDebugWidget );
|
||||
|
||||
mDockableWidgetHelper = new QgsDockableWidgetHelper( isDocked, mCanvasName, this, QgisApp::instance() );
|
||||
if ( QDialog *dialog = mDockableWidgetHelper->dialog() )
|
||||
{
|
||||
@ -321,19 +334,10 @@ Qgs3DMapCanvasWidget::Qgs3DMapCanvasWidget( const QString &name, bool isDocked )
|
||||
{
|
||||
QgisApp::instance()->close3DMapView( canvasName() );
|
||||
} );
|
||||
|
||||
QAction *toggleDebugPanel = toolBar->addAction(
|
||||
QgsApplication::getThemeIcon( QStringLiteral( "/propertyicons/general.svg" ) ),
|
||||
tr( "Toggle On-Screen Debug Information" ) );
|
||||
|
||||
toggleDebugPanel->setCheckable( true );
|
||||
toggleDebugPanel->setChecked(
|
||||
setting.value( QStringLiteral( "/3D/debugWidget/visibility" ), false, QgsSettings::Gui ).toBool()
|
||||
);
|
||||
toggleDebugWidget(
|
||||
setting.value( QStringLiteral( "/3D/debugWidget/visibility" ), false, QgsSettings::Gui ).toBool()
|
||||
);
|
||||
connect( toggleDebugPanel, &QAction::toggled, this, &Qgs3DMapCanvasWidget::toggleDebugWidget );
|
||||
connect( dockAction, &QAction::toggled, this, [ = ]( const bool isSmallSize )
|
||||
{
|
||||
toolBar->setIconSize( QgisApp::instance()->iconSize( isSmallSize ) );
|
||||
} );
|
||||
}
|
||||
|
||||
Qgs3DMapCanvasWidget::~Qgs3DMapCanvasWidget()
|
||||
|
@ -44,9 +44,9 @@
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<y>-295</y>
|
||||
<width>250</width>
|
||||
<height>792</height>
|
||||
<height>790</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@ -214,7 +214,7 @@
|
||||
<string>Show camera info</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
|
Loading…
x
Reference in New Issue
Block a user