Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Manage Collectibles panel UI component & model #12671

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions storybook/pages/ManageCollectiblesPanelPage.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15

import StatusQ 0.1
import StatusQ.Core 0.1

import AppLayouts.Wallet.panels 1.0

import utils 1.0

import Storybook 1.0
import Models 1.0

SplitView {
id: root

Logs { id: logs }

orientation: Qt.Horizontal

ManageCollectiblesModel {
id: collectiblesModel
}

StatusScrollView { // wrapped in a ScrollView on purpose; to simulate SettingsContentBase.qml
SplitView.fillWidth: true
SplitView.fillHeight: true
ManageCollectiblesPanel {
id: showcasePanel
width: 500
baseModel: ctrlEmptyModel.checked ? null : collectiblesModel
}
}

LogsAndControlsPanel {
id: logsAndControlsPanel

SplitView.minimumWidth: 150
SplitView.preferredWidth: 250

logsView.logText: logs.logText

ColumnLayout {
Label {
Layout.fillWidth: true
text: "Dirty: %1".arg(showcasePanel.dirty ? "true" : "false")
}

Button {
text: "Save"
onClicked: showcasePanel.saveSettings()
}

Button {
enabled: showcasePanel.dirty
text: "Revert"
onClicked: showcasePanel.revert()
}

Button {
enabled: false
text: "Random data (TODO)"
onClicked: {
collectiblesModel.clear()
collectiblesModel.randomizeData()
}
}

Button {
text: "Clear settings"
onClicked: showcasePanel.clearSettings()
}

Switch {
id: ctrlEmptyModel
text: "Empty model"
}
}
}
}

// category: Panels
// https://www.figma.com/file/idUoxN7OIW2Jpp3PMJ1Rl8/%E2%9A%99%EF%B8%8F-Settings-%7C-Desktop?type=design&node-id=19341-250476&mode=design&t=jR53lJ7aDzVHE4hZ-0
// https://www.figma.com/file/idUoxN7OIW2Jpp3PMJ1Rl8/%E2%9A%99%EF%B8%8F-Settings-%7C-Desktop?type=design&node-id=19655-204534&mode=design&t=jR53lJ7aDzVHE4hZ-0
// https://www.figma.com/file/idUoxN7OIW2Jpp3PMJ1Rl8/%E2%9A%99%EF%B8%8F-Settings-%7C-Desktop?type=design&node-id=19622-173583&mode=design&t=jR53lJ7aDzVHE4hZ-0
// https://www.figma.com/file/idUoxN7OIW2Jpp3PMJ1Rl8/%E2%9A%99%EF%B8%8F-Settings-%7C-Desktop?type=design&node-id=19622-179146&mode=design&t=jR53lJ7aDzVHE4hZ-0
5 changes: 4 additions & 1 deletion storybook/qmlTests/main.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <QtQuickTest/quicktest.h>
#include <QQmlEngine>
#include <QtQuickTest>

#include "src/TextUtils.h"

class Setup : public QObject
Expand All @@ -21,6 +22,8 @@ public slots:
engine->addImportPath(path);

qmlRegisterSingletonType<TextUtils>("TextUtils", 1, 0, "TextUtils", &TextUtils::qmlInstance);

QStandardPaths::setTestModeEnabled(true);
Copy link
Member Author

@caybro caybro Nov 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want to overwrite user's actual settings :)

}
};

Expand Down
Loading