Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Layout Page Properties action follow ups #58938

Merged
merged 2 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions src/app/layout/qgslayoutdesignerdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
mHorizontalRuler->setContextMenu( rulerMenu );
mVerticalRuler->setContextMenu( rulerMenu );

connect( mLayoutMenu, &QMenu::aboutToShow, this, &QgsLayoutDesignerDialog::layoutMenuAboutToShow );
connect( mActionRefreshView, &QAction::triggered, this, &QgsLayoutDesignerDialog::refreshLayout );
connect( mActionSaveProject, &QAction::triggered, this, &QgsLayoutDesignerDialog::saveProject );
connect( mActionNewLayout, &QAction::triggered, this, &QgsLayoutDesignerDialog::newLayout );
Expand Down Expand Up @@ -1924,9 +1925,10 @@ void QgsLayoutDesignerDialog::addPages()

void QgsLayoutDesignerDialog::showPageProperties()
{
QgsLayoutItemPage *page = mLayout->pageCollection()->page( 0 );
if ( !mLayout )
return;

if ( page )
if ( QgsLayoutItemPage *page = mLayout->pageCollection()->page( mView->currentPage() ) )
{
showItemOptions( page, true );
}
Expand Down Expand Up @@ -5138,3 +5140,15 @@ void QgsLayoutDesignerDialog::onItemDestroyed( QObject *item )
delete mItemPropertiesStack->takeMainPanel();
}
}

void QgsLayoutDesignerDialog::layoutMenuAboutToShow()
{
if ( mLayout && mLayout->pageCollection()->pageCount() > 1 )
{
mActionPageProperties->setText( tr( "Page %1 Properties…" ).arg( mView->currentPage() + 1 ) );
}
else
{
mActionPageProperties->setText( tr( "Page Properties…" ) );
}
}
1 change: 1 addition & 0 deletions src/app/layout/qgslayoutdesignerdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ class QgsLayoutDesignerDialog: public QMainWindow, public Ui::QgsLayoutDesignerB
void onMapPreviewRefreshed();
void onItemAdded( QgsLayoutItem *item );
void onItemDestroyed( QObject *item );
void layoutMenuAboutToShow();

private:

Expand Down
2 changes: 1 addition & 1 deletion src/ui/layout/qgslayoutpagepropertieswidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<item>
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::Box</enum>
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
Expand Down
Loading