File tree 3 files changed +13
-7
lines changed
3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 1
1
/* **************************************************************************
2
- qgswindowmanagerinterface .cpp
3
- -----------------------------
2
+ qgsappwindowmanager .cpp
3
+ -----------------------
4
4
Date : September 2018
5
5
Copyright : (C) 2018 Nyall Dawson
6
6
Email : nyall dot dawson at gmail dot com
@@ -59,8 +59,8 @@ QWidget *QgsAppWindowManager::openApplicationDialog( QgsAppWindowManager::Applic
59
59
}
60
60
mLayoutManagerDialog ->show ();
61
61
mLayoutManagerDialog ->activate ();
62
+ return mLayoutManagerDialog ;
62
63
}
63
- return nullptr ;
64
64
}
65
65
return nullptr ;
66
66
}
Original file line number Diff line number Diff line change 1
1
/* **************************************************************************
2
- qgswindowmanagerinterface .h
3
- ---------------------------
2
+ qgsappwindowmanager .h
3
+ ---------------------
4
4
Date : September 2018
5
5
Copyright : (C) 2018 Nyall Dawson
6
6
Email : nyall dot dawson at gmail dot com
Original file line number Diff line number Diff line change @@ -397,8 +397,14 @@ void QgsSymbolsListWidget::updateModelFilters()
397
397
void QgsSymbolsListWidget::openStyleManager ()
398
398
{
399
399
// prefer to use global window manager to open the style manager, if possible!
400
- // this allows reuse of an existing non-modal window instead of opening a new modal window
401
- if ( !QgsGui::windowManager () || !QgsGui::windowManager ()->openStandardDialog ( QgsWindowManagerInterface::DialogStyleManager ) )
400
+ // this allows reuse of an existing non-modal window instead of opening a new modal window.
401
+ // Note that we only use the non-modal dialog if we're open in the panel -- if we're already
402
+ // open as part of a modal dialog, then we MUST use another modal dialog or the result will
403
+ // not be focusable!
404
+ QgsPanelWidget *panel = QgsPanelWidget::findParentPanel ( this );
405
+ if ( !panel || !panel->dockMode ()
406
+ || !QgsGui::windowManager ()
407
+ || !QgsGui::windowManager ()->openStandardDialog ( QgsWindowManagerInterface::DialogStyleManager ) )
402
408
{
403
409
// fallback to modal dialog
404
410
QgsStyleManagerDialog dlg ( mStyle , this );
You can’t perform that action at this time.
0 commit comments