File tree Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -122,12 +122,25 @@ void DockedEditor::dockWidgetCloseRequested()
122
122
123
123
ads::CDockAreaWidget * DockedEditor::currentDockArea ()
124
124
{
125
- auto dockWidget = m_DockManager->focusedDockWidget ();
125
+ QMap<QString, ads::CDockWidget*> dockwidgets = m_DockManager->dockWidgetsMap ();
126
126
127
- if (dockWidget)
128
- return dockWidget->dockAreaWidget ();
129
- else
127
+ if (dockwidgets.size () == 0 ) {
130
128
return Q_NULLPTR;
129
+ }
130
+ else if (dockwidgets.size () == 1 ) {
131
+ // If no dockwidget has had the focus set yet, just return the only one
132
+ return dockwidgets.first ()->dockAreaWidget ();
133
+ }
134
+
135
+ // Search the list for the one that has had the focus set
136
+ foreach (ads::CDockWidget* dockWidget, dockwidgets) {
137
+ if (dockWidget->property (" focused" ).toBool ()) {
138
+ return dockWidget->dockAreaWidget ();
139
+ }
140
+ }
141
+
142
+ // There was no area that had the focus
143
+ return Q_NULLPTR;
131
144
}
132
145
133
146
void DockedEditor::addBuffer (ScintillaBuffer *buffer)
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ bool NotepadNextApplication::initGui()
73
73
{
74
74
qInfo (Q_FUNC_INFO);
75
75
76
- createNewWindow ();
76
+ createNewWindow ()-> openFile ( " C:/pickles.txt " ) ;
77
77
78
78
luabridge::getGlobalNamespace (luaState->L )
79
79
.beginNamespace (" nn" )
You can’t perform that action at this time.
0 commit comments