-
Notifications
You must be signed in to change notification settings - Fork 669
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
267d554
commit 156e465
Showing
25 changed files
with
314 additions
and
438 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Change: Rewrite of the spaces browser | ||
|
||
https://github.com/owncloud/client/pull/11595 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright (C) by Hannah von Reth <hannah.vonreth@owncloud.com> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* for more details. | ||
*/ | ||
|
||
#include "gui/qmlutils.h" | ||
|
||
#include "resources/resources.h" | ||
|
||
#include <QMessageBox> | ||
#include <QQuickWidget> | ||
|
||
void OCC::QmlUtils::initQuicWidget(QQuickWidget *widget, const QUrl &src) | ||
{ | ||
widget->engine()->addImageProvider(QStringLiteral("ownCloud"), new OCC::Resources::CoreImageProvider()); | ||
widget->setResizeMode(QQuickWidget::SizeRootObjectToView); | ||
widget->setSource(src); | ||
if (!widget->errors().isEmpty()) { | ||
auto box = new QMessageBox(QMessageBox::Critical, QStringLiteral("QML Error"), QDebug::toString(widget->errors())); | ||
box->setAttribute(Qt::WA_DeleteOnClose); | ||
box->exec(); | ||
qFatal("A qml error occured %s", qPrintable(QDebug::toString(widget->errors()))); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright (C) by Hannah von Reth <hannah.vonreth@owncloud.com> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* for more details. | ||
*/ | ||
|
||
#pragma once | ||
|
||
|
||
class QQuickWidget; | ||
class QUrl; | ||
|
||
namespace OCC::QmlUtils { | ||
|
||
void initQuicWidget(QQuickWidget *widget, const QUrl &src); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,24 @@ | ||
add_library(spaces | ||
STATIC | ||
add_library(ownCloudSpaces SHARED | ||
spacesmodel.cpp | ||
spacesdelegate.cpp | ||
spacesbrowser.cpp | ||
spacesbrowser.ui | ||
spaceimageprovider.cpp | ||
) | ||
target_link_libraries(spaces PUBLIC Qt::Widgets Qt::QuickWidgets libsync owncloudResources) | ||
set_target_properties(spaces PROPERTIES AUTOUIC ON AUTORCC ON) | ||
apply_common_target_settings(spaces) | ||
target_link_libraries(ownCloudSpaces PRIVATE Qt::Widgets Qt::QuickWidgets libsync owncloudResources qmlutils) | ||
set_target_properties(ownCloudSpaces PROPERTIES AUTOUIC ON AUTORCC ON) | ||
apply_common_target_settings(ownCloudSpaces) | ||
generate_export_header(ownCloudSpaces | ||
EXPORT_MACRO_NAME | ||
SPACES_EXPORT | ||
EXPORT_FILE_NAME spaceslib.h) | ||
|
||
ecm_add_qml_module(ownCloudSpaces | ||
URI org.ownCloud.gui.spaces | ||
VERSION 1.0 | ||
NAMESPACE OCC | ||
QML_FILES | ||
qml/SpaceDelegate.qml | ||
qml/SpacesView.qml | ||
) | ||
|
||
ecm_finalize_qml_module(ownCloudSpaces DESTINATION ${KDE_INSTALL_QMLDIR}) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
/* | ||
* Copyright (C) by Hannah von Reth <hannah.vonreth@owncloud.com> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* for more details. | ||
*/ | ||
|
||
import QtQuick | ||
import QtQuick.Controls | ||
import QtQuick.Layouts | ||
|
||
import org.ownCloud.gui 1.0 | ||
import org.ownCloud.libsync 1.0 | ||
|
||
Pane { | ||
// TODO: not cool | ||
readonly property real normalSize: 170 | ||
|
||
//property SpacesBrowser spacesBrowser | ||
|
||
ScrollView { | ||
id: scrollView | ||
anchors.fill: parent | ||
clip: true | ||
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff | ||
ScrollBar.vertical.policy: ScrollBar.AlwaysOn | ||
|
||
ListView { | ||
id: listView | ||
anchors.fill: parent | ||
spacing: 20 | ||
focus:true | ||
|
||
Component.onCompleted: { | ||
// clear the selection delayed, else the palette is messed up | ||
currentIndex = -1 | ||
} | ||
|
||
model: spacesBrowser.model | ||
onCurrentItemChanged: { | ||
spacesBrowser.currentSpace = currentItem ? currentItem.space : null | ||
} | ||
|
||
delegate: Pane { | ||
id: spaceDelegate | ||
|
||
required property int index | ||
|
||
required property string name | ||
required property string subtitle | ||
required property url imageUrl | ||
required property Space space | ||
|
||
clip: true | ||
width: ListView.view.width - scrollView.ScrollBar.vertical.width - 10 | ||
|
||
implicitHeight: normalSize | ||
background: Rectangle { | ||
color: spaceDelegate.ListView.isCurrentItem ? scrollView.palette.highlight : scrollView.palette.base | ||
} | ||
|
||
RowLayout { | ||
anchors.fill: parent | ||
|
||
spacing: 10 | ||
SpaceDelegate { | ||
Layout.fillWidth: true | ||
Layout.fillHeight: true | ||
|
||
title: spaceDelegate.name | ||
description: spaceDelegate.subtitle | ||
imageSource: spaceDelegate.imageUrl | ||
descriptionWrapMode: Label.WordWrap | ||
|
||
} | ||
} | ||
|
||
MouseArea { | ||
anchors.fill: parent | ||
onClicked: { | ||
spaceDelegate.ListView.view.currentIndex = spaceDelegate.index | ||
spaceDelegate.forceActiveFocus() | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.