Skip to content

Commit

Permalink
Ensure that the Spaces list has focus in the Add Space wizard
Browse files Browse the repository at this point in the history
And that the list is also tab-focusable.
  • Loading branch information
erikjv authored and TheOneRing committed Aug 30, 2024
1 parent 8532b3a commit 319126e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/gui/folderwizard/spacespage.ui
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::FocusPolicy::StrongFocus</enum>
</property>
<property name="accessibleName">
<string>Spaces list</string>
</property>
Expand Down
6 changes: 3 additions & 3 deletions src/gui/spaces/spacesbrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#include "gui/accountmanager.h"
#include "gui/spaces/spaceimageprovider.h"
#include "resources/resources.h"

#include <QMenu>
#include <QQmlContext>
Expand All @@ -45,15 +44,16 @@ SpacesBrowser::SpacesBrowser(QWidget *parent)
, ui(new Ui::SpacesBrowser)
{
ui->setupUi(this);
_model = new SpacesModel(this);


_model = new SpacesModel(this);
_sortModel = new SpaceFilter(this);
_sortModel->setSourceModel(_model);
_sortModel->setSortRole(static_cast<int>(SpacesModel::Roles::Priority));
_sortModel->sort(0, Qt::DescendingOrder);

QmlUtils::initQuickWidget(ui->quickWidget, QUrl(QStringLiteral("qrc:/qt/qml/org/ownCloud/gui/spaces/qml/SpacesView.qml")), this);

setFocusProxy(ui->quickWidget);
}

SpacesBrowser::~SpacesBrowser()
Expand Down
6 changes: 5 additions & 1 deletion src/gui/spaces/spacesbrowser.ui
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@
<number>0</number>
</property>
<item>
<widget class="OCC::QmlUtils::OCQuickWidget" name="quickWidget" native="true"/>
<widget class="OCC::QmlUtils::OCQuickWidget" name="quickWidget" native="true">
<property name="focusPolicy">
<enum>Qt::FocusPolicy::StrongFocus</enum>
</property>
</widget>
</item>
</layout>
</widget>
Expand Down

0 comments on commit 319126e

Please sign in to comment.