From 18764a345210ffce9fb75481e7ad38eb4bbb9785 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Thu, 28 Nov 2024 11:02:28 +1000 Subject: [PATCH] Use proper toolbar in documentation browser for consistency And show frame for web view --- .../qgsdocumentationpanelwidget.cpp | 11 +- src/ui/qgsdocumentationpanelbase.ui | 140 ++++++++---------- 2 files changed, 71 insertions(+), 80 deletions(-) diff --git a/src/app/devtools/documentation/qgsdocumentationpanelwidget.cpp b/src/app/devtools/documentation/qgsdocumentationpanelwidget.cpp index a638dade0e7..c531f5b8d14 100644 --- a/src/app/devtools/documentation/qgsdocumentationpanelwidget.cpp +++ b/src/app/devtools/documentation/qgsdocumentationpanelwidget.cpp @@ -16,6 +16,7 @@ #include "qgsdocumentationpanelwidget.h" #include "moc_qgsdocumentationpanelwidget.cpp" #include "qgisapp.h" +#include "qgsguiutils.h" #include #ifdef HAVE_WEBENGINE @@ -33,6 +34,9 @@ QgsDocumentationPanelWidget::QgsDocumentationPanelWidget( QWidget *parent ) : QgsDevToolWidget( parent ) { setupUi( this ); + + mToolbar->setIconSize( QgsGuiUtils::iconSize( true ) ); + #ifdef HAVE_WEBENGINE mWebView = new QWebEngineView( this ); #else @@ -41,10 +45,9 @@ QgsDocumentationPanelWidget::QgsDocumentationPanelWidget( QWidget *parent ) mWebViewContainer->layout()->addWidget( mWebView ); - connect( mPyQgisHomeButton, &QToolButton::clicked, this, [] {QgisApp::instance()->showApiDocumentation( Qgis::DocumentationApi::PyQgis, Qgis::DocumentationBrowser::DeveloperToolsPanel );} ); - connect( mQtHomeButton, &QToolButton::clicked, this, [] {QgisApp::instance()->showApiDocumentation( Qgis::DocumentationApi::Qt, Qgis::DocumentationBrowser::DeveloperToolsPanel );} ); - connect( mOpenUrlButton, &QToolButton::clicked, this, [this] {QgisApp::instance()->openURL( mWebView->url().toString(), false );} ); - + connect( mActionPyQgis, &QAction::triggered, this, [] {QgisApp::instance()->showApiDocumentation( Qgis::DocumentationApi::PyQgis, Qgis::DocumentationBrowser::DeveloperToolsPanel );} ); + connect( mActionQt, &QAction::triggered, this, [] {QgisApp::instance()->showApiDocumentation( Qgis::DocumentationApi::Qt, Qgis::DocumentationBrowser::DeveloperToolsPanel );} ); + connect( mActionOpenInBrowser, &QAction::triggered, this, [this] {QgisApp::instance()->openURL( mWebView->url().toString(), false );} ); } void QgsDocumentationPanelWidget::showUrl( const QUrl &url ) diff --git a/src/ui/qgsdocumentationpanelbase.ui b/src/ui/qgsdocumentationpanelbase.ui index 29b9642b625..3367d48a8d8 100644 --- a/src/ui/qgsdocumentationpanelbase.ui +++ b/src/ui/qgsdocumentationpanelbase.ui @@ -18,6 +18,9 @@ :/images/themes/default/mActionHelpContents.svg:/images/themes/default/mActionHelpContents.svg + + 0 + 0 @@ -31,90 +34,33 @@ 0 - - - - - PyQGIS API Documentation - - - - :/images/icons/qgis_icon.svg:/images/icons/qgis_icon.svg - - - - 24 - 24 - - - - true - - - - - - - Qt API Documentation - - - - :/images/themes/default/mIconQt.svg:/images/themes/default/mIconQt.svg - - - - 24 - 24 - - - - true - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Open in Web Browser - - - - :/images/themes/default/mIconWms.svg:/images/themes/default/mIconWms.svg - - - - 24 - 24 - - - - true - - - - + + + + 24 + 24 + + + + false + + + + + + - + 0 0 + + QFrame::StyledPanel + 0 @@ -132,6 +78,48 @@ + + + + :/images/icons/qgis_icon.svg:/images/icons/qgis_icon.svg + + + PyQGIS API Documentation + + + PyQGIS API Documentation + + + QAction::NoRole + + + + + + :/images/themes/default/mIconQt.svg:/images/themes/default/mIconQt.svg + + + Qt API Documentation + + + QAction::NoRole + + + + + + :/images/themes/default/mIconWms.svg:/images/themes/default/mIconWms.svg + + + Open in Web Browser + + + Open in Web Browser + + + QAction::NoRole + +