Skip to content
Permalink
Browse files

Port ability to switch designer to full screen

  • Loading branch information
nyalldawson committed Jul 11, 2017
1 parent 76beef4 commit 1c8b17fea4926fad1310a5c27d242e5f0f6b6972
@@ -212,15 +212,11 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
connect( mVerticalRuler, &QgsLayoutRuler::cursorPosChanged, this, &QgsLayoutDesignerDialog::updateStatusCursorPos );

// Panel and toolbar submenus
QMenu *toolbarMenu = new QMenu( tr( "&Toolbars" ), this );
toolbarMenu->setObjectName( QStringLiteral( "mToolbarMenu" ) );
mMenuView->addSeparator();
mMenuView->addMenu( toolbarMenu );
mToolbarMenu->addAction( mLayoutToolbar->toggleViewAction() );
mToolbarMenu->addAction( mNavigationToolbar->toggleViewAction() );
mToolbarMenu->addAction( mToolsToolbar->toggleViewAction() );

// toolBar already exists, add other widgets as they are created
toolbarMenu->addAction( mLayoutToolbar->toggleViewAction() );
toolbarMenu->addAction( mNavigationToolbar->toggleViewAction() );
toolbarMenu->addAction( mToolsToolbar->toggleViewAction() );
connect( mActionToggleFullScreen, &QAction::toggled, this, &QgsLayoutDesignerDialog::toggleFullScreen );

restoreWindowState();
}
@@ -396,6 +392,18 @@ void QgsLayoutDesignerDialog::updateStatusCursorPos( QPointF position )
mStatusCursorPageLabel->setText( QString( tr( "page: %1" ) ).arg( currentPage ) );
}

void QgsLayoutDesignerDialog::toggleFullScreen( bool enabled )
{
if ( enabled )
{
showFullScreen();
}
else
{
showNormal();
}
}

QgsLayoutView *QgsLayoutDesignerDialog::view()
{
return mView;
@@ -130,6 +130,8 @@ class QgsLayoutDesignerDialog: public QMainWindow, private Ui::QgsLayoutDesigner
//! Updates cursor position in status bar
void updateStatusCursorPos( QPointF position );

void toggleFullScreen( bool enabled );

private:

QgsAppLayoutDesignerInterface *mInterface = nullptr;
@@ -99,15 +99,23 @@
</widget>
<widget class="QMenu" name="mMenuView">
<property name="title">
<string>View</string>
<string>&amp;View</string>
</property>
<widget class="QMenu" name="mToolbarMenu">
<property name="title">
<string>&amp;Toolbars</string>
</property>
</widget>
<addaction name="mActionZoomIn"/>
<addaction name="mActionZoomOut"/>
<addaction name="mActionZoomActual"/>
<addaction name="mActionZoomAll"/>
<addaction name="mActionZoomToWidth"/>
<addaction name="separator"/>
<addaction name="mActionShowRulers"/>
<addaction name="separator"/>
<addaction name="mToolbarMenu"/>
<addaction name="mActionToggleFullScreen"/>
</widget>
<addaction name="mLayoutMenu"/>
<addaction name="mMenuView"/>
@@ -269,6 +277,20 @@
<string>Ctrl+R</string>
</property>
</action>
<action name="mActionToggleFullScreen">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Toggle Full Scr&amp;een</string>
</property>
<property name="toolTip">
<string>Toggle full screen mode</string>
</property>
<property name="shortcut">
<string>F11</string>
</property>
</action>
</widget>
<resources>
<include location="../../../images/images.qrc"/>

0 comments on commit 1c8b17f

Please sign in to comment.
You can’t perform that action at this time.