From eb6152cb8a2d539a3e2c135b60be8bbf9ff1e5c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D0=B0=D0=BD=D0=B8=D1=81=D0=BB=D0=B0=D0=B2=20?= =?UTF-8?q?=D0=A5=D0=BE=D0=B7=D1=8F=D0=B5=D0=BD=D0=BE=D0=BA?= Date: Wed, 21 May 2025 11:00:07 +0700 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=BA=D0=B0=D1=81=D1=82=D0=BE=D0=BC=D0=BD=D1=8B=D0=B9?= =?UTF-8?q?=20=D0=B4=D0=B8=D0=B0=D0=BB=D0=BE=D0=B3=20=D0=BF=D1=80=D0=B8=20?= =?UTF-8?q?=D0=BF=D0=B5=D1=80=D0=B5=D1=85=D0=BE=D0=B4=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ArrDifferentTypes.cpp | 1 + quickupdater.h => ArrDifferentTypes.h | 10 +- CMakeLists.txt | 7 +- FigmaQmlNames.h | 1 + FigmaStyles.h | 14 + IPageActivity.h | 4 + Main.qml | 9 +- callbackwrapper.h | 8 +- dynamicloader.cpp | 25 ++ dynamicloader.h | 1 + figmaadapter.cpp | 121 ++++-- figmaadapter.h | 14 +- interfaces/IPageActivity.h | 12 + main.cpp | 21 +- mainpageactivity.cpp | 38 +- mainpageactivity.h | 9 +- models/settingspagemodel.cpp | 17 + models/settingspagemodel.h | 29 ++ ...a.qml => ColumnaItemComponent27_figma.qml} | 0 .../qml/FileComponent20_figma.qml | 2 +- .../qml/FolderComponent19_figma.qml | 2 +- .../qml/HeaderValueComponent27_figma.qml | 64 ++++ ...3_figma.qml => InputComponent27_figma.qml} | 8 - ...2_figma.qml => LabelComponent20_figma.qml} | 0 ...qml => LabelHeaderComponentH122_figma.qml} | 0 .../LabelHeaderComponentH2_bold45_figma.qml | 64 ++++ .../qml/LabelHeaderComponentH353_figma.qml | 64 ++++ ...qml => LabelHeaderComponentH354_figma.qml} | 0 .../qml/ProgressBarComponent24_figma.qml | 23 -- ..._134_figma.qml => Rectangle_128_figma.qml} | 0 ...TestPage_ColumnCenter_transform1_figma.qml | 10 +- ...stPage_ColumnCenter_translating1_figma.qml | 10 +- ...TestPage_HeaderValueComponent29_figma.qml} | 12 +- ...ml => TestPage_InputComponent29_figma.qml} | 2 +- ...ge_LabelHeaderComponentH2_bold49_figma.qml | 14 + ...estPage_LabelHeaderComponentH357_figma.qml | 14 + .../qml/TestPage_MainPage2_figma.qml | 4 +- .../qml/TestPage_MainWindow2_figma.qml | 357 +++++++++++------- .../qml/TestPage_ProjectPage2_figma.qml | 4 +- .../qml/TestPage_SettingsPage2_figma.qml | 322 +++++++++------- qml/SaveChangesDialog.qml | 85 +++++ quickhelper.cpp | 214 +++++++---- quickhelper.h | 13 +- quickupdater.cpp | 1 - settingspageactivity.cpp | 212 ++++++++++- settingspageactivity.h | 20 +- 46 files changed, 1371 insertions(+), 491 deletions(-) create mode 100644 ArrDifferentTypes.cpp rename quickupdater.h => ArrDifferentTypes.h (82%) create mode 100644 FigmaStyles.h create mode 100644 IPageActivity.h create mode 100644 interfaces/IPageActivity.h create mode 100644 models/settingspagemodel.cpp create mode 100644 models/settingspagemodel.h rename pages/FigmaQmlInterface/qml/{ColumnaItemComponent32_figma.qml => ColumnaItemComponent27_figma.qml} (100%) create mode 100644 pages/FigmaQmlInterface/qml/HeaderValueComponent27_figma.qml rename pages/FigmaQmlInterface/qml/{InputComponent33_figma.qml => InputComponent27_figma.qml} (97%) rename pages/FigmaQmlInterface/qml/{LabelComponent22_figma.qml => LabelComponent20_figma.qml} (100%) rename pages/FigmaQmlInterface/qml/{LabelHeaderComponentH123_figma.qml => LabelHeaderComponentH122_figma.qml} (100%) create mode 100644 pages/FigmaQmlInterface/qml/LabelHeaderComponentH2_bold45_figma.qml create mode 100644 pages/FigmaQmlInterface/qml/LabelHeaderComponentH353_figma.qml rename pages/FigmaQmlInterface/qml/{LabelHeaderComponentH330_figma.qml => LabelHeaderComponentH354_figma.qml} (100%) delete mode 100644 pages/FigmaQmlInterface/qml/ProgressBarComponent24_figma.qml rename pages/FigmaQmlInterface/qml/{Rectangle_134_figma.qml => Rectangle_128_figma.qml} (100%) rename pages/FigmaQmlInterface/qml/{HeaderValueComponent28_figma.qml => TestPage_HeaderValueComponent29_figma.qml} (65%) rename pages/FigmaQmlInterface/qml/{TestPage_InputComponent35_figma.qml => TestPage_InputComponent29_figma.qml} (92%) create mode 100644 pages/FigmaQmlInterface/qml/TestPage_LabelHeaderComponentH2_bold49_figma.qml create mode 100644 pages/FigmaQmlInterface/qml/TestPage_LabelHeaderComponentH357_figma.qml create mode 100644 qml/SaveChangesDialog.qml delete mode 100644 quickupdater.cpp diff --git a/ArrDifferentTypes.cpp b/ArrDifferentTypes.cpp new file mode 100644 index 0000000..20a95af --- /dev/null +++ b/ArrDifferentTypes.cpp @@ -0,0 +1 @@ +#include "ArrDifferentTypes.h" diff --git a/quickupdater.h b/ArrDifferentTypes.h similarity index 82% rename from quickupdater.h rename to ArrDifferentTypes.h index 30ce7ca..01c69a1 100644 --- a/quickupdater.h +++ b/ArrDifferentTypes.h @@ -1,5 +1,5 @@ -#ifndef QUICKUPDATER_H -#define QUICKUPDATER_H +#ifndef ARRDIFFERENTTYPES_H +#define ARRDIFFERENTTYPES_H #include #include @@ -16,7 +16,9 @@ class ArrDifferentTypes : public QObject public: explicit ArrDifferentTypes(QObject *parent = nullptr) : QObject(parent) {} - + ~ArrDifferentTypes() override { + qDebug() << "ArrDifferentTypes object is being destroyed:" << this; + } QList getArrDifferentTypes() const { return arrDifferentTypes; } void setArrDifferentTypes(const QList &arr) { if (arrDifferentTypes != arr) { @@ -38,4 +40,4 @@ private: QList arrDifferentTypes; }; -#endif // QUICKUPDATER_H +#endif // ARRDIFFERENTTYPES_H diff --git a/CMakeLists.txt b/CMakeLists.txt index 96b73ba..fede981 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,7 +36,12 @@ qt_add_qml_module(appQtQuckApp SOURCES FigmaQmlNames.h SOURCES settingsrepository.h settingsrepository.cpp SOURCES settingspageactivity.h settingspageactivity.cpp - SOURCES quickupdater.h quickupdater.cpp + SOURCES ArrDifferentTypes.h ArrDifferentTypes.cpp + SOURCES FigmaStyles.h + QML_FILES qml/SaveChangesDialog.qml + SOURCES interfaces/IPageActivity.h + SOURCES + SOURCES models/settingspagemodel.h models/settingspagemodel.cpp ) # Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1. diff --git a/FigmaQmlNames.h b/FigmaQmlNames.h index 3138901..29dd54d 100644 --- a/FigmaQmlNames.h +++ b/FigmaQmlNames.h @@ -1,5 +1,6 @@ #ifndef FIGMAQMLNAMES_H #define FIGMAQMLNAMES_H + namespace QML{ namespace Windows{ constexpr const char * MAIN= "pages/FigmaQmlInterface/qml/TestPage_MainWindow2_figma.qml"; diff --git a/FigmaStyles.h b/FigmaStyles.h new file mode 100644 index 0000000..747e05d --- /dev/null +++ b/FigmaStyles.h @@ -0,0 +1,14 @@ +#ifndef FIGMASTYLES_H +#define FIGMASTYLES_H +#include "QColor" + +namespace QML { + const QColor CORLOR_MENU_ITEM_SELECTED(qRgb(222,222,222)); + const QColor CORLOR_MENU_ITEM_BASE(qRgba(255,255,255,0)); + + + const QColor CORLOR_BUTTON_DISABLED(qRgb(252,251,252)); + const QColor CORLOR_BUTTON_BASE(qRgb(139,110,245)); + const QColor CORLOR_BUTTON_FOCUSED(qRgb(161,140,238)); +} +#endif // FIGMASTYLES_H diff --git a/IPageActivity.h b/IPageActivity.h new file mode 100644 index 0000000..9d03147 --- /dev/null +++ b/IPageActivity.h @@ -0,0 +1,4 @@ +#ifndef IPAGEACTIVITY_H +#define IPAGEACTIVITY_H + +#endif // IPAGEACTIVITY_H diff --git a/Main.qml b/Main.qml index 0ea6633..5d0e229 100644 --- a/Main.qml +++ b/Main.qml @@ -3,13 +3,16 @@ import QtQuick.Controls import QtQuick.Window import FigmaQmlInterface -Window { +ApplicationWindow { id: rootWindow width: 1600 height: 900 visible: true - // flags: Qt.Window | Qt.FramelessWindowHint // Убираем рамку и заголовок - //flags: Qt.Window | Qt.MSWindowsFixedSizeDialogHint + minimumWidth: width // Фиксированная ширина + maximumWidth: width + minimumHeight: height + maximumHeight: height + flags: Qt.Window | Qt.WindowTitleHint | Qt.WindowCloseButtonHint | Qt.WindowMinimizeButtonHint color: "transparent" // Прозрачный фон (если нужно) title: "Заголовок" // Пустой заголовок diff --git a/callbackwrapper.h b/callbackwrapper.h index a0e2a39..1dc2c43 100644 --- a/callbackwrapper.h +++ b/callbackwrapper.h @@ -6,21 +6,21 @@ class CallbackWrapper : public QObject { Q_OBJECT - Q_PROPERTY(QString name READ name WRITE setName FINAL) + // Q_PROPERTY(QString name READ name WRITE setName FINAL) QML_ELEMENT public: explicit CallbackWrapper(std::function callback, QObject* parent = nullptr) : QObject(parent), m_callback(std::move(callback)) {} - QString name() const {return m_name;} - void setName(const QString &name) {m_name = name;} + // QString name() const {return m_name;} + // void setName(const QString &name) {m_name = name;} Q_INVOKABLE void invoke() { if (m_callback) m_callback(); } private: - QString m_name; + // QString m_name; std::function m_callback; }; #endif // CALLBACKWRAPPER_H diff --git a/dynamicloader.cpp b/dynamicloader.cpp index d8ed341..731cd4f 100644 --- a/dynamicloader.cpp +++ b/dynamicloader.cpp @@ -10,6 +10,7 @@ void DynamicLoader::createComponent(const QString& qmlFile, QQuickItem* parentIt QQmlComponent component(m_engine, QUrl(qmlFile)); if (component.isError()) { + qDebug()<<"Error create component:" << component.errorString(); emit errorOccurred(component.errorString()); return; } @@ -38,3 +39,27 @@ void DynamicLoader::createComponent(const QString& qmlFile, QQuickItem* parentIt } emit componentCreated(item); } + +void DynamicLoader::createComponentObject(const QString& qmlFile, QObject **createdComponent) +{ + QQmlComponent component(m_engine, QUrl(qmlFile)); + + if (component.isError()) { + qDebug()<<"Error create component:" << component.errorString(); + emit errorOccurred(component.errorString()); + return; + } + + QObject* object = component.create(); + if (!object) { + emit errorOccurred("Failed to create object"); + return; + } + + // object->setParent(parentItem); + + if (createdComponent) { + *createdComponent = object; + } + // emit componentCreated(object); +} diff --git a/dynamicloader.h b/dynamicloader.h index a363138..263ed36 100644 --- a/dynamicloader.h +++ b/dynamicloader.h @@ -13,6 +13,7 @@ public: Q_INVOKABLE void createComponent(const QString& qmlFile, QQuickItem* parentItem, QQuickItem **createdComponent = 0); + void createComponentObject(const QString &qmlFile, QObject **createdComponent); signals: void componentCreated(QQuickItem* item); void errorOccurred(const QString& message); diff --git a/figmaadapter.cpp b/figmaadapter.cpp index b82c6aa..d638515 100644 --- a/figmaadapter.cpp +++ b/figmaadapter.cpp @@ -14,6 +14,7 @@ #include "mainpagepresentor.h" #include "settingspageactivity.h" #include "settingsrepository.h" +#include "FigmaStyles.h" const char * HOME_ITEM = "HomeItem"; const char * PROJECT_ITEM = "ProjectsItem"; @@ -29,16 +30,43 @@ FigmaAdapter::FigmaAdapter(void * figmaQtInstance, QQmlApplicationEngine &engine loader = new DynamicLoader(&engine,this); connect(loader,&DynamicLoader::componentCreated, this, &FigmaAdapter::componentCreated); connect(loader,&DynamicLoader::errorOccurred, this, &FigmaAdapter::errorOccurred); + saveSettingClickCallback = [this]{saveSettingClick();}; } void FigmaAdapter::Init() { QObject *rootObject = engine.rootObjects().first(); - updateElement(rootObject, HOME_ITEM, QuickHelper::addMouseArea, [this] {homeItemClick();}); - updateElement(rootObject, PROJECT_ITEM, QuickHelper::addMouseArea, [this] {projectsItemClick();}); - updateElement(rootObject, SETTINGS_ITEM, QuickHelper::addMouseArea, [this] {settingsItemClick();}); - updateElement(rootObject, CLOSE_ITEM, QuickHelper::addMouseArea, [this] {closeItemClick();}); + updateElement(rootObject, HOME_ITEM, [this](QObject* rootObject, std::function onClickAction){ + QuickHelper::addMouseAreaElements(rootObject, + [this]{ homeItemClick();}, + [this,rootObject]{headerEntered((QQuickItem*)rootObject);}, + [this,rootObject]{headerExited((QQuickItem*)rootObject);} + ); + },0); + + updateElement(rootObject, PROJECT_ITEM, [this](QObject* rootObject, std::function onClickAction){ + QuickHelper::addMouseAreaElements(rootObject, + [this]{ projectsItemClick();}, + [this,rootObject]{headerEntered((QQuickItem*)rootObject);}, + [this,rootObject]{headerExited((QQuickItem*)rootObject);} + ); + },0); + updateElement(rootObject, SETTINGS_ITEM, [this](QObject* rootObject, std::function onClickAction){ + QuickHelper::addMouseAreaElements(rootObject, + [this]{ settingsItemClick();}, + [this,rootObject]{headerEntered((QQuickItem*)rootObject);}, + [this,rootObject]{headerExited((QQuickItem*)rootObject);} + ); + },0); + + updateElement(rootObject, CLOSE_ITEM, [this](QObject* rootObject, std::function onClickAction){ + QuickHelper::addMouseAreaElements(rootObject, + [this]{ closeItemClick();}, + [this,rootObject]{headerEntered((QQuickItem*)rootObject);}, + [this,rootObject]{headerExited((QQuickItem*)rootObject);} + ); + },0); labelAvailibleSizeButton = QuickHelper::getQuickItem(rootObject, LABEL_AVAILIBLE_SIZE); rectAvailibleSize = QuickHelper::getQuickItem(rootObject, RECT_AVAILIBLE_SIZE_BAR); @@ -72,7 +100,8 @@ void FigmaAdapter::homeItemClick() MainPageActivity * mainPageActivity = 0; if (rootObject && mainViewItem) { - mainPageActivity = new MainPageActivity(mainViewItem,mainPage); + mainPageActivity = new MainPageActivity(mainViewItem,mainPage); + activity = mainPageActivity; } MainPagePresentor *presentor = new MainPagePresentor(mainPageActivity, mainPage); @@ -101,7 +130,8 @@ void FigmaAdapter::settingsItemClick() SettingsPageActivity * settingsPageActivity = 0; if (rootObject && mainViewItem) { - settingsPageActivity = new SettingsPageActivity(mainViewItem, settingsPage); + settingsPageActivity = new SettingsPageActivity(mainViewItem,saveSettingClickCallback, settingsPage); + activity = settingsPageActivity; } } @@ -117,9 +147,11 @@ void FigmaAdapter::loadPage(const QString& pageName) QString page = DEFAULT_PAGE_PATH + pageName; - auto updateFunc = [this, page](QObject* rootObject, std::function){ - - QQuickItem* parentItem = qobject_cast(rootObject); + auto updateFunc = [this, page](QObject* rootObject, std::function) { + // std::function d; + // doActionOnSuccess + doActionOnSuccessAllowChangePaged = [this, rootObject,page]{ + QQuickItem* parentItem = qobject_cast(rootObject); Helper::clearChildren(parentItem); @@ -129,12 +161,29 @@ void FigmaAdapter::loadPage(const QString& pageName) } QQmlEngine* engine = qmlEngine(rootObject); + if (!engine) { qWarning() << "[C++] Failed to get QQmlEngine"; return; } - loader->createComponent(page , parentItem); + QQuickItem *createdComponent = 0; + loader->createComponent(page , parentItem, &createdComponent); + + if (createdComponent) { + if (activity) { + activity->pageChanged(); + activity = 0; + } + } + }; + + doActionOnBlockAllowChangePaged = []{}; + if (activity) { + activity->isAllowChangePage(doActionOnSuccessAllowChangePaged,doActionOnBlockAllowChangePaged); + } else { + doActionOnSuccessAllowChangePaged(); + } }; updateElement(rootObject,"MainView", updateFunc, 0); @@ -159,42 +208,54 @@ quint64 getFreeDiskSpace(const QString &path) return storage.bytesAvailable(); // свободное место в байтах } -// #include -// #include + void FigmaAdapter::updateStorageInfo() { QString path = SettingsRepository::instance().defaultProjectDirectory(); if (path == ""){ if (componentLabelAvailibleSize) { componentLabelAvailibleSize->setVisible(false); + + + + QuickHelper::addMouseAreaElements(componentLabelAvailibleSize->parent(), + [this]{settingsItemClick();}, + [this]{headerEntered((QQuickItem*)componentLabelAvailibleSize->parent());}, + [this]{headerExited((QQuickItem*)componentLabelAvailibleSize->parent());} + ); } if (rectAvailibleSize){ rectAvailibleSize->setVisible(false); } - if (labelAvailibleSizeButton) { - labelAvailibleSizeButton->setProperty("text", "Хранилище не задано"); - const QMetaObject *metaObject = labelAvailibleSizeButton->metaObject(); - int enumIndex = metaObject->indexOfEnumerator("FontSizeMode"); - QMetaEnum metaEnum = metaObject->enumerator(enumIndex); - // Получаем числовое значение нужного enum - int horizontalFitValue = metaEnum.keyToValue("HorizontalFit"); - // Устанавливаем свойство fontSizeMode - labelAvailibleSizeButton->setProperty("fontSizeMode", horizontalFitValue); + if (rectPassedBar){ + rectPassedBar->setVisible(false); } + if (labelAvailibleSizeButton) { + labelAvailibleSizeButton->setProperty("text", "Хранилище не задано"); + QuickHelper::setPorpetryEnumerator( + labelAvailibleSizeButton,"FontSizeMode", "fontSizeMode", "HorizontalFit" + ); + } return; } quint64 freeBytes = getFreeDiskSpace(path); - QString numberFormat = QString::number(freeBytes / (1024 * 1024 * 1024),'g', 2); + QString numberFormat = QString::number(freeBytes / (1024.0 * 1024.0 * 1024.0), 'f', 2); + if (labelAvailibleSizeButton) { labelAvailibleSizeButton->setProperty("text", numberFormat + " Гб"); } } +void FigmaAdapter::saveSettingClick() +{ + qDebug()<< "FigmaAdapter::saveSettingClick"; +} + void FigmaAdapter::eventReceived(const QString &element, const QString &event) { qDebug() << "event: "<< event << " element: " << element; @@ -210,6 +271,21 @@ void FigmaAdapter::errorOccurred(const QString &message) qDebug()<< message; } + +void FigmaAdapter::headerEntered(QQuickItem *item) +{ + if (item->isEnabled()) { + item->setProperty("color", QML::CORLOR_MENU_ITEM_SELECTED); + } +} + +void FigmaAdapter::headerExited(QQuickItem *item) +{ + if (item->isEnabled()) { + item->setProperty("color", QML::CORLOR_MENU_ITEM_BASE); + } +} + void FigmaAdapter::Helper::clearChildren(QQuickItem *parentItem) { const auto children = parentItem->children(); @@ -219,6 +295,7 @@ void FigmaAdapter::Helper::clearChildren(QQuickItem *parentItem) for (QObject* child : children) { if (QQuickItem* item = qobject_cast(child)) { item->setParentItem(nullptr); + item->setParent(nullptr); item->deleteLater(); } } diff --git a/figmaadapter.h b/figmaadapter.h index 1eee89e..96ce158 100644 --- a/figmaadapter.h +++ b/figmaadapter.h @@ -3,6 +3,7 @@ #include #include +#include "interfaces/IPageActivity.h" class DynamicLoader; class QQuickItem; @@ -15,6 +16,9 @@ class FigmaAdapter : public QObject private: void * figmaAdapter; QQmlApplicationEngine &engine; + std::function saveSettingClickCallback; + std::function doActionOnSuccessAllowChangePaged; + std::function doActionOnBlockAllowChangePaged; public: explicit FigmaAdapter(void * figmaQtInstance, QQmlApplicationEngine &engine, QObject *parent = nullptr); @@ -29,8 +33,6 @@ private: std::function onClick ); - // void addMouseAreaWithClickAction(QObject *rootObject, std::function onClickAction); - // handler clicks void homeItemClick(); void projectsItemClick(); @@ -38,6 +40,8 @@ private: void closeItemClick(); void loadPage(const QString& pageName); void updateStorageInfo(); + + void saveSettingClick(); class Helper { public: static void clearChildren(QQuickItem* parentItem); @@ -61,13 +65,17 @@ private: const QString MAIN_PAGE = "TestPage_MainPage2_figma.qml"; const QString SETTINS_PAGE = "TestPage_SettingsPage2_figma.qml"; const QString PROJECTS_PAGE = "TestPage_ProjectPage2_figma.qml"; + +private: + IPageActivity *activity = 0; public slots: void eventReceived(const QString& element, const QString& event); private slots: void componentCreated(QQuickItem* item); void errorOccurred(const QString& message); - + void headerEntered(QQuickItem*item); + void headerExited(QQuickItem*item); }; diff --git a/interfaces/IPageActivity.h b/interfaces/IPageActivity.h new file mode 100644 index 0000000..881fe49 --- /dev/null +++ b/interfaces/IPageActivity.h @@ -0,0 +1,12 @@ +#ifndef IPAGEACTIVITY_H +#define IPAGEACTIVITY_H + +#include + +class IPageActivity { +public: + virtual void pageChanged() = 0; + virtual void isAllowChangePage(const std::function &continueChange, const std::function &blockChange) = 0; +}; + +#endif // IPAGEACTIVITY_H diff --git a/main.cpp b/main.cpp index d5a3280..bf562f8 100644 --- a/main.cpp +++ b/main.cpp @@ -6,38 +6,39 @@ #include "FigmaQmlInterface.hpp" +QQmlApplicationEngine *engine=0; int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); + engine = new QQmlApplicationEngine(); // QApplication app(argc, argv); - QQmlApplicationEngine engine; QObject::connect( - &engine, + engine, &QQmlApplicationEngine::objectCreationFailed, &app, []() { QCoreApplication::exit(-1); }, Qt::QueuedConnection); - FigmaQmlInterface::registerFigmaQmlSingleton(engine); + FigmaQmlInterface::registerFigmaQmlSingleton(*engine); - for (const auto &path : engine.importPathList()) { + for (const auto &path : engine->importPathList()) { qDebug() << " - " << path; } - engine.addImportPath("qrc:/"); - engine.addImportPath(QCoreApplication::applicationDirPath() + "/qml"); - engine.addImportPath(QCoreApplication::applicationDirPath() + "/qml"); + engine->addImportPath("qrc:/"); + engine->addImportPath(QCoreApplication::applicationDirPath() + "/qml"); + engine->addImportPath(QCoreApplication::applicationDirPath() + "/qml"); - FigmaQmlSingleton * instance = FigmaQmlSingleton::instance(engine); + FigmaQmlSingleton * instance = FigmaQmlSingleton::instance(*engine); FigmaAdapter * figmaAdapter = 0; if (instance) { - figmaAdapter = new FigmaAdapter(instance, engine); + figmaAdapter = new FigmaAdapter(instance, *engine); } qDebug() << "Before"; - engine.loadFromModule("QtQuckApp", "Main"); + engine->loadFromModule("QtQuckApp", "Main"); if (figmaAdapter) { figmaAdapter->Init(); diff --git a/mainpageactivity.cpp b/mainpageactivity.cpp index 0db28ee..891005c 100644 --- a/mainpageactivity.cpp +++ b/mainpageactivity.cpp @@ -8,6 +8,7 @@ #include "dynamicloader.h" #include #include +#include "FigmaStyles.h" MainPageActivity::MainPageActivity(QQuickItem * item, QObject *parent) : QObject{parent}, root(item) @@ -34,6 +35,11 @@ void MainPageActivity::setProjectName(QString name) projectNameTextField->setProperty("text",name); } +void MainPageActivity::pageChanged() +{ + +} + bool MainPageActivity::isVariablesSet(){ bool ret_code = false; // Флаг ошибки @@ -99,12 +105,34 @@ void MainPageActivity::init() { void MainPageActivity::setInitialView() { listFilesItem = 0; loader->createComponent("QtQuckApp/qml/ScrollableTextList.qml", columnLeft, &listFilesItem); - QuickHelper::addMouseArea(buttonChooseFiles,[this] {handleChooseFiles();}); + + QuickHelper::addMouseAreaElements(buttonChooseFiles, + [this] {handleChooseFiles();}, + [this]{buttonEntered(buttonChooseFiles);}, + [this]{buttonExited(buttonChooseFiles);}); + setColumnCenteTranslate(); setDefaultValues(); blockTranslate(); } +void MainPageActivity::buttonEntered(QQuickItem * item){ + if (item->isEnabled()) { + item->setProperty("color", QML::CORLOR_BUTTON_FOCUSED); + } +} + +void MainPageActivity::buttonExited(QQuickItem * item){ + if (item->isEnabled()) { + item->setProperty("color", QML::CORLOR_BUTTON_BASE); + } +} + +void MainPageActivity::isAllowChangePage(const std::function &continueChange, const std::function &blockChange) +{ + continueChange(); +} + void MainPageActivity::setDefaultValues() { if (projectNameTextField){ @@ -132,12 +160,16 @@ void MainPageActivity::setColumnCenteTranslate(){ } if (transformButton) { - QuickHelper::addMouseArea(transformButton,[this]{translateClick();}); + QuickHelper::addMouseAreaElements(transformButton, + [this] {handleChooseFiles();}, + [this]{buttonEntered(transformButton);}, + [this]{buttonExited(transformButton);}); + auto defaultColor = transformButton->property("color").toString(); //auto newColor = "enabled ? \" + defaultColor + \" : \"black\"";//lightgray // auto newColor = "enabled ? \" + lightblue + \" : \"black\"";//lightgray // transformButton->setProperty("color",newColor); - QuickHelper::updateColor(transformButton, qRgb(255,0,0),qRgb(0,255,0)); + QuickHelper::updateColor(transformButton, QML::CORLOR_BUTTON_DISABLED, QML::CORLOR_BUTTON_BASE); } if (projectNameTextField) { diff --git a/mainpageactivity.h b/mainpageactivity.h index 2cb69aa..6b99aa0 100644 --- a/mainpageactivity.h +++ b/mainpageactivity.h @@ -2,18 +2,20 @@ #define MAINPAGEACTIVITY_H #include +#include "interfaces/IPageActivity.h" class QQuickItem; class DynamicLoader; class QQmlEngine; -class MainPageActivity : public QObject +class MainPageActivity : public QObject, public IPageActivity { Q_OBJECT public: explicit MainPageActivity(QQuickItem * item, QObject *parent = nullptr); void setProjectName(QString name); + void pageChanged() override final; private: QQuickItem * root; @@ -21,6 +23,7 @@ private: QQmlEngine * engine; + const QString BUTTON_CHOOSE_FILES = "ButtonChooseFiles"; QQuickItem * buttonChooseFiles = 0; @@ -63,6 +66,8 @@ private: void setColumnCenteTranslate(); + void buttonEntered(QQuickItem *item); + void buttonExited(QQuickItem *item); public: QQuickItem* getButtonChooseFiles() const { return buttonChooseFiles; } QQuickItem* getContentMainPageTransform() const { return contentMainPageTransform; } @@ -73,6 +78,8 @@ public: QQuickItem* getTransformButton() const { return transformButton; } QQuickItem* getProjectNameTextField() const { return projectNameTextField; } + void isAllowChangePage(const std::function &continueChange, const std::function &blockChange) override final; + public slots: void listFilePathSet(QVariant); private slots: diff --git a/models/settingspagemodel.cpp b/models/settingspagemodel.cpp new file mode 100644 index 0000000..860d843 --- /dev/null +++ b/models/settingspagemodel.cpp @@ -0,0 +1,17 @@ +#include "settingspagemodel.h" + +SettingsPageModel::SettingsPageModel(QObject *parent) + : QObject{parent} +{} + +SettingsPageModel::~SettingsPageModel(){ + qDebug() << "SettingsPageModel destryoed " << this; +} + +QString SettingsPageModel::projectPath() const {return m_projectPath;} + +void SettingsPageModel::setProjectPath(const QString &projectPath) {m_projectPath = projectPath;} + +QString SettingsPageModel::remoteAddressUri() const {return m_remoteAddressUri;} + +void SettingsPageModel::setRemoteAddressUri(const QString &projectPath) {m_remoteAddressUri = projectPath;} diff --git a/models/settingspagemodel.h b/models/settingspagemodel.h new file mode 100644 index 0000000..4f805af --- /dev/null +++ b/models/settingspagemodel.h @@ -0,0 +1,29 @@ +#ifndef SETTINGSPAGEMODEL_H +#define SETTINGSPAGEMODEL_H + +#include +#include + +class SettingsPageModel : public QObject +{ + Q_OBJECT + Q_PROPERTY(QString projectPath READ projectPath WRITE setProjectPath FINAL) + Q_PROPERTY(QString remoteAddressUri READ remoteAddressUri WRITE setRemoteAddressUri FINAL) + QML_ELEMENT + +public: + explicit SettingsPageModel(QObject *parent = nullptr); + ~SettingsPageModel() override; + QString projectPath() const; + void setProjectPath(const QString &projectPath); + + QString remoteAddressUri() const; + void setRemoteAddressUri(const QString &projectPath); + +private: + QString m_projectPath = ""; + QString m_remoteAddressUri = ""; +signals: +}; + +#endif // SETTINGSPAGEMODEL_H diff --git a/pages/FigmaQmlInterface/qml/ColumnaItemComponent32_figma.qml b/pages/FigmaQmlInterface/qml/ColumnaItemComponent27_figma.qml similarity index 100% rename from pages/FigmaQmlInterface/qml/ColumnaItemComponent32_figma.qml rename to pages/FigmaQmlInterface/qml/ColumnaItemComponent27_figma.qml diff --git a/pages/FigmaQmlInterface/qml/FileComponent20_figma.qml b/pages/FigmaQmlInterface/qml/FileComponent20_figma.qml index 91dadac..eed8d70 100644 --- a/pages/FigmaQmlInterface/qml/FileComponent20_figma.qml +++ b/pages/FigmaQmlInterface/qml/FileComponent20_figma.qml @@ -85,7 +85,7 @@ Rectangle { onDelegate_98_58_widthChanged: {if(i_delegate_98_58 && i_delegate_98_58.width != delegate_98_58_width) i_delegate_98_58.width = delegate_98_58_width;} property real delegate_98_58_height: NaN onDelegate_98_58_heightChanged: {if(i_delegate_98_58 && i_delegate_98_58.height != delegate_98_58_height) i_delegate_98_58.height = delegate_98_58_height;} - property Component delegate_98_59: LabelHeaderComponentH2_bold20_figma { + property Component delegate_98_59: LabelHeaderComponentH2_bold46_figma { // component (Instance) level: 0 LabelHeaderComponentH2-bold id: figma_98_59 // # "LabelHeaderComponentH2-bold" diff --git a/pages/FigmaQmlInterface/qml/FolderComponent19_figma.qml b/pages/FigmaQmlInterface/qml/FolderComponent19_figma.qml index c8b0506..d805496 100644 --- a/pages/FigmaQmlInterface/qml/FolderComponent19_figma.qml +++ b/pages/FigmaQmlInterface/qml/FolderComponent19_figma.qml @@ -85,7 +85,7 @@ Rectangle { onDelegate_98_55_widthChanged: {if(i_delegate_98_55 && i_delegate_98_55.width != delegate_98_55_width) i_delegate_98_55.width = delegate_98_55_width;} property real delegate_98_55_height: NaN onDelegate_98_55_heightChanged: {if(i_delegate_98_55 && i_delegate_98_55.height != delegate_98_55_height) i_delegate_98_55.height = delegate_98_55_height;} - property Component delegate_98_56: LabelHeaderComponentH2_bold20_figma { + property Component delegate_98_56: LabelHeaderComponentH2_bold46_figma { // component (Instance) level: 0 LabelHeaderComponentH2-bold id: figma_98_56 // # "LabelHeaderComponentH2-bold" diff --git a/pages/FigmaQmlInterface/qml/HeaderValueComponent27_figma.qml b/pages/FigmaQmlInterface/qml/HeaderValueComponent27_figma.qml new file mode 100644 index 0000000..2eca189 --- /dev/null +++ b/pages/FigmaQmlInterface/qml/HeaderValueComponent27_figma.qml @@ -0,0 +1,64 @@ +//Generated by FigmaQML 3.2.1 + +import QtQuick +import QtQuick.Effects +import QtQuick.Shapes +import QtQuick.Controls +import QtQuick.Shapes +import FigmaQmlInterface +Rectangle { +// component (Instance) level: 0 HeaderValueComponent + id: figma_269_178 + // # "HeaderValueComponent" + objectName:"HeaderValueComponent" + x:0 + y:0 + width:54 + height:13 + color:"#00ffffff" + clip: false + property Component delegate_269_179: Text { + // component (Instance) level: 0 Label + id: figma_269_179 + // # "Label" + objectName:"Label" + x:0 + y:0 + width:54 + height:13 + color:"#ff7d7e82" + wrapMode: TextEdit.WordWrap + text:"Свободно" + font.family: "Tahoma" + font.italic: false + font.letterSpacing: 0 + font.pixelSize: 11 + font.weight: Font.Normal + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignTop + } + property Item i_delegate_269_179 + property matrix4x4 delegate_269_179_transform: Qt.matrix4x4(Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,) + onDelegate_269_179_transformChanged: {if(i_delegate_269_179 && i_delegate_269_179.transform != delegate_269_179_transform) i_delegate_269_179.transform = delegate_269_179_transform;} + property real delegate_269_179_x: NaN + onDelegate_269_179_xChanged: {if(i_delegate_269_179 && i_delegate_269_179.x != delegate_269_179_x) i_delegate_269_179.x = delegate_269_179_x;} + property real delegate_269_179_y: NaN + onDelegate_269_179_yChanged: {if(i_delegate_269_179 && i_delegate_269_179.y != delegate_269_179_y) i_delegate_269_179.y = delegate_269_179_y;} + property real delegate_269_179_width: NaN + onDelegate_269_179_widthChanged: {if(i_delegate_269_179 && i_delegate_269_179.width != delegate_269_179_width) i_delegate_269_179.width = delegate_269_179_width;} + property real delegate_269_179_height: NaN + onDelegate_269_179_heightChanged: {if(i_delegate_269_179 && i_delegate_269_179.height != delegate_269_179_height) i_delegate_269_179.height = delegate_269_179_height;} + Component.onCompleted: { + const o_delegate_269_179 = {} + if(!isNaN(delegate_269_179_transform.m11)) o_delegate_269_179['transform'] = delegate_269_179_transform; + if(!isNaN(delegate_269_179_x)) o_delegate_269_179['x'] = delegate_269_179_x; + if(!isNaN(delegate_269_179_y)) o_delegate_269_179['y'] = delegate_269_179_y; + if(!isNaN(delegate_269_179_width)) o_delegate_269_179['width'] = delegate_269_179_width; + if(!isNaN(delegate_269_179_height)) o_delegate_269_179['height'] = delegate_269_179_height; + i_delegate_269_179 = delegate_269_179.createObject(this, o_delegate_269_179) + delegate_269_179_x = Qt.binding(()=>i_delegate_269_179.x) + delegate_269_179_y = Qt.binding(()=>i_delegate_269_179.y) + delegate_269_179_width = Qt.binding(()=>i_delegate_269_179.width) + delegate_269_179_height = Qt.binding(()=>i_delegate_269_179.height) + } +} diff --git a/pages/FigmaQmlInterface/qml/InputComponent33_figma.qml b/pages/FigmaQmlInterface/qml/InputComponent27_figma.qml similarity index 97% rename from pages/FigmaQmlInterface/qml/InputComponent33_figma.qml rename to pages/FigmaQmlInterface/qml/InputComponent27_figma.qml index c59e207..f5c48cf 100644 --- a/pages/FigmaQmlInterface/qml/InputComponent33_figma.qml +++ b/pages/FigmaQmlInterface/qml/InputComponent27_figma.qml @@ -73,7 +73,6 @@ PathLine { x: 226; y: 0 } PathLine { x: 226; y: -0.5 } PathLine { x: 5; y: -0.5 } PathLine { x: 5; y: 0 } -PathLine { x: 5; y: 0 } PathMove { x: 231; y: 5 } PathLine { x: 230.5; y: 5 } PathLine { x: 230.5; y: 18 } @@ -81,7 +80,6 @@ PathLine { x: 231; y: 18 } PathLine { x: 231.5; y: 18 } PathLine { x: 231.5; y: 5 } PathLine { x: 231; y: 5 } -PathLine { x: 231; y: 5 } PathMove { x: 226; y: 23 } PathLine { x: 226; y: 22.5 } PathLine { x: 5; y: 22.5 } @@ -89,7 +87,6 @@ PathLine { x: 5; y: 23 } PathLine { x: 5; y: 23.5 } PathLine { x: 226; y: 23.5 } PathLine { x: 226; y: 23 } -PathLine { x: 226; y: 23 } PathMove { x: 0; y: 18 } PathLine { x: 0.5; y: 18 } PathLine { x: 0.5; y: 5 } @@ -97,7 +94,6 @@ PathLine { x: 0; y: 5 } PathLine { x: -0.5; y: 5 } PathLine { x: -0.5; y: 18 } PathLine { x: 0; y: 18 } -PathLine { x: 0; y: 18 } PathMove { x: 5; y: 23 } PathLine { x: 5; y: 22.5 } PathCubic { control1X: 2.51472; control1Y: 22.5; control2X: 0.5; control2Y: 20.4853; x: 0.5; y: 18 } @@ -105,7 +101,6 @@ PathLine { x: 0; y: 18 } PathLine { x: -0.5; y: 18 } PathCubic { control1X: -0.5; control1Y: 21.0376; control2X: 1.96243; control2Y: 23.5; x: 5; y: 23.5 } PathLine { x: 5; y: 23 } -PathLine { x: 5; y: 23 } PathMove { x: 231; y: 18 } PathLine { x: 230.5; y: 18 } PathCubic { control1X: 230.5; control1Y: 20.4853; control2X: 228.485; control2Y: 22.5; x: 226; y: 22.5 } @@ -113,7 +108,6 @@ PathLine { x: 226; y: 23 } PathLine { x: 226; y: 23.5 } PathCubic { control1X: 229.038; control1Y: 23.5; control2X: 231.5; control2Y: 21.0376; x: 231.5; y: 18 } PathLine { x: 231; y: 18 } -PathLine { x: 231; y: 18 } PathMove { x: 226; y: 0 } PathLine { x: 226; y: 0.5 } PathCubic { control1X: 228.485; control1Y: 0.5; control2X: 230.5; control2Y: 2.51472; x: 230.5; y: 5 } @@ -121,7 +115,6 @@ PathLine { x: 231; y: 5 } PathLine { x: 231.5; y: 5 } PathCubic { control1X: 231.5; control1Y: 1.96243; control2X: 229.038; control2Y: -0.5; x: 226; y: -0.5 } PathLine { x: 226; y: 0 } -PathLine { x: 226; y: 0 } PathMove { x: 5; y: 0 } PathLine { x: 5; y: -0.5 } PathCubic { control1X: 1.96243; control1Y: -0.5; control2X: -0.5; control2Y: 1.96243; x: -0.5; y: 5 } @@ -129,7 +122,6 @@ PathLine { x: 0; y: 5 } PathLine { x: 0.5; y: 5 } PathCubic { control1X: 0.5; control1Y: 2.51472; control2X: 2.51472; control2Y: 0.5; x: 5; y: 0.5 } PathLine { x: 5; y: 0 } -PathLine { x: 5; y: 0 } }} TextField { // component (Instance) level: 0 TextField diff --git a/pages/FigmaQmlInterface/qml/LabelComponent22_figma.qml b/pages/FigmaQmlInterface/qml/LabelComponent20_figma.qml similarity index 100% rename from pages/FigmaQmlInterface/qml/LabelComponent22_figma.qml rename to pages/FigmaQmlInterface/qml/LabelComponent20_figma.qml diff --git a/pages/FigmaQmlInterface/qml/LabelHeaderComponentH123_figma.qml b/pages/FigmaQmlInterface/qml/LabelHeaderComponentH122_figma.qml similarity index 100% rename from pages/FigmaQmlInterface/qml/LabelHeaderComponentH123_figma.qml rename to pages/FigmaQmlInterface/qml/LabelHeaderComponentH122_figma.qml diff --git a/pages/FigmaQmlInterface/qml/LabelHeaderComponentH2_bold45_figma.qml b/pages/FigmaQmlInterface/qml/LabelHeaderComponentH2_bold45_figma.qml new file mode 100644 index 0000000..da0baa2 --- /dev/null +++ b/pages/FigmaQmlInterface/qml/LabelHeaderComponentH2_bold45_figma.qml @@ -0,0 +1,64 @@ +//Generated by FigmaQML 3.2.1 + +import QtQuick +import QtQuick.Effects +import QtQuick.Shapes +import QtQuick.Controls +import QtQuick.Shapes +import FigmaQmlInterface +Rectangle { +// component (Instance) level: 0 LabelHeaderComponentH2-bold + id: figma_269_147 + // # "LabelHeaderComponentH2-bold" + objectName:"LabelHeaderComponentH2-bold" + x:0 + y:0 + width:171 + height:31 + color:"#00ffffff" + clip: false + property Component delegate_269_148: Text { + // component (Instance) level: 0 Label + id: figma_269_148 + // # "Label" + objectName:"Label" + x:0 + y:0 + width:171 + height:31 + color:"#ff000000" + wrapMode: TextEdit.WordWrap + text:"Информация" + font.family: "Tahoma" + font.italic: false + font.letterSpacing: 0 + font.pixelSize: 26 + font.weight: Font.DemiBold + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignTop + } + property Item i_delegate_269_148 + property matrix4x4 delegate_269_148_transform: Qt.matrix4x4(Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,) + onDelegate_269_148_transformChanged: {if(i_delegate_269_148 && i_delegate_269_148.transform != delegate_269_148_transform) i_delegate_269_148.transform = delegate_269_148_transform;} + property real delegate_269_148_x: NaN + onDelegate_269_148_xChanged: {if(i_delegate_269_148 && i_delegate_269_148.x != delegate_269_148_x) i_delegate_269_148.x = delegate_269_148_x;} + property real delegate_269_148_y: NaN + onDelegate_269_148_yChanged: {if(i_delegate_269_148 && i_delegate_269_148.y != delegate_269_148_y) i_delegate_269_148.y = delegate_269_148_y;} + property real delegate_269_148_width: NaN + onDelegate_269_148_widthChanged: {if(i_delegate_269_148 && i_delegate_269_148.width != delegate_269_148_width) i_delegate_269_148.width = delegate_269_148_width;} + property real delegate_269_148_height: NaN + onDelegate_269_148_heightChanged: {if(i_delegate_269_148 && i_delegate_269_148.height != delegate_269_148_height) i_delegate_269_148.height = delegate_269_148_height;} + Component.onCompleted: { + const o_delegate_269_148 = {} + if(!isNaN(delegate_269_148_transform.m11)) o_delegate_269_148['transform'] = delegate_269_148_transform; + if(!isNaN(delegate_269_148_x)) o_delegate_269_148['x'] = delegate_269_148_x; + if(!isNaN(delegate_269_148_y)) o_delegate_269_148['y'] = delegate_269_148_y; + if(!isNaN(delegate_269_148_width)) o_delegate_269_148['width'] = delegate_269_148_width; + if(!isNaN(delegate_269_148_height)) o_delegate_269_148['height'] = delegate_269_148_height; + i_delegate_269_148 = delegate_269_148.createObject(this, o_delegate_269_148) + delegate_269_148_x = Qt.binding(()=>i_delegate_269_148.x) + delegate_269_148_y = Qt.binding(()=>i_delegate_269_148.y) + delegate_269_148_width = Qt.binding(()=>i_delegate_269_148.width) + delegate_269_148_height = Qt.binding(()=>i_delegate_269_148.height) + } +} diff --git a/pages/FigmaQmlInterface/qml/LabelHeaderComponentH353_figma.qml b/pages/FigmaQmlInterface/qml/LabelHeaderComponentH353_figma.qml new file mode 100644 index 0000000..f88243b --- /dev/null +++ b/pages/FigmaQmlInterface/qml/LabelHeaderComponentH353_figma.qml @@ -0,0 +1,64 @@ +//Generated by FigmaQML 3.2.1 + +import QtQuick +import QtQuick.Effects +import QtQuick.Shapes +import QtQuick.Controls +import QtQuick.Shapes +import FigmaQmlInterface +Rectangle { +// component (Instance) level: 0 LabelHeaderComponentH3 + id: figma_269_166 + // # "LabelHeaderComponentH3" + objectName:"LabelHeaderComponentH3" + x:0 + y:0 + width:110 + height:20 + color:"#00ffffff" + clip: false + property Component delegate_269_167: Text { + // component (Instance) level: 0 Label + id: figma_269_167 + // # "Label" + objectName:"Label" + x:0 + y:0 + width:110 + height:20 + color:"#ff000000" + wrapMode: TextEdit.WordWrap + text:"Информация" + font.family: "Tahoma" + font.italic: false + font.letterSpacing: 0 + font.pixelSize: 16 + font.weight: Font.DemiBold + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignTop + } + property Item i_delegate_269_167 + property matrix4x4 delegate_269_167_transform: Qt.matrix4x4(Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,Nan,) + onDelegate_269_167_transformChanged: {if(i_delegate_269_167 && i_delegate_269_167.transform != delegate_269_167_transform) i_delegate_269_167.transform = delegate_269_167_transform;} + property real delegate_269_167_x: NaN + onDelegate_269_167_xChanged: {if(i_delegate_269_167 && i_delegate_269_167.x != delegate_269_167_x) i_delegate_269_167.x = delegate_269_167_x;} + property real delegate_269_167_y: NaN + onDelegate_269_167_yChanged: {if(i_delegate_269_167 && i_delegate_269_167.y != delegate_269_167_y) i_delegate_269_167.y = delegate_269_167_y;} + property real delegate_269_167_width: NaN + onDelegate_269_167_widthChanged: {if(i_delegate_269_167 && i_delegate_269_167.width != delegate_269_167_width) i_delegate_269_167.width = delegate_269_167_width;} + property real delegate_269_167_height: NaN + onDelegate_269_167_heightChanged: {if(i_delegate_269_167 && i_delegate_269_167.height != delegate_269_167_height) i_delegate_269_167.height = delegate_269_167_height;} + Component.onCompleted: { + const o_delegate_269_167 = {} + if(!isNaN(delegate_269_167_transform.m11)) o_delegate_269_167['transform'] = delegate_269_167_transform; + if(!isNaN(delegate_269_167_x)) o_delegate_269_167['x'] = delegate_269_167_x; + if(!isNaN(delegate_269_167_y)) o_delegate_269_167['y'] = delegate_269_167_y; + if(!isNaN(delegate_269_167_width)) o_delegate_269_167['width'] = delegate_269_167_width; + if(!isNaN(delegate_269_167_height)) o_delegate_269_167['height'] = delegate_269_167_height; + i_delegate_269_167 = delegate_269_167.createObject(this, o_delegate_269_167) + delegate_269_167_x = Qt.binding(()=>i_delegate_269_167.x) + delegate_269_167_y = Qt.binding(()=>i_delegate_269_167.y) + delegate_269_167_width = Qt.binding(()=>i_delegate_269_167.width) + delegate_269_167_height = Qt.binding(()=>i_delegate_269_167.height) + } +} diff --git a/pages/FigmaQmlInterface/qml/LabelHeaderComponentH330_figma.qml b/pages/FigmaQmlInterface/qml/LabelHeaderComponentH354_figma.qml similarity index 100% rename from pages/FigmaQmlInterface/qml/LabelHeaderComponentH330_figma.qml rename to pages/FigmaQmlInterface/qml/LabelHeaderComponentH354_figma.qml diff --git a/pages/FigmaQmlInterface/qml/ProgressBarComponent24_figma.qml b/pages/FigmaQmlInterface/qml/ProgressBarComponent24_figma.qml deleted file mode 100644 index 6b0e2bf..0000000 --- a/pages/FigmaQmlInterface/qml/ProgressBarComponent24_figma.qml +++ /dev/null @@ -1,23 +0,0 @@ -//Generated by FigmaQML 3.2.1 - -import QtQuick -import QtQuick.Effects -import QtQuick.Shapes -import QtQuick.Controls -import QtQuick.Shapes -import FigmaQmlInterface -Rectangle { -// component (Instance) level: 0 ProgressBarComponent - id: figma_94_16 - // # "ProgressBarComponent" - objectName:"ProgressBarComponent" - x:0 - y:0 - width:209 - height:10 - color: "transparent" - radius:5 - clip: true - Component.onCompleted: { - } -} diff --git a/pages/FigmaQmlInterface/qml/Rectangle_134_figma.qml b/pages/FigmaQmlInterface/qml/Rectangle_128_figma.qml similarity index 100% rename from pages/FigmaQmlInterface/qml/Rectangle_134_figma.qml rename to pages/FigmaQmlInterface/qml/Rectangle_128_figma.qml diff --git a/pages/FigmaQmlInterface/qml/TestPage_ColumnCenter_transform1_figma.qml b/pages/FigmaQmlInterface/qml/TestPage_ColumnCenter_transform1_figma.qml index 31af164..a1f6a30 100644 --- a/pages/FigmaQmlInterface/qml/TestPage_ColumnCenter_transform1_figma.qml +++ b/pages/FigmaQmlInterface/qml/TestPage_ColumnCenter_transform1_figma.qml @@ -120,7 +120,7 @@ Rectangle { verticalAlignment: Text.AlignTop } } - InputComponent33_figma { + InputComponent27_figma { // component (Instance) level: 0 InputComponent id: figma_219_169 // # "InputComponent" @@ -172,7 +172,6 @@ PathLine { x: 226; y: 0 } PathLine { x: 226; y: -0.5 } PathLine { x: 5; y: -0.5 } PathLine { x: 5; y: 0 } -PathLine { x: 5; y: 0 } PathMove { x: 231; y: 5 } PathLine { x: 230.5; y: 5 } PathLine { x: 230.5; y: 18 } @@ -180,7 +179,6 @@ PathLine { x: 231; y: 18 } PathLine { x: 231.5; y: 18 } PathLine { x: 231.5; y: 5 } PathLine { x: 231; y: 5 } -PathLine { x: 231; y: 5 } PathMove { x: 226; y: 23 } PathLine { x: 226; y: 22.5 } PathLine { x: 5; y: 22.5 } @@ -188,7 +186,6 @@ PathLine { x: 5; y: 23 } PathLine { x: 5; y: 23.5 } PathLine { x: 226; y: 23.5 } PathLine { x: 226; y: 23 } -PathLine { x: 226; y: 23 } PathMove { x: 0; y: 18 } PathLine { x: 0.5; y: 18 } PathLine { x: 0.5; y: 5 } @@ -196,7 +193,6 @@ PathLine { x: 0; y: 5 } PathLine { x: -0.5; y: 5 } PathLine { x: -0.5; y: 18 } PathLine { x: 0; y: 18 } -PathLine { x: 0; y: 18 } PathMove { x: 5; y: 23 } PathLine { x: 5; y: 22.5 } PathCubic { control1X: 2.51472; control1Y: 22.5; control2X: 0.5; control2Y: 20.4853; x: 0.5; y: 18 } @@ -204,7 +200,6 @@ PathLine { x: 0; y: 18 } PathLine { x: -0.5; y: 18 } PathCubic { control1X: -0.5; control1Y: 21.0376; control2X: 1.96243; control2Y: 23.5; x: 5; y: 23.5 } PathLine { x: 5; y: 23 } -PathLine { x: 5; y: 23 } PathMove { x: 231; y: 18 } PathLine { x: 230.5; y: 18 } PathCubic { control1X: 230.5; control1Y: 20.4853; control2X: 228.485; control2Y: 22.5; x: 226; y: 22.5 } @@ -212,7 +207,6 @@ PathLine { x: 226; y: 23 } PathLine { x: 226; y: 23.5 } PathCubic { control1X: 229.038; control1Y: 23.5; control2X: 231.5; control2Y: 21.0376; x: 231.5; y: 18 } PathLine { x: 231; y: 18 } -PathLine { x: 231; y: 18 } PathMove { x: 226; y: 0 } PathLine { x: 226; y: 0.5 } PathCubic { control1X: 228.485; control1Y: 0.5; control2X: 230.5; control2Y: 2.51472; x: 230.5; y: 5 } @@ -220,7 +214,6 @@ PathLine { x: 231; y: 5 } PathLine { x: 231.5; y: 5 } PathCubic { control1X: 231.5; control1Y: 1.96243; control2X: 229.038; control2Y: -0.5; x: 226; y: -0.5 } PathLine { x: 226; y: 0 } -PathLine { x: 226; y: 0 } PathMove { x: 5; y: 0 } PathLine { x: 5; y: -0.5 } PathCubic { control1X: 1.96243; control1Y: -0.5; control2X: -0.5; control2Y: 1.96243; x: -0.5; y: 5 } @@ -228,7 +221,6 @@ PathLine { x: 0; y: 5 } PathLine { x: 0.5; y: 5 } PathCubic { control1X: 0.5; control1Y: 2.51472; control2X: 2.51472; control2Y: 0.5; x: 5; y: 0.5 } PathLine { x: 5; y: 0 } -PathLine { x: 5; y: 0 } }} TextField { // component (Instance) level: 1 ProjectTextField diff --git a/pages/FigmaQmlInterface/qml/TestPage_ColumnCenter_translating1_figma.qml b/pages/FigmaQmlInterface/qml/TestPage_ColumnCenter_translating1_figma.qml index 459b9ce..c7ef1c3 100644 --- a/pages/FigmaQmlInterface/qml/TestPage_ColumnCenter_translating1_figma.qml +++ b/pages/FigmaQmlInterface/qml/TestPage_ColumnCenter_translating1_figma.qml @@ -18,7 +18,7 @@ Rectangle { color: "transparent" clip: true - LabelComponent22_figma { + LabelComponent20_figma { // component (Instance) level: 0 ProgressTransformLabelItem id: figma_94_98 // # "ProgressTransformLabelItem" @@ -68,25 +68,21 @@ PathLine { x: 0; y: -2 } PathLine { x: -2; y: -2 } PathLine { x: -2; y: 0 } PathLine { x: 0; y: 0 } -PathLine { x: 0; y: 0 } PathMove { x: 249; y: 0 } PathLine { x: 251; y: 0 } PathLine { x: 251; y: -2 } PathLine { x: 249; y: -2 } PathLine { x: 249; y: 0 } -PathLine { x: 249; y: 0 } PathMove { x: 249; y: 22 } PathLine { x: 249; y: 24 } PathLine { x: 251; y: 24 } PathLine { x: 251; y: 22 } PathLine { x: 249; y: 22 } -PathLine { x: 249; y: 22 } PathMove { x: 0; y: 22 } PathLine { x: -2; y: 22 } PathLine { x: -2; y: 24 } PathLine { x: 0; y: 24 } PathLine { x: 0; y: 22 } -PathLine { x: 0; y: 22 } PathMove { x: 0; y: 0 } PathLine { x: 0; y: 2 } PathLine { x: 249; y: 2 } @@ -94,7 +90,6 @@ PathLine { x: 249; y: 0 } PathLine { x: 249; y: -2 } PathLine { x: 0; y: -2 } PathLine { x: 0; y: 0 } -PathLine { x: 0; y: 0 } PathMove { x: 249; y: 0 } PathLine { x: 247; y: 0 } PathLine { x: 247; y: 22 } @@ -102,7 +97,6 @@ PathLine { x: 249; y: 22 } PathLine { x: 251; y: 22 } PathLine { x: 251; y: 0 } PathLine { x: 249; y: 0 } -PathLine { x: 249; y: 0 } PathMove { x: 249; y: 22 } PathLine { x: 249; y: 20 } PathLine { x: 0; y: 20 } @@ -110,7 +104,6 @@ PathLine { x: 0; y: 22 } PathLine { x: 0; y: 24 } PathLine { x: 249; y: 24 } PathLine { x: 249; y: 22 } -PathLine { x: 249; y: 22 } PathMove { x: 0; y: 22 } PathLine { x: 2; y: 22 } PathLine { x: 2; y: 0 } @@ -118,7 +111,6 @@ PathLine { x: 0; y: 0 } PathLine { x: -2; y: 0 } PathLine { x: -2; y: 22 } PathLine { x: 0; y: 22 } -PathLine { x: 0; y: 22 } }} Rectangle { // component (Instance) level: 0 ProgressBarFilled diff --git a/pages/FigmaQmlInterface/qml/HeaderValueComponent28_figma.qml b/pages/FigmaQmlInterface/qml/TestPage_HeaderValueComponent29_figma.qml similarity index 65% rename from pages/FigmaQmlInterface/qml/HeaderValueComponent28_figma.qml rename to pages/FigmaQmlInterface/qml/TestPage_HeaderValueComponent29_figma.qml index a470a82..7dfb8f2 100644 --- a/pages/FigmaQmlInterface/qml/HeaderValueComponent28_figma.qml +++ b/pages/FigmaQmlInterface/qml/TestPage_HeaderValueComponent29_figma.qml @@ -6,17 +6,9 @@ import QtQuick.Shapes import QtQuick.Controls import QtQuick.Shapes import FigmaQmlInterface -Rectangle { +HeaderValueComponent27_figma { // component (Instance) level: 0 HeaderValueComponent - id: figma_94_14 + id: figma_269_178 // # "HeaderValueComponent" objectName:"HeaderValueComponent" - x:0 - y:0 - width:54 - height:13 - color:"#00ffffff" - clip: false - Component.onCompleted: { - } } diff --git a/pages/FigmaQmlInterface/qml/TestPage_InputComponent35_figma.qml b/pages/FigmaQmlInterface/qml/TestPage_InputComponent29_figma.qml similarity index 92% rename from pages/FigmaQmlInterface/qml/TestPage_InputComponent35_figma.qml rename to pages/FigmaQmlInterface/qml/TestPage_InputComponent29_figma.qml index 765bc59..f3fdd26 100644 --- a/pages/FigmaQmlInterface/qml/TestPage_InputComponent35_figma.qml +++ b/pages/FigmaQmlInterface/qml/TestPage_InputComponent29_figma.qml @@ -6,7 +6,7 @@ import QtQuick.Shapes import QtQuick.Controls import QtQuick.Shapes import FigmaQmlInterface -InputComponent33_figma { +InputComponent27_figma { // component (Instance) level: 0 InputComponent id: figma_219_72 // # "InputComponent" diff --git a/pages/FigmaQmlInterface/qml/TestPage_LabelHeaderComponentH2_bold49_figma.qml b/pages/FigmaQmlInterface/qml/TestPage_LabelHeaderComponentH2_bold49_figma.qml new file mode 100644 index 0000000..bde67b5 --- /dev/null +++ b/pages/FigmaQmlInterface/qml/TestPage_LabelHeaderComponentH2_bold49_figma.qml @@ -0,0 +1,14 @@ +//Generated by FigmaQML 3.2.1 + +import QtQuick +import QtQuick.Effects +import QtQuick.Shapes +import QtQuick.Controls +import QtQuick.Shapes +import FigmaQmlInterface +LabelHeaderComponentH2_bold45_figma { +// component (Instance) level: 0 LabelHeaderComponentH2-bold + id: figma_269_147 + // # "LabelHeaderComponentH2-bold" + objectName:"LabelHeaderComponentH2-bold" +} diff --git a/pages/FigmaQmlInterface/qml/TestPage_LabelHeaderComponentH357_figma.qml b/pages/FigmaQmlInterface/qml/TestPage_LabelHeaderComponentH357_figma.qml new file mode 100644 index 0000000..4f69de9 --- /dev/null +++ b/pages/FigmaQmlInterface/qml/TestPage_LabelHeaderComponentH357_figma.qml @@ -0,0 +1,14 @@ +//Generated by FigmaQML 3.2.1 + +import QtQuick +import QtQuick.Effects +import QtQuick.Shapes +import QtQuick.Controls +import QtQuick.Shapes +import FigmaQmlInterface +LabelHeaderComponentH353_figma { +// component (Instance) level: 0 LabelHeaderComponentH3 + id: figma_269_166 + // # "LabelHeaderComponentH3" + objectName:"LabelHeaderComponentH3" +} diff --git a/pages/FigmaQmlInterface/qml/TestPage_MainPage2_figma.qml b/pages/FigmaQmlInterface/qml/TestPage_MainPage2_figma.qml index 6cf4e1d..2dad3e6 100644 --- a/pages/FigmaQmlInterface/qml/TestPage_MainPage2_figma.qml +++ b/pages/FigmaQmlInterface/qml/TestPage_MainPage2_figma.qml @@ -18,7 +18,7 @@ Rectangle { color: "transparent" clip: true - LabelHeaderComponentH123_figma { + LabelHeaderComponentH122_figma { // component (Instance) level: 0 MainPageHeader id: figma_94_73 // # "MainPageHeader" @@ -131,7 +131,7 @@ Rectangle { clip: true } - LabelComponent22_figma { + LabelComponent20_figma { // component (Instance) level: 0 16 id: figma_94_79 // # "16" diff --git a/pages/FigmaQmlInterface/qml/TestPage_MainWindow2_figma.qml b/pages/FigmaQmlInterface/qml/TestPage_MainWindow2_figma.qml index 43bc04d..3d1470c 100644 --- a/pages/FigmaQmlInterface/qml/TestPage_MainWindow2_figma.qml +++ b/pages/FigmaQmlInterface/qml/TestPage_MainWindow2_figma.qml @@ -28,23 +28,9 @@ Rectangle { width:283 height:900 color:"#ffffffff" - clip: true -Shape { - anchors.fill: parent -ShapePath { - strokeColor: Qt.rgba(0.964706, 0.964706, 0.964706, 1) - strokeWidth: 1 - fillColor: "transparent" - PathMove { x: 0; y: 900 } -PathLine { x: 5; y: 900 } -PathLine { x: 5; y: 0 } -PathLine { x: 0; y: 0 } -PathLine { x: -5; y: 0 } -PathLine { x: -5; y: 900 } -PathLine { x: 0; y: 900 } -PathLine { x: 0; y: 900 } -}} - LabelHeaderComponentH330_figma { + clip: false + + LabelHeaderComponentH354_figma { // component (Instance) level: 0 InformationHeader id: figma_94_66 // # "InformationHeader" @@ -73,17 +59,17 @@ PathLine { x: 0; y: 900 } } } Rectangle { - // component (Instance) level: 0 Frame 789 + // component (Instance) level: 0 StorageInfoWidget id: figma_94_67 - // # "Frame 789" - objectName:"Frame 789" + // # "StorageInfoWidget" + objectName:"StorageInfoWidget" x:21 - y:67 + y:64 width:242 - height:92 + height:111 color: "transparent" radius:8 - clip: true + clip: false Shape { anchors.fill: parent ShapePath { @@ -91,80 +77,134 @@ ShapePath { strokeWidth: 4 fillColor: "transparent" PathMove { x: 8; y: 0 } -PathLine { x: 8; y: 4 } -PathLine { x: 234; y: 4 } +PathLine { x: 8; y: 2 } +PathLine { x: 234; y: 2 } PathLine { x: 234; y: 0 } -PathLine { x: 234; y: -4 } -PathLine { x: 8; y: -4 } -PathLine { x: 8; y: 0 } +PathLine { x: 234; y: -2 } +PathLine { x: 8; y: -2 } PathLine { x: 8; y: 0 } PathMove { x: 242; y: 8 } -PathLine { x: 238; y: 8 } -PathLine { x: 238; y: 84 } -PathLine { x: 242; y: 84 } -PathLine { x: 246; y: 84 } -PathLine { x: 246; y: 8 } +PathLine { x: 240; y: 8 } +PathLine { x: 240; y: 103 } +PathLine { x: 242; y: 103 } +PathLine { x: 244; y: 103 } +PathLine { x: 244; y: 8 } PathLine { x: 242; y: 8 } -PathLine { x: 242; y: 8 } -PathMove { x: 234; y: 92 } -PathLine { x: 234; y: 88 } -PathLine { x: 8; y: 88 } -PathLine { x: 8; y: 92 } -PathLine { x: 8; y: 96 } -PathLine { x: 234; y: 96 } -PathLine { x: 234; y: 92 } -PathLine { x: 234; y: 92 } -PathMove { x: 0; y: 84 } -PathLine { x: 4; y: 84 } -PathLine { x: 4; y: 8 } +PathMove { x: 234; y: 111 } +PathLine { x: 234; y: 109 } +PathLine { x: 8; y: 109 } +PathLine { x: 8; y: 111 } +PathLine { x: 8; y: 113 } +PathLine { x: 234; y: 113 } +PathLine { x: 234; y: 111 } +PathMove { x: 0; y: 103 } +PathLine { x: 2; y: 103 } +PathLine { x: 2; y: 8 } PathLine { x: 0; y: 8 } -PathLine { x: -4; y: 8 } -PathLine { x: -4; y: 84 } -PathLine { x: 0; y: 84 } -PathLine { x: 0; y: 84 } -PathMove { x: 8; y: 92 } -PathLine { x: 8; y: 88 } -PathCubic { control1X: 5.79086; control1Y: 88; control2X: 4; control2Y: 86.2091; x: 4; y: 84 } -PathLine { x: 0; y: 84 } -PathLine { x: -4; y: 84 } -PathCubic { control1X: -4; control1Y: 90.6274; control2X: 1.37259; control2Y: 96; x: 8; y: 96 } -PathLine { x: 8; y: 92 } -PathLine { x: 8; y: 92 } -PathMove { x: 242; y: 84 } -PathLine { x: 238; y: 84 } -PathCubic { control1X: 238; control1Y: 86.2091; control2X: 236.209; control2Y: 88; x: 234; y: 88 } -PathLine { x: 234; y: 92 } -PathLine { x: 234; y: 96 } -PathCubic { control1X: 240.627; control1Y: 96; control2X: 246; control2Y: 90.6274; x: 246; y: 84 } -PathLine { x: 242; y: 84 } -PathLine { x: 242; y: 84 } +PathLine { x: -2; y: 8 } +PathLine { x: -2; y: 103 } +PathLine { x: 0; y: 103 } +PathMove { x: 8; y: 111 } +PathLine { x: 8; y: 109 } +PathCubic { control1X: 4.68629; control1Y: 109; control2X: 2; control2Y: 106.314; x: 2; y: 103 } +PathLine { x: 0; y: 103 } +PathLine { x: -2; y: 103 } +PathCubic { control1X: -2; control1Y: 108.523; control2X: 2.47716; control2Y: 113; x: 8; y: 113 } +PathLine { x: 8; y: 111 } +PathMove { x: 242; y: 103 } +PathLine { x: 240; y: 103 } +PathCubic { control1X: 240; control1Y: 106.314; control2X: 237.314; control2Y: 109; x: 234; y: 109 } +PathLine { x: 234; y: 111 } +PathLine { x: 234; y: 113 } +PathCubic { control1X: 239.523; control1Y: 113; control2X: 244; control2Y: 108.523; x: 244; y: 103 } +PathLine { x: 242; y: 103 } PathMove { x: 234; y: 0 } -PathLine { x: 234; y: 4 } -PathCubic { control1X: 236.209; control1Y: 4; control2X: 238; control2Y: 5.79086; x: 238; y: 8 } +PathLine { x: 234; y: 2 } +PathCubic { control1X: 237.314; control1Y: 2; control2X: 240; control2Y: 4.68629; x: 240; y: 8 } PathLine { x: 242; y: 8 } -PathLine { x: 246; y: 8 } -PathCubic { control1X: 246; control1Y: 1.37258; control2X: 240.627; control2Y: -4; x: 234; y: -4 } -PathLine { x: 234; y: 0 } +PathLine { x: 244; y: 8 } +PathCubic { control1X: 244; control1Y: 2.47715; control2X: 239.523; control2Y: -2; x: 234; y: -2 } PathLine { x: 234; y: 0 } PathMove { x: 8; y: 0 } -PathLine { x: 8; y: -4 } -PathCubic { control1X: 1.37258; control1Y: -4; control2X: -4; control2Y: 1.37258; x: -4; y: 8 } +PathLine { x: 8; y: -2 } +PathCubic { control1X: 2.47715; control1Y: -2; control2X: -2; control2Y: 2.47716; x: -2; y: 8 } PathLine { x: 0; y: 8 } -PathLine { x: 4; y: 8 } -PathCubic { control1X: 4; control1Y: 5.79086; control2X: 5.79086; control2Y: 4; x: 8; y: 4 } -PathLine { x: 8; y: 0 } +PathLine { x: 2; y: 8 } +PathCubic { control1X: 2; control1Y: 4.68629; control2X: 4.68629; control2Y: 2; x: 8; y: 2 } PathLine { x: 8; y: 0 } }} + Rectangle { + // component (Instance) level: 0 LabelHeaderComponentH3 + id: figma_269_172 + // # "LabelHeaderComponentH3" + objectName:"LabelHeaderComponentH3" + x: (figma_94_67.width - width) / 2 + 0.5 + y:7 + width:83 + height:19 + color: "transparent" + clip: false + + Text { + // component (Instance) level: 0 Label + id: figma_269_173 + // # "Label" + objectName:"Label" + x:2 + y:1 + width:79 + height:17 + color:"#ff000000" + wrapMode: TextEdit.WordWrap + text:"Хранилище" + font.family: "Tahoma" + font.italic: false + font.letterSpacing: 0 + font.pixelSize: 14 + font.weight: Font.Normal + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignTop + } + } + HeaderValueComponent27_figma { + // component (Instance) level: 0 LabelAvailibleSizeComponent + id: figma_269_181 + // # "LabelAvailibleSizeComponent" + objectName:"LabelAvailibleSizeComponent" + x:17 + y:35 + color: "transparent" + delegate_269_179: Text { + // component (Instance) level: 1 LabelAvailibleSize + id: figma_i269_181_269_179 + // # "LabelAvailibleSize" + objectName:"LabelAvailibleSize" + x:0 + y:0 + width:54 + height:13 + color:"#ff000000" + wrapMode: TextEdit.WordWrap + text:"Свободно" + font.family: "Tahoma" + font.italic: false + font.letterSpacing: 0 + font.pixelSize: 11 + font.weight: Font.Normal + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignTop + } + } Rectangle { // component (Instance) level: 0 LabelAvailibleSizeButtonComponent id: figma_98_96 // # "LabelAvailibleSizeButtonComponent" objectName:"LabelAvailibleSizeButtonComponent" - x:20 - y:30 - width:203 + x:17 + y:51 + width:209 height:31 - color:"#00ffffff" + color: "transparent" clip: false Text { @@ -174,7 +214,7 @@ PathLine { x: 8; y: 0 } objectName:"LabelAvailibleSizeButton" x:0 y:0 - width:203 + width:209 height:31 color:"#ff000000" wrapMode: TextEdit.WordWrap @@ -188,56 +228,95 @@ PathLine { x: 8; y: 0 } verticalAlignment: Text.AlignTop } } - HeaderValueComponent28_figma { - // component (Instance) level: 0 LabelAvailibleSizeComponent - id: figma_94_69 - // # "LabelAvailibleSizeComponent" - objectName:"LabelAvailibleSizeComponent" - x:20 - y:17 - Text { - // component (Instance) level: 1 LabelAvailibleSize - id: figma_i94_69_613_433 - // # "LabelAvailibleSize" - objectName:"LabelAvailibleSize" - x:0 - y:0 - width:54 - height:13 - color:"#ff7d7e82" - wrapMode: TextEdit.WordWrap - text:"Свободно" - font.family: "Tahoma" - font.italic: false - font.letterSpacing: 0 - font.pixelSize: 11 - font.weight: Font.Normal - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignTop - } - } - ProgressBarComponent24_figma { - // component (Instance) level: 0 AvailibleSizeProgressBar - id: figma_94_70 - // # "AvailibleSizeProgressBar" - objectName:"AvailibleSizeProgressBar" + Rectangle { + // component (Instance) level: 0 Frame 800 + id: figma_269_210 + // # "Frame 800" + objectName:"Frame 800" x:19 - y:68 + y:85 + width:159 + height:8 + color: "transparent" + clip: true + Rectangle { - // component (Instance) level: 1 AvailibleSizeProgressBarPassedBar - id: figma_i94_70_613_435 + // component (Instance) level: 0 AvailibleSizeProgressBarPassedBar + id: figma_269_206 // # "AvailibleSizeProgressBarPassedBar" objectName:"AvailibleSizeProgressBarPassedBar" x:0 y:0 - width:154 - height:10 + width:159 + height:8 color:"#ffdb1c1c" radius:5 - clip: true + clip: false } } + Rectangle { + // component (Instance) level: 0 AvailibleSizeProgressBar + id: figma_269_205 + // # "AvailibleSizeProgressBar" + objectName:"AvailibleSizeProgressBar" + x:20 + y:84 + width:209 + height:10 + color: "transparent" + radius:5 + clip: false +Shape { + anchors.fill: parent +ShapePath { + strokeColor: Qt.rgba(0.201923, 0.119406, 0.119406, 1) + strokeWidth: 1 + fillColor: "transparent" + PathMove { x: 5; y: 0 } +PathLine { x: 5; y: 0.5 } +PathLine { x: 204; y: 0.5 } +PathLine { x: 204; y: 0 } +PathLine { x: 204; y: -0.5 } +PathLine { x: 5; y: -0.5 } +PathLine { x: 5; y: 0 } +PathMove { x: 204; y: 10 } +PathLine { x: 204; y: 9.5 } +PathLine { x: 5; y: 9.5 } +PathLine { x: 5; y: 10 } +PathLine { x: 5; y: 10.5 } +PathLine { x: 204; y: 10.5 } +PathLine { x: 204; y: 10 } +PathMove { x: 5; y: 10 } +PathLine { x: 5; y: 9.5 } +PathCubic { control1X: 2.51472; control1Y: 9.5; control2X: 0.5; control2Y: 7.48528; x: 0.5; y: 5 } +PathLine { x: 0; y: 5 } +PathLine { x: -0.5; y: 5 } +PathCubic { control1X: -0.5; control1Y: 8.03757; control2X: 1.96244; control2Y: 10.5; x: 5; y: 10.5 } +PathLine { x: 5; y: 10 } +PathMove { x: 209; y: 5 } +PathLine { x: 208.5; y: 5 } +PathCubic { control1X: 208.5; control1Y: 7.48528; control2X: 206.485; control2Y: 9.5; x: 204; y: 9.5 } +PathLine { x: 204; y: 10 } +PathLine { x: 204; y: 10.5 } +PathCubic { control1X: 207.038; control1Y: 10.5; control2X: 209.5; control2Y: 8.03757; x: 209.5; y: 5 } +PathLine { x: 209; y: 5 } +PathMove { x: 204; y: 0 } +PathLine { x: 204; y: 0.5 } +PathCubic { control1X: 206.485; control1Y: 0.5; control2X: 208.5; control2Y: 2.51472; x: 208.5; y: 5 } +PathLine { x: 209; y: 5 } +PathLine { x: 209.5; y: 5 } +PathCubic { control1X: 209.5; control1Y: 1.96243; control2X: 207.038; control2Y: -0.5; x: 204; y: -0.5 } +PathLine { x: 204; y: 0 } +PathMove { x: 5; y: 0 } +PathLine { x: 5; y: -0.5 } +PathCubic { control1X: 1.96243; control1Y: -0.5; control2X: -0.5; control2Y: 1.96243; x: -0.5; y: 5 } +PathLine { x: 0; y: 5 } +PathLine { x: 0.5; y: 5 } +PathCubic { control1X: 0.5; control1Y: 2.51472; control2X: 2.51472; control2Y: 0.5; x: 5; y: 0.5 } +PathLine { x: 5; y: 0 } +}} + } } } Rectangle { @@ -250,7 +329,7 @@ PathLine { x: 8; y: 0 } width:1096 height:900 color: "transparent" - clip: true + clip: false } Rectangle { @@ -258,27 +337,13 @@ PathLine { x: 8; y: 0 } id: figma_139_49 // # "PanelLeft" objectName:"PanelLeft" - x:0 + x:1 y:0 width:221 - height:900 + height:898 color:"#ffffffff" - clip: true -Shape { - anchors.fill: parent -ShapePath { - strokeColor: Qt.rgba(0.964706, 0.964706, 0.964706, 1) - strokeWidth: 1 - fillColor: "transparent" - PathMove { x: 221; y: 0 } -PathLine { x: 216; y: 0 } -PathLine { x: 216; y: 900 } -PathLine { x: 221; y: 900 } -PathLine { x: 226; y: 900 } -PathLine { x: 226; y: 0 } -PathLine { x: 221; y: 0 } -PathLine { x: 221; y: 0 } -}} + clip: false + Rectangle { // component (Instance) level: 0 Logo id: figma_139_50 @@ -546,7 +611,7 @@ PathLine { x: 221; y: 0 } } } } - Rectangle_134_figma { + Rectangle_128_figma { // component (Instance) level: 0 Rectangle 3 id: figma_139_59 // # "Rectangle 3" @@ -739,7 +804,7 @@ PathLine { x: 221; y: 0 } color: "transparent" clip: false - Rectangle_134_figma { + Rectangle_128_figma { // component (Instance) level: 0 Rectangle 2 id: figma_139_62 // # "Rectangle 2" @@ -1223,7 +1288,7 @@ PathLine { x: 221; y: 0 } x:6 y:229 width:209 - height:660.524 + height:658.524 color: "transparent" clip: false @@ -1239,7 +1304,7 @@ PathLine { x: 221; y: 0 } color: "transparent" clip: false - ColumnaItemComponent32_figma { + ColumnaItemComponent27_figma { // component (Instance) level: 0 HomeItem id: figma_139_77 // # "HomeItem" @@ -1324,7 +1389,7 @@ PathLine { x: 221; y: 0 } verticalAlignment: Text.AlignTop } } - ColumnaItemComponent32_figma { + ColumnaItemComponent27_figma { // component (Instance) level: 0 ProjectsItem id: figma_139_78 // # "ProjectsItem" @@ -1416,13 +1481,13 @@ PathLine { x: 221; y: 0 } // # "Column" objectName:"Column" x:0 - y:602 + y:600 width:209 height:58 color: "transparent" clip: false - ColumnaItemComponent32_figma { + ColumnaItemComponent27_figma { // component (Instance) level: 0 CloseItem id: figma_139_80 // # "CloseItem" @@ -1507,7 +1572,7 @@ PathLine { x: 221; y: 0 } verticalAlignment: Text.AlignTop } } - ColumnaItemComponent32_figma { + ColumnaItemComponent27_figma { // component (Instance) level: 0 SettingsItem id: figma_139_81 // # "SettingsItem" diff --git a/pages/FigmaQmlInterface/qml/TestPage_ProjectPage2_figma.qml b/pages/FigmaQmlInterface/qml/TestPage_ProjectPage2_figma.qml index 31e25e8..5282db3 100644 --- a/pages/FigmaQmlInterface/qml/TestPage_ProjectPage2_figma.qml +++ b/pages/FigmaQmlInterface/qml/TestPage_ProjectPage2_figma.qml @@ -18,7 +18,7 @@ Rectangle { color: "transparent" clip: true - LabelHeaderComponentH123_figma { + LabelHeaderComponentH122_figma { // component (Instance) level: 0 ProjectPageHeader id: figma_94_81 // # "ProjectPageHeader" @@ -48,7 +48,7 @@ Rectangle { verticalAlignment: Text.AlignTop } } - LabelComponent22_figma { + LabelComponent20_figma { // component (Instance) level: 0 SubDirectoryLabelComponent id: figma_94_82 // # "SubDirectoryLabelComponent" diff --git a/pages/FigmaQmlInterface/qml/TestPage_SettingsPage2_figma.qml b/pages/FigmaQmlInterface/qml/TestPage_SettingsPage2_figma.qml index f55c8e8..fa6fbe7 100644 --- a/pages/FigmaQmlInterface/qml/TestPage_SettingsPage2_figma.qml +++ b/pages/FigmaQmlInterface/qml/TestPage_SettingsPage2_figma.qml @@ -17,8 +17,8 @@ Rectangle { height:900 color: "transparent" clip: true - - LabelHeaderComponentH123_figma { + + LabelHeaderComponentH122_figma { // component (Instance) level: 0 MainPageHeader id: figma_94_87 // # "MainPageHeader" @@ -48,7 +48,7 @@ Rectangle { verticalAlignment: Text.AlignTop } } - LabelComponent22_figma { + LabelComponent20_figma { // component (Instance) level: 0 LabelComponent id: figma_94_88 // # "LabelComponent" @@ -89,13 +89,139 @@ Rectangle { color:"#ffffffff" clip: true - InputComponent33_figma { + InputComponent27_figma { + // component (Instance) level: 0 InputComponent + id: figma_249_58 + // # "InputComponent" + objectName:"InputComponent" + x: (figma_94_89.width - width) / 2 - 239 + y:275 + width:470 + height:40 + delegate_219_73: Text { + // component (Instance) level: 1 ProjectLabel + id: figma_i249_58_219_73 + // # "ProjectLabel" + objectName:"ProjectLabel" + x:0 + y:0 + width:470 + height:13 + color:"#ff302f38" + wrapMode: TextEdit.WordWrap + text:"Адрес" + font.family: "Tahoma" + font.italic: false + font.letterSpacing: 0 + font.pixelSize: 11 + font.weight: Font.Normal + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignTop + } + delegate_219_155: Rectangle { + // component (Instance) level: 1 StrokeElement + id: figma_i249_58_219_155 + // # "StrokeElement" + objectName:"StrokeElement" + x:0 + y:17 + width:470 + height:23 + color: "transparent" + radius:5 + clip: false +Shape { + anchors.fill: parent +ShapePath { + strokeColor: Qt.rgba(0, 0, 0, 1) + strokeWidth: 1 + fillColor: "transparent" + PathMove { x: 5; y: 0 } +PathLine { x: 5; y: 0.5 } +PathLine { x: 465; y: 0.5 } +PathLine { x: 465; y: 0 } +PathLine { x: 465; y: -0.5 } +PathLine { x: 5; y: -0.5 } +PathLine { x: 5; y: 0 } +PathMove { x: 470; y: 5 } +PathLine { x: 469.5; y: 5 } +PathLine { x: 469.5; y: 18 } +PathLine { x: 470; y: 18 } +PathLine { x: 470.5; y: 18 } +PathLine { x: 470.5; y: 5 } +PathLine { x: 470; y: 5 } +PathMove { x: 465; y: 23 } +PathLine { x: 465; y: 22.5 } +PathLine { x: 5; y: 22.5 } +PathLine { x: 5; y: 23 } +PathLine { x: 5; y: 23.5 } +PathLine { x: 465; y: 23.5 } +PathLine { x: 465; y: 23 } +PathMove { x: 0; y: 18 } +PathLine { x: 0.5; y: 18 } +PathLine { x: 0.5; y: 5 } +PathLine { x: 0; y: 5 } +PathLine { x: -0.5; y: 5 } +PathLine { x: -0.5; y: 18 } +PathLine { x: 0; y: 18 } +PathMove { x: 5; y: 23 } +PathLine { x: 5; y: 22.5 } +PathCubic { control1X: 2.51472; control1Y: 22.5; control2X: 0.5; control2Y: 20.4853; x: 0.5; y: 18 } +PathLine { x: 0; y: 18 } +PathLine { x: -0.5; y: 18 } +PathCubic { control1X: -0.5; control1Y: 21.0376; control2X: 1.96243; control2Y: 23.5; x: 5; y: 23.5 } +PathLine { x: 5; y: 23 } +PathMove { x: 470; y: 18 } +PathLine { x: 469.5; y: 18 } +PathCubic { control1X: 469.5; control1Y: 20.4853; control2X: 467.485; control2Y: 22.5; x: 465; y: 22.5 } +PathLine { x: 465; y: 23 } +PathLine { x: 465; y: 23.5 } +PathCubic { control1X: 468.038; control1Y: 23.5; control2X: 470.5; control2Y: 21.0376; x: 470.5; y: 18 } +PathLine { x: 470; y: 18 } +PathMove { x: 465; y: 0 } +PathLine { x: 465; y: 0.5 } +PathCubic { control1X: 467.485; control1Y: 0.5; control2X: 469.5; control2Y: 2.51472; x: 469.5; y: 5 } +PathLine { x: 470; y: 5 } +PathLine { x: 470.5; y: 5 } +PathCubic { control1X: 470.5; control1Y: 1.96243; control2X: 468.038; control2Y: -0.5; x: 465; y: -0.5 } +PathLine { x: 465; y: 0 } +PathMove { x: 5; y: 0 } +PathLine { x: 5; y: -0.5 } +PathCubic { control1X: 1.96243; control1Y: -0.5; control2X: -0.5; control2Y: 1.96243; x: -0.5; y: 5 } +PathLine { x: 0; y: 5 } +PathLine { x: 0.5; y: 5 } +PathCubic { control1X: 0.5; control1Y: 2.51472; control2X: 2.51472; control2Y: 0.5; x: 5; y: 0.5 } +PathLine { x: 5; y: 0 } +}} + TextField { + // component (Instance) level: 1 RemoteAddressLabelField + id: figma_i249_58_219_74 + // # "RemoteAddressLabelField" + objectName:"RemoteAddressLabelField" + x:3 + y:0 + width:464 + height:23 + color:"#ff7d7e82" + wrapMode: TextEdit.WordWrap + text:"http://localhost:1234" +background: Rectangle {color: "transparent"} font.family: "Tahoma" + font.italic: false + font.letterSpacing: 0 + font.pixelSize: 16 + font.weight: Font.Normal + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignVCenter + } + } + } + InputComponent27_figma { // component (Instance) level: 0 InputComponent id: figma_249_53 // # "InputComponent" objectName:"InputComponent" - x: (figma_94_89.width - width) / 2 - 272 - y:33 + x: (figma_94_89.width - width) / 2 - 242 + y:70 width:470 height:40 delegate_219_73: Text { @@ -143,7 +269,6 @@ PathLine { x: 465; y: 0 } PathLine { x: 465; y: -0.5 } PathLine { x: 5; y: -0.5 } PathLine { x: 5; y: 0 } -PathLine { x: 5; y: 0 } PathMove { x: 470; y: 5 } PathLine { x: 469.5; y: 5 } PathLine { x: 469.5; y: 18 } @@ -151,7 +276,6 @@ PathLine { x: 470; y: 18 } PathLine { x: 470.5; y: 18 } PathLine { x: 470.5; y: 5 } PathLine { x: 470; y: 5 } -PathLine { x: 470; y: 5 } PathMove { x: 465; y: 23 } PathLine { x: 465; y: 22.5 } PathLine { x: 5; y: 22.5 } @@ -159,7 +283,6 @@ PathLine { x: 5; y: 23 } PathLine { x: 5; y: 23.5 } PathLine { x: 465; y: 23.5 } PathLine { x: 465; y: 23 } -PathLine { x: 465; y: 23 } PathMove { x: 0; y: 18 } PathLine { x: 0.5; y: 18 } PathLine { x: 0.5; y: 5 } @@ -167,7 +290,6 @@ PathLine { x: 0; y: 5 } PathLine { x: -0.5; y: 5 } PathLine { x: -0.5; y: 18 } PathLine { x: 0; y: 18 } -PathLine { x: 0; y: 18 } PathMove { x: 5; y: 23 } PathLine { x: 5; y: 22.5 } PathCubic { control1X: 2.51472; control1Y: 22.5; control2X: 0.5; control2Y: 20.4853; x: 0.5; y: 18 } @@ -175,7 +297,6 @@ PathLine { x: 0; y: 18 } PathLine { x: -0.5; y: 18 } PathCubic { control1X: -0.5; control1Y: 21.0376; control2X: 1.96243; control2Y: 23.5; x: 5; y: 23.5 } PathLine { x: 5; y: 23 } -PathLine { x: 5; y: 23 } PathMove { x: 470; y: 18 } PathLine { x: 469.5; y: 18 } PathCubic { control1X: 469.5; control1Y: 20.4853; control2X: 467.485; control2Y: 22.5; x: 465; y: 22.5 } @@ -183,7 +304,6 @@ PathLine { x: 465; y: 23 } PathLine { x: 465; y: 23.5 } PathCubic { control1X: 468.038; control1Y: 23.5; control2X: 470.5; control2Y: 21.0376; x: 470.5; y: 18 } PathLine { x: 470; y: 18 } -PathLine { x: 470; y: 18 } PathMove { x: 465; y: 0 } PathLine { x: 465; y: 0.5 } PathCubic { control1X: 467.485; control1Y: 0.5; control2X: 469.5; control2Y: 2.51472; x: 469.5; y: 5 } @@ -191,7 +311,6 @@ PathLine { x: 470; y: 5 } PathLine { x: 470.5; y: 5 } PathCubic { control1X: 470.5; control1Y: 1.96243; control2X: 468.038; control2Y: -0.5; x: 465; y: -0.5 } PathLine { x: 465; y: 0 } -PathLine { x: 465; y: 0 } PathMove { x: 5; y: 0 } PathLine { x: 5; y: -0.5 } PathCubic { control1X: 1.96243; control1Y: -0.5; control2X: -0.5; control2Y: 1.96243; x: -0.5; y: 5 } @@ -199,7 +318,6 @@ PathLine { x: 0; y: 5 } PathLine { x: 0.5; y: 5 } PathCubic { control1X: 0.5; control1Y: 2.51472; control2X: 2.51472; control2Y: 0.5; x: 5; y: 0.5 } PathLine { x: 5; y: 0 } -PathLine { x: 5; y: 0 } }} TextField { // component (Instance) level: 1 ProjectsPathLabelField @@ -223,139 +341,71 @@ background: Rectangle {color: "transparent"} font.family: "Ta } } } - InputComponent33_figma { - // component (Instance) level: 0 InputComponent - id: figma_249_58 - // # "InputComponent" - objectName:"InputComponent" - x: (figma_94_89.width - width) / 2 - 272 - y:86 - width:470 - height:40 - delegate_219_73: Text { - // component (Instance) level: 1 ProjectLabel - id: figma_i249_58_219_73 - // # "ProjectLabel" - objectName:"ProjectLabel" + LabelHeaderComponentH2_bold45_figma { + // component (Instance) level: 0 LabelHeaderComponentH2-bold + id: figma_269_150 + // # "LabelHeaderComponentH2-bold" + objectName:"LabelHeaderComponentH2-bold" + x:71 + y:37 + width:154 + height:31 + color: "transparent" + delegate_269_148: Text { + // component (Instance) level: 1 Label + id: figma_i269_150_269_148 + // # "Label" + objectName:"Label" x:0 y:0 - width:470 - height:13 - color:"#ff302f38" + width:154 + height:31 + color:"#ff000000" wrapMode: TextEdit.WordWrap - text:"Адрес сервера" + text:"Хранилище" font.family: "Tahoma" font.italic: false font.letterSpacing: 0 - font.pixelSize: 11 - font.weight: Font.Normal + font.pixelSize: 26 + font.weight: Font.DemiBold horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignTop } - delegate_219_155: Rectangle { - // component (Instance) level: 1 StrokeElement - id: figma_i249_58_219_155 - // # "StrokeElement" - objectName:"StrokeElement" + } + LabelHeaderComponentH2_bold45_figma { + // component (Instance) level: 0 LabelHeaderComponentH2-bold + id: figma_269_160 + // # "LabelHeaderComponentH2-bold" + objectName:"LabelHeaderComponentH2-bold" + x:71 + y:241 + width:99 + height:31 + color: "transparent" + delegate_269_148: Text { + // component (Instance) level: 1 Label + id: figma_i269_160_269_148 + // # "Label" + objectName:"Label" x:0 - y:17 - width:470 - height:23 - color: "transparent" - radius:5 - clip: false -Shape { - anchors.fill: parent -ShapePath { - strokeColor: Qt.rgba(0, 0, 0, 1) - strokeWidth: 1 - fillColor: "transparent" - PathMove { x: 5; y: 0 } -PathLine { x: 5; y: 0.5 } -PathLine { x: 465; y: 0.5 } -PathLine { x: 465; y: 0 } -PathLine { x: 465; y: -0.5 } -PathLine { x: 5; y: -0.5 } -PathLine { x: 5; y: 0 } -PathLine { x: 5; y: 0 } -PathMove { x: 470; y: 5 } -PathLine { x: 469.5; y: 5 } -PathLine { x: 469.5; y: 18 } -PathLine { x: 470; y: 18 } -PathLine { x: 470.5; y: 18 } -PathLine { x: 470.5; y: 5 } -PathLine { x: 470; y: 5 } -PathLine { x: 470; y: 5 } -PathMove { x: 465; y: 23 } -PathLine { x: 465; y: 22.5 } -PathLine { x: 5; y: 22.5 } -PathLine { x: 5; y: 23 } -PathLine { x: 5; y: 23.5 } -PathLine { x: 465; y: 23.5 } -PathLine { x: 465; y: 23 } -PathLine { x: 465; y: 23 } -PathMove { x: 0; y: 18 } -PathLine { x: 0.5; y: 18 } -PathLine { x: 0.5; y: 5 } -PathLine { x: 0; y: 5 } -PathLine { x: -0.5; y: 5 } -PathLine { x: -0.5; y: 18 } -PathLine { x: 0; y: 18 } -PathLine { x: 0; y: 18 } -PathMove { x: 5; y: 23 } -PathLine { x: 5; y: 22.5 } -PathCubic { control1X: 2.51472; control1Y: 22.5; control2X: 0.5; control2Y: 20.4853; x: 0.5; y: 18 } -PathLine { x: 0; y: 18 } -PathLine { x: -0.5; y: 18 } -PathCubic { control1X: -0.5; control1Y: 21.0376; control2X: 1.96243; control2Y: 23.5; x: 5; y: 23.5 } -PathLine { x: 5; y: 23 } -PathLine { x: 5; y: 23 } -PathMove { x: 470; y: 18 } -PathLine { x: 469.5; y: 18 } -PathCubic { control1X: 469.5; control1Y: 20.4853; control2X: 467.485; control2Y: 22.5; x: 465; y: 22.5 } -PathLine { x: 465; y: 23 } -PathLine { x: 465; y: 23.5 } -PathCubic { control1X: 468.038; control1Y: 23.5; control2X: 470.5; control2Y: 21.0376; x: 470.5; y: 18 } -PathLine { x: 470; y: 18 } -PathLine { x: 470; y: 18 } -PathMove { x: 465; y: 0 } -PathLine { x: 465; y: 0.5 } -PathCubic { control1X: 467.485; control1Y: 0.5; control2X: 469.5; control2Y: 2.51472; x: 469.5; y: 5 } -PathLine { x: 470; y: 5 } -PathLine { x: 470.5; y: 5 } -PathCubic { control1X: 470.5; control1Y: 1.96243; control2X: 468.038; control2Y: -0.5; x: 465; y: -0.5 } -PathLine { x: 465; y: 0 } -PathLine { x: 465; y: 0 } -PathMove { x: 5; y: 0 } -PathLine { x: 5; y: -0.5 } -PathCubic { control1X: 1.96243; control1Y: -0.5; control2X: -0.5; control2Y: 1.96243; x: -0.5; y: 5 } -PathLine { x: 0; y: 5 } -PathLine { x: 0.5; y: 5 } -PathCubic { control1X: 0.5; control1Y: 2.51472; control2X: 2.51472; control2Y: 0.5; x: 5; y: 0.5 } -PathLine { x: 5; y: 0 } -PathLine { x: 5; y: 0 } -}} - TextField { - // component (Instance) level: 1 RemoteAddressLabelField - id: figma_i249_58_219_74 - // # "RemoteAddressLabelField" - objectName:"RemoteAddressLabelField" - x:3 - y:0 - width:464 - height:23 - color:"#ff7d7e82" - wrapMode: TextEdit.WordWrap - text:"http://localhost:1234" -background: Rectangle {color: "transparent"} font.family: "Tahoma" - font.italic: false - font.letterSpacing: 0 - font.pixelSize: 16 - font.weight: Font.Normal - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - } + y:0 + width:99 + height:31 + color:"#ff000000" + wrapMode: TextEdit.WordWrap + text:"Сервер" + font.family: "Tahoma" + font.italic: false + font.letterSpacing: 0 + font.pixelSize: 26 + font.weight: Font.DemiBold + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignTop } } } + + function showMe1() { + dialogLoader1.source = "../../../QtQuckApp/qml/SaveChangesDialog.qml" + } } diff --git a/qml/SaveChangesDialog.qml b/qml/SaveChangesDialog.qml new file mode 100644 index 0000000..86f40a7 --- /dev/null +++ b/qml/SaveChangesDialog.qml @@ -0,0 +1,85 @@ +import QtQuick 2.15 +import QtQuick.Controls 2.15 + +Dialog { + id: saveDialog + modal: true + title: "Сохранить изменения" + width: 300 // фиксированная ширина, чтобы избежать циклов + // standardButtons: Dialog.Yes | Dialog.No | Dialog.Cancel + + anchors.centerIn: Overlay.overlay + + footer: DialogButtonBox { + Button { + text: qsTr("Да") + DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole + onClicked: { + saveRequested() + } + } + + Button { + text: qsTr("Нет") + DialogButtonBox.buttonRole: DialogButtonBox.RejectRole + onClicked: { + cancelRequested() + } + } + + Button { + text: qsTr("Отмена") + DialogButtonBox.buttonRole: DialogButtonBox.RejectRole + + onClicked: { + abortRequested() + } + } + } + // onAccepted: { + // saveDialog.visible = false + // saveRequested() + // // doDeleteModel(); + // } + + // onRejected: { + // console.log("Rejected") + // var button = saveDialog.standardButton(saveDialog.buttonType) + + // if (button === Dialog.Cancel) { + // console.log("Pressed Cancel") + // } else if (button === Dialog.No) { + // console.log("Pressed No") + // } + // } + // onCanceled: console.log("Нажата Cancel - действие отменено") + // onCanceled: { + // abortRequested(); + // doDeleteModel(); + // } + + onVisibleChanged: { + if (!saveDialog.visible) { + console.log("Диалог закрыт (видимость false)") + doDeleteModel(); + } + } + + contentItem: Text { + text: "Вы хотите сохранить изменения перед выходом?" + wrapMode: Text.WordWrap + width: parent.width - 40 // с отступами, чтобы текст не растягивался бесконечно + } + + signal saveRequested() + signal cancelRequested() + signal abortRequested() + + function doDeleteModel() { + if (typeof settingsPageModel !== "undefined" && settingsPageModel) { + // settingsPageModel.deleteLater(); + } else { + console.error("settingsPageModel is not defined!"); + } + } +} diff --git a/quickhelper.cpp b/quickhelper.cpp index 516de24..e73468e 100644 --- a/quickhelper.cpp +++ b/quickhelper.cpp @@ -6,6 +6,8 @@ #include "QQuickItem" #include "callbackwrapper.h" #include "qrgb.h" +#include "ArrDifferentTypes.h" + QuickHelper::QuickHelper() {} void QuickHelper::updateElement(QObject *rootObject, const QString &elementName, std::function)> updateItemFunction, std::function onClick) @@ -58,59 +60,6 @@ QQuickItem *QuickHelper::getQuickItem(QObject *rootObject, const QString &elemen return quickItem; } -void QuickHelper::addMouseArea(QObject* rootObject, std::function onClickAction) { - qDebug() << "[C++] Starting to create MouseArea"; - - if (!rootObject) { - qWarning() << "[C++] Root object is null"; - return; - } - - QQuickItem* parentItem = qobject_cast(rootObject); - if (!parentItem) { - qWarning() << "[C++] Root object is not a QQuickItem"; - return; - } - - QQmlEngine* engine = qmlEngine(rootObject); - if (!engine) { - qWarning() << "[C++] Failed to get QQmlEngine"; - return; - } - // 1. Создаем CallbackWrapper и добавляем в контекст QML - CallbackWrapper* wrapper = new CallbackWrapper(onClickAction, parentItem); - QQmlContext* context = new QQmlContext(engine->rootContext(), parentItem); - context->setContextProperty("callbackWrapper", wrapper); // Делаем доступным в QML - - // 2. Создаем MouseArea (уже будет видеть callbackWrapper) - QQmlComponent component(engine); - component.setData(R"( - import QtQuick 2.15 - MouseArea { - anchors.fill: parent - onClicked: callbackWrapper.invoke() - } - )", QUrl()); - - // 3. Создаем MouseArea в этом контексте - QObject* mouseAreaObj = component.create(context); - if (!mouseAreaObj) { - qWarning() << "Error creating MouseArea:" << component.errors(); - delete context; - return; - } - - // 4. Настраиваем родительские связи - mouseAreaObj->setParent(parentItem); - QQuickItem* mouseAreaItem = qobject_cast(mouseAreaObj); - mouseAreaItem->setParentItem(parentItem); - - // 5. Удаление контекста при удалении MouseArea - context->setParent(mouseAreaObj); -}; - -#include "quickupdater.h" - void QuickHelper::doFunction( QObject* rootObject, const QList& listItems, @@ -161,7 +110,11 @@ void QuickHelper::doFunction( // 4. Настраиваем родительские связи (управление памятью через Qt-родителя) updaterObject->setParent(parentItem); + QQuickItem *updaterObjectItem = qobject_cast(updaterObject); + if (updaterObjectItem) { + updaterObjectItem->setParentItem(parentItem); + } // 5. Контекст удалится автоматически при удалении updaterObject context->setParent(updaterObject); @@ -175,34 +128,68 @@ void QuickHelper::doFunction( if (!success) { qWarning() << "Failed to invoke QML function:" << functionName; } +} + +void QuickHelper::addComponent( + QObject* rootObject, + const QList& listItems, + const QString& textComponent + ) { + qDebug() << "[C++] Starting to create function"; + + if (!rootObject) { + qWarning() << "[C++] Root object is null"; + return; + } + + QQuickItem* parentItem = qobject_cast(rootObject); + if (!parentItem) { + qWarning() << "[C++] Root object is not a QQuickItem"; + return; + } + + QQmlEngine* engine = qmlEngine(rootObject); + if (!engine) { + qWarning() << "[C++] Failed to get QQmlEngine"; + return; + } + + // 1. Создаем ArrDifferentTypes и добавляем в контекст QML + ArrDifferentTypes* arrDifferentTypes = new ArrDifferentTypes(parentItem); + arrDifferentTypes->setArrDifferentTypes(listItems); + + QQmlContext* context = new QQmlContext(engine->rootContext(), parentItem); + context->setContextProperty("quickUpdaterData", arrDifferentTypes); + + QQmlComponent component(engine); + component.setData(textComponent.toLocal8Bit(), QUrl()); + + if (component.isError()) { + qWarning() << "QML Component errors:" << component.errors() << "\n" << textComponent; + delete context; + return; + } + + QObject* updaterObject = component.create(context); + if (!updaterObject) { + qWarning() << "Error creating updaterObject:" << component.errors(); + delete context; + return; + } + + // 4. Настраиваем родительские связи (управление памятью через Qt-родителя) + updaterObject->setParent(parentItem); + QQuickItem* updaterObjectItem = qobject_cast(updaterObject); + if (updaterObjectItem) { + updaterObjectItem->setParentItem(parentItem); + } + + // 5. Контекст удалится автоматически при удалении updaterObject + context->setParent(updaterObject); - updaterObject->deleteLater(); - arrDifferentTypes->deleteLater(); } void QuickHelper::updateColor(QObject* rootObject, QColor disabledColor, QColor enabledColor){ - // Присваивает значение - /*QString textComponent = R"( - import QtQuick 2.0 - - QtObject { - function updateColor(smthItem) { - if (!quickUpdaterData || quickUpdaterData.arrDifferentTypes.length < 2) { - console.log("quickUpdaterData not set or length < 2"); - return; - } - - var colorDisabled = quickUpdaterData.arrDifferentTypes[0]; - var colorEnabled = quickUpdaterData.arrDifferentTypes[1]; - - if (smthItem && smthItem.hasOwnProperty("color") && smthItem.hasOwnProperty("enabled")) { - smthItem.color = smthItem.enabled ? colorEnabled : colorDisabled; - } else { - console.log("item does not have color or enabled property"); - } - } - } - )";*/ QString textComponent = R"( import QtQuick 2.15 @@ -225,9 +212,78 @@ QtObject { )"; QString function = "updateColor"; QVariantList list; - // list.append(QColor(qRgb(255,255,0))); - // list.append(QColor(qRgb(0,255,0))); list.append(disabledColor); list.append(enabledColor); QuickHelper::doFunction(rootObject, list,textComponent,function); } + +void QuickHelper::setPorpetryEnumerator( + QQuickItem * item, + const QString & enumeratorName, + const QString & propertyName, + const QString & propertyValue + ){ + const QMetaObject *metaObject = item->metaObject(); + int enumIndex = metaObject->indexOfEnumerator(enumeratorName.toUtf8().constData()); + QMetaEnum metaEnum = metaObject->enumerator(enumIndex); + // Получаем числовое значение нужного enum + int horizontalFitValue = metaEnum.keyToValue(propertyValue.toUtf8().constData()); + // Устанавливаем свойство fontSizeMode + item->setProperty(propertyName.toUtf8().constData(), horizontalFitValue); +} + +void QuickHelper::textChangedSubscription(QObject* rootObject, CallbackWrapper* wrapper){ + QString textComponent = R"( +import QtQuick 2.15 + +QtObject { + function addTrigger(smthItem) { + if (!quickUpdaterData) { + console.log("quickUpdaterData not set") + return + } + smthItem.textChanged.connect(function() { + quickUpdaterData.arrDifferentTypes[0].invoke() + }) + } +} + +)"; + + QVariantList list; + + list.append(QVariant::fromValue(wrapper)); + QuickHelper::doFunction(rootObject, list,textComponent,"addTrigger"); +} + + +void QuickHelper::addMouseAreaElements(QObject* rootObject, + std::function onClickedAction, + std::function onEnteredAction, + std::function onExitedAction + ) { + // 1. Создаем CallbackWrapper и добавляем в контекст QML + CallbackWrapper* wrapperClickedAction = new CallbackWrapper(onClickedAction, rootObject); + CallbackWrapper* wrapperonEnteredAction = new CallbackWrapper(onEnteredAction, rootObject); + CallbackWrapper* wrapperonExitedAction = new CallbackWrapper(onExitedAction, rootObject); + + QString textComponent = R"( + import QtQuick 2.15 + MouseArea { + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + onClicked: quickUpdaterData.arrDifferentTypes[0].invoke() + onEntered: quickUpdaterData.arrDifferentTypes[1].invoke() + onExited: quickUpdaterData.arrDifferentTypes[2].invoke() + } +)"; + + QVariantList list; + + list.append(QVariant::fromValue(wrapperClickedAction)); + list.append(QVariant::fromValue(wrapperonEnteredAction)); + list.append(QVariant::fromValue(wrapperonExitedAction)); + QuickHelper::addComponent(rootObject, list,textComponent); + +}; diff --git a/quickhelper.h b/quickhelper.h index 475a758..4704953 100644 --- a/quickhelper.h +++ b/quickhelper.h @@ -4,6 +4,7 @@ #include "QObject" class QQuickItem; +class CallbackWrapper; class QuickHelper { public: @@ -16,10 +17,20 @@ public: static void clearChildren(QQuickItem *parentItem); static void moveTextFiledX(QQuickItem *parentItem); static QQuickItem * getQuickItem(QObject *rootObject, const QString &elementName); - static void addMouseArea(QObject *rootObject, std::function onClickAction); + // static void addMouseArea(QObject *rootObject, std::function onClickAction); static void doFunction(QObject *rootObject, const QList &listItems, const QString &textFunction, const QString &functionName); static void updateColor(QObject *rootObject, QColor disabledColor, QColor enabledColor); + static void setPorpetryEnumerator( + QQuickItem * item, + const QString & enumeratorName, + const QString & propertyName, + const QString & propertyValue + ); + + static void textChangedSubscription(QObject *rootObject, CallbackWrapper *wrapper); + static void addComponent(QObject *rootObject, const QList &listItems, const QString &textComponent); + static void addMouseAreaElements(QObject *rootObject, std::function onClickedAction, std::function onEnteredAction, std::function onExitedAction); }; #endif // QUICKHELPER_H diff --git a/quickupdater.cpp b/quickupdater.cpp deleted file mode 100644 index 0c55821..0000000 --- a/quickupdater.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "quickupdater.h" diff --git a/settingspageactivity.cpp b/settingspageactivity.cpp index 5c2e87c..10d05b8 100644 --- a/settingspageactivity.cpp +++ b/settingspageactivity.cpp @@ -1,5 +1,4 @@ #include "settingspageactivity.h" -#include "mainpageactivity.h" #include #include #include @@ -10,9 +9,11 @@ #include #include #include "settingsrepository.h" +#include "callbackwrapper.h" +#include "models/settingspagemodel.h" -SettingsPageActivity::SettingsPageActivity(QQuickItem *item, QObject *parent) - : root(item) +SettingsPageActivity::SettingsPageActivity(QQuickItem *item,const std::function& onSave, QObject *parent) + : root(item), QObject(parent), onSave(&onSave) { if (!item) { qWarning() << "[C++] Root object is null"; @@ -31,8 +32,19 @@ SettingsPageActivity::SettingsPageActivity(QQuickItem *item, QObject *parent) SettingsPageActivity::init(); } +extern QQmlApplicationEngine *engine; +SettingsPageActivity::~SettingsPageActivity() { + qDebug()<& listItems, + const QString& textComponent, + const QString& functionName, + SettingsPageActivity& activity + ) { + qDebug() << "[C++] Starting to create function"; + + if (!rootObject) { + qWarning() << "[C++] Root object is null"; + return; + } + + QQuickItem* parentItem = qobject_cast(rootObject); + if (!parentItem) { + qWarning() << "[C++] Root object is not a QQuickItem"; + return; + } + + QQmlEngine* engine = qmlEngine(rootObject); + if (!engine) { + qWarning() << "[C++] Failed to get QQmlEngine"; + return; + } + + // 1. Создаем ArrDifferentTypes и добавляем в контекст QML + ArrDifferentTypes* arrDifferentTypes = new ArrDifferentTypes(parentItem); + arrDifferentTypes->setArrDifferentTypes(listItems); + + // SettingsPageModel * settingsPageModel = new SettingsPageModel(parentItem); + // settingsPageModel->setProjectPath(activity.textProjectPath); + // settingsPageModel->setRemoteAddressUri(activity.textRemoteAddress); + + QQmlContext* context = new QQmlContext(engine->rootContext(), parentItem); + context->setContextProperty("quickUpdaterData", arrDifferentTypes); + + QQmlComponent component(engine); + component.setData(textComponent.toLocal8Bit(), QUrl()); + + if (component.isError()) { + qWarning() << "QML Component errors:" << component.errors() << "\n" << textComponent; + delete context; + return; + } + + QObject* updaterObject = component.create(context); + if (!updaterObject) { + qWarning() << "Error creating updaterObject:" << component.errors(); + delete context; + return; + } + + // 4. Настраиваем родительские связи (управление памятью через Qt-родителя) + updaterObject->setParent(parentItem); + QQuickItem *updaterObjectItem = qobject_cast(updaterObject); + + if (updaterObjectItem) { + updaterObjectItem->setParentItem(parentItem); + } + // 5. Контекст удалится автоматически при удалении updaterObject + context->setParent(updaterObject); + + // 6. Вызываем функцию в QML + bool success = QMetaObject::invokeMethod( + updaterObject, + functionName.toUtf8().constData(), + Q_ARG(QVariant, QVariant::fromValue(rootObject)) + ); + + if (!success) { + qWarning() << "Failed to invoke QML function:" << functionName; + } +} + void SettingsPageActivity::init() { if(!isAllElementsFound()) return; - QString projectDir = SettingsRepository::instance().defaultProjectDirectory(); - QUrl remoteAddress = SettingsRepository::instance().remoteAddressUrl(); + textProjectPath = SettingsRepository::instance().defaultProjectDirectory(); + textRemoteAddress = SettingsRepository::instance().remoteAddressUrl().toString(); - fieldRemoteAdress->setProperty("text", remoteAddress.toString()); - fieldProjectPath->setProperty("text", projectDir); + fieldRemoteAdress->setProperty("text", textRemoteAddress); + fieldProjectPath->setProperty("text", textProjectPath); QuickHelper::moveTextFiledX(fieldRemoteAdress); QuickHelper::moveTextFiledX(fieldProjectPath); } +void SettingsPageActivity::showDialogSave(std::function doYes, std::function doNo, std::function doCancel) +{ + + CallbackWrapper *wraper = new CallbackWrapper([this]{textProjectPathChanged();},this); + QuickHelper::textChangedSubscription(fieldProjectPath,wraper); + + wraper = new CallbackWrapper([this]{textRemoteAddressPathChanged();},this); + QuickHelper::textChangedSubscription(fieldRemoteAdress,wraper); + + QQuickItem *rootItem= qobject_cast(::engine->rootObjects()[0]->children()[0]); + QString componentText = R"( +import QtQuick 2.15 +import QtQuick.Controls 2.15 + +Item { + function showMe(item) { + console.log("showMe dialog") + dialogLoader.source = "QtQuckApp/qml/SaveChangesDialog.qml" + console.log("showMe dialog after") + } + + Loader { + id: dialogLoader + onLoaded: { + console.log("onLoaded") + if (item) { + console.log("item exsist") + + item.saveRequested.connect(function() { + console.log("Yes") + quickUpdaterData.arrDifferentTypes[0].invoke() + }) + + item.cancelRequested.connect(function() { + console.log("No") + quickUpdaterData.arrDifferentTypes[1].invoke() + }) + + item.abortRequested.connect(function() { + console.log("Abort") + quickUpdaterData.arrDifferentTypes[2].invoke() + }) + + item.open() + } + } + } +} +)"; + QObject *item = 0; + QVariantList list; + + CallbackWrapper * wrapperYes = new CallbackWrapper([this,doYes] { + qDebug() << "CallbackWrapperSave"; + doYes(); + }); + + CallbackWrapper * wrapperNo = new CallbackWrapper([this,doNo] { + qDebug() << "CallbackWrapperSave"; + doNo(); + }); + + CallbackWrapper * wrapperCancel = new CallbackWrapper([this,doCancel] { + qDebug() << "CallbackWrapperSave"; + doCancel(); + }); + + list.append(QVariant::fromValue(wrapperYes)); + list.append(QVariant::fromValue(wrapperNo)); + list.append(QVariant::fromValue(wrapperCancel)); + + QQuickItem* parentItem = qobject_cast(rootItem); + if (!parentItem) { + qWarning() << "[C++] Root object is not a QQuickItem"; + return; + } + + SettingsPageModel * settingsPageModel = new SettingsPageModel(); + settingsPageModel->setProjectPath(textProjectPath); + settingsPageModel->setRemoteAddressUri(textRemoteAddress); + engine->rootContext()->setContextProperty("settingsPageModel", settingsPageModel); + + // (*onSave)(); + // doFunction(parentItem, list, componentText, "showMe", *this); + QuickHelper::doFunction(parentItem, list, componentText, "showMe"); +} + +void SettingsPageActivity::textProjectPathChanged() { + textProjectPath = fieldProjectPath->property("text").toString(); +} + +void SettingsPageActivity::textRemoteAddressPathChanged() +{ + textRemoteAddress = fieldRemoteAdress->property("text").toString(); +} + +void SettingsPageActivity::isAllowChangePage(const std::function &continueChange, const std::function &blockChange) +{ + showDialogSave( + [this,continueChange]{ if(onSave) (*onSave)(); continueChange();} + ,[this,continueChange]{continueChange();} + ,[this,blockChange]{blockChange();} + ); +}; + void SettingsPageActivity::errorOccurredDynamycLoaderHandler(const QString &message) { - qDebug()< +#include "QDebug" +#include "interfaces/IPageActivity.h" class QQuickItem; class DynamicLoader; class QQmlEngine; -class SettingsPageActivity : public QObject +class SettingsPageActivity : public QObject, public IPageActivity { Q_OBJECT + const std::function* onSave; public: - explicit SettingsPageActivity(QQuickItem * item, QObject *parent = nullptr); + explicit SettingsPageActivity(QQuickItem * item,const std::function& onSave, QObject *parent = nullptr); + ~SettingsPageActivity() override; + void pageChanged() override final; private: QQuickItem * root; DynamicLoader* loader = 0; @@ -27,8 +32,19 @@ private: bool isAllElementsFound(); void init(); + void destroyedHandler(QObject * = nullptr); + void showDialogSave ( + std::function doYes, + std::function doNo, + std::function doCancel); public: + QString textProjectPath; + QString textRemoteAddress; + + void textProjectPathChanged(); + void textRemoteAddressPathChanged(); + void isAllowChangePage(const std::function &continueChange, const std::function &blockChange) override final; private slots: void errorOccurredDynamycLoaderHandler(const QString& message); signals: