Commit 8f07fa73 authored by Christoph Cullmann's avatar Christoph Cullmann

improve focus handling of project plugin

terminals still don't want to get focus :/
CCBUG: 407495
parent c0fdfbc4
......@@ -166,6 +166,8 @@ KateConsole::~KateConsole ()
void KateConsole::loadConsoleIfNeeded()
{
setFocusProxy(nullptr);
if (m_part) return;
if (!window() || !parentWidget()) return;
......
......@@ -70,6 +70,7 @@ void KateProjectInfoViewTerminal::loadTerminal()
* null in any case, if loadTerminal fails below and we are in the destroyed event
*/
m_konsolePart = nullptr;
setFocusProxy(nullptr);
/**
* we shall not arrive here without a factory, if it is not there, no terminal toolview shall be created
......
......@@ -184,7 +184,6 @@ QPair<KateProjectView *, KateProjectInfoView *> KateProjectPluginView::viewForPr
*/
m_stackedProjectViews->addWidget(view);
m_stackedProjectInfoViews->addWidget(infoView);
m_stackedProjectInfoViews->setFocusProxy(infoView);
m_projectsCombo->addItem(QIcon::fromTheme(QStringLiteral("project-open")), project->name(), project->fileName());
/**
......@@ -310,22 +309,22 @@ void KateProjectPluginView::slotViewChanged()
void KateProjectPluginView::slotCurrentChanged(int index)
{
/**
* trigger change of stacked widgets
*/
// trigger change of stacked widgets
m_stackedProjectViews->setCurrentIndex(index);
m_stackedProjectInfoViews->setCurrentIndex(index);
/**
* open currently selected document
*/
// update focus proxy + open currently selected document
if (QWidget *current = m_stackedProjectViews->currentWidget()) {
m_stackedProjectViews->setFocusProxy(current);
static_cast<KateProjectView *>(current)->openSelectedDocument();
}
/**
* project file name might have changed
*/
// update focus proxy
if (QWidget *current = m_stackedProjectInfoViews->currentWidget()) {
m_stackedProjectInfoViews->setFocusProxy(current);
}
// project file name might have changed
emit projectFileNameChanged();
emit projectMapChanged();
}
......
......@@ -48,6 +48,9 @@ KateProjectView::KateProjectView(KateProjectPluginView *pluginView, KateProject
layout->addWidget(m_filter);
setLayout(layout);
// let tree get focus for keyboard selection of file to open
setFocusProxy(m_treeView);
/**
* setup filter line edit
*/
......
......@@ -43,6 +43,8 @@ KateProjectViewTree::KateProjectViewTree(KateProjectPluginView *pluginView, Kate
*/
setHeaderHidden(true);
setEditTriggers(QAbstractItemView::NoEditTriggers);
setAllColumnsShowFocus(true);
setFocusPolicy(Qt::NoFocus);
/**
* attach view => project
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment