mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-07-02 16:15:28 +08:00
update
This commit is contained in:
@ -1,67 +1,59 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
project(FluentUI)
|
||||
project(fluentui LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
|
||||
find_package(Qt6 COMPONENTS Core Quick Svg REQUIRED)
|
||||
set(QT_INSTALL_QML ${Qt6Core_DIR}/../../../qml)
|
||||
set(TARGET_TYPE SHARED)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/FluentUI)
|
||||
|
||||
if(WIN32)
|
||||
set(CMAKE_SHARED_LIBRARY_PREFIX "")
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/debug)
|
||||
else()
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/release)
|
||||
endif()
|
||||
|
||||
set(TARGET_RESOURCES res.qrc)
|
||||
set(TARGET_SOURCES
|
||||
Def.cpp
|
||||
FluApp.cpp
|
||||
FluColorSet.cpp
|
||||
FluColors.cpp
|
||||
FluRegister.cpp
|
||||
FluTheme.cpp
|
||||
Fluent.cpp
|
||||
FluentUI.cpp
|
||||
NativeEventFilter.cpp
|
||||
WindowHelper.cpp
|
||||
qml_plugin.cpp
|
||||
find_package(Qt6 REQUIRED COMPONENTS Core Quick Qml)
|
||||
|
||||
file(GLOB_RECURSE CPP_FILES *.cpp *.h)
|
||||
foreach(filepath ${CPP_FILES})
|
||||
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" filename ${filepath})
|
||||
list(APPEND sources_files ${filename})
|
||||
endforeach(filepath)
|
||||
|
||||
file(GLOB_RECURSE QML_PATHS *.qml)
|
||||
foreach(filepath ${QML_PATHS})
|
||||
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" filename ${filepath})
|
||||
list(APPEND qml_files ${filename})
|
||||
endforeach(filepath)
|
||||
|
||||
file(GLOB_RECURSE RES_PATHS *.png *.jpg *.svg *.ico *.ttf *.webp)
|
||||
foreach(filepath ${RES_PATHS})
|
||||
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" filename ${filepath})
|
||||
list(APPEND resource_files ${filename})
|
||||
endforeach(filepath)
|
||||
|
||||
foreach(filepath IN LISTS qml_files resource_files)
|
||||
string(REPLACE "imports/FluentUI/" "" filename ${filepath})
|
||||
set_source_files_properties(${filepath} PROPERTIES QT_RESOURCE_ALIAS ${filename})
|
||||
endforeach()
|
||||
|
||||
qt_add_qml_module(fluentui
|
||||
OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/FluentUI
|
||||
VERSION 1.0
|
||||
URI "FluentUI"
|
||||
SOURCES ${sources_files}
|
||||
QML_FILES ${qml_files}
|
||||
RESOURCES ${resource_files}
|
||||
)
|
||||
|
||||
set(TARGET_HEADERS
|
||||
Def.h
|
||||
FluApp.h
|
||||
FluColorSet.h
|
||||
FluColors.h
|
||||
FluRegister.h
|
||||
FluTheme.h
|
||||
Fluent.h
|
||||
FluentUI.h
|
||||
NativeEventFilter.h
|
||||
WindowHelper.h
|
||||
qml_plugin.h
|
||||
stdafx.h
|
||||
set_target_properties(fluentui PROPERTIES
|
||||
WIN32_EXECUTABLE TRUE
|
||||
MACOSX_BUNDLE TRUE
|
||||
)
|
||||
|
||||
add_definitions(-DVERSION_IN="1.0.0")
|
||||
add_definitions(-DURI_STR="FluentUI")
|
||||
|
||||
add_library(${PROJECT_NAME} ${TARGET_TYPE} ${TARGET_SOURCES} ${TARGET_HEADERS} ${TARGET_RESOURCES})
|
||||
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/FluentUI)
|
||||
target_link_libraries(fluentui PUBLIC
|
||||
Qt::Core
|
||||
Qt::Quick
|
||||
Qt::Qml
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE dwmapi user32)
|
||||
else()
|
||||
endif()
|
||||
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Core Qt6::Quick Qt6::Svg)
|
||||
|
||||
if(WIN32)
|
||||
include(build_windows.cmake)
|
||||
else()
|
||||
include(build_macos.cmake)
|
||||
target_link_libraries(fluentui PRIVATE dwmapi user32)
|
||||
endif()
|
||||
|
@ -2,6 +2,7 @@
|
||||
#define DEF_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QtQml/qqml.h>
|
||||
|
||||
namespace Fluent_DarkMode {
|
||||
Q_NAMESPACE
|
||||
@ -10,6 +11,7 @@ Q_NAMESPACE
|
||||
Light = 0x1,
|
||||
Dark = 0x2,
|
||||
};
|
||||
QML_NAMED_ELEMENT(FluDarkMode)
|
||||
Q_ENUMS(Fluent_DarkModeType);
|
||||
}
|
||||
|
||||
@ -1420,6 +1422,7 @@ enum class Fluent_AwesomeType {
|
||||
SpeechSolidBold=0xf8b2,
|
||||
ClickedOutLoudSolidBold=0xf8b3,
|
||||
};
|
||||
QML_NAMED_ELEMENT(FluentIcons)
|
||||
Q_ENUMS(Fluent_AwesomeType)
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "FluApp.h"
|
||||
#include "FluApp.h"
|
||||
|
||||
#include <QQmlEngine>
|
||||
#include <QGuiApplication>
|
||||
@ -6,6 +6,7 @@
|
||||
#include <QQuickItem>
|
||||
#include <QTimer>
|
||||
#include <QUuid>
|
||||
#include <QFontDatabase>
|
||||
#include <QClipboard>
|
||||
#include "FluTheme.h"
|
||||
#include "Def.h"
|
||||
@ -24,29 +25,39 @@ static bool isCompositionEnabled()
|
||||
}
|
||||
#endif
|
||||
|
||||
FluApp* FluApp::m_instance = nullptr;
|
||||
FluApp* FluApp::fluApp = nullptr;
|
||||
FluTheme* FluApp::fluTheme = nullptr;
|
||||
FluColors* FluApp::flutColors = nullptr;
|
||||
|
||||
FluApp *FluApp::getInstance()
|
||||
{
|
||||
if(FluApp::m_instance == nullptr){
|
||||
FluApp::m_instance = new FluApp;
|
||||
}
|
||||
return FluApp::m_instance;
|
||||
void FluApp::setFluApp(FluApp* val){
|
||||
FluApp::fluApp = val;
|
||||
}
|
||||
void FluApp::setFluTheme(FluTheme* val){
|
||||
FluApp::fluTheme = val;
|
||||
}
|
||||
void FluApp::setFluColors(FluColors* val){
|
||||
FluApp::flutColors = val;
|
||||
}
|
||||
|
||||
FluApp::FluApp(QObject *parent)
|
||||
: QObject{parent}
|
||||
{
|
||||
QFontDatabase::addApplicationFont(":/FluentUI/Font/Segoe_Fluent_Icons.ttf");
|
||||
}
|
||||
|
||||
void FluApp::init(QQuickWindow *window){
|
||||
this->appWindow = window;
|
||||
QQmlEngine *engine = qmlEngine(appWindow);
|
||||
QQmlComponent component(engine, ":/FluentUI/Controls/FluSingleton.qml");
|
||||
component.create();
|
||||
nativeEvent = new NativeEventFilter();
|
||||
qApp->installNativeEventFilter(nativeEvent);
|
||||
}
|
||||
|
||||
void FluApp::run(){
|
||||
#ifdef Q_OS_WIN
|
||||
if(!isCompositionEnabled()){
|
||||
FluTheme::getInstance()->frameless(false);
|
||||
fluTheme->frameless(false);
|
||||
}
|
||||
#endif
|
||||
navigate(initialRoute());
|
||||
@ -66,7 +77,6 @@ void FluApp::navigate(const QString& route,const QJsonObject& argument,FluRegist
|
||||
}
|
||||
properties.insert("argument",argument);
|
||||
QQuickWindow *view = qobject_cast<QQuickWindow*>(component.createWithInitialProperties(properties));
|
||||
|
||||
int launchMode = view->property("launchMode").toInt();
|
||||
if(launchMode==1){
|
||||
for (auto& pair : wnds) {
|
||||
@ -88,8 +98,7 @@ void FluApp::navigate(const QString& route,const QJsonObject& argument,FluRegist
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(FluTheme::getInstance()->frameless()){
|
||||
if(fluTheme->frameless()){
|
||||
view->setFlag(Qt::FramelessWindowHint,true);
|
||||
}
|
||||
wnds.insert(view->winId(),view);
|
||||
|
30
src/FluApp.h
30
src/FluApp.h
@ -3,10 +3,14 @@
|
||||
|
||||
#include <QObject>
|
||||
#include <QWindow>
|
||||
#include <QtQml/qqml.h>
|
||||
#include <QJsonArray>
|
||||
#include <QQmlContext>
|
||||
#include <QJsonObject>
|
||||
#include <QQmlEngine>
|
||||
#include "FluTheme.h"
|
||||
#include "FluColors.h"
|
||||
#include "NativeEventFilter.h"
|
||||
#include "FluRegister.h"
|
||||
#include "stdafx.h"
|
||||
|
||||
@ -15,31 +19,35 @@ class FluApp : public QObject
|
||||
Q_OBJECT
|
||||
Q_PROPERTY_AUTO(QString,initialRoute);
|
||||
Q_PROPERTY_AUTO(QJsonObject,routes);
|
||||
|
||||
QML_NAMED_ELEMENT(FluApp)
|
||||
QML_SINGLETON
|
||||
public:
|
||||
|
||||
static FluApp *getInstance();
|
||||
|
||||
explicit FluApp(QObject *parent = nullptr);
|
||||
|
||||
~FluApp(){
|
||||
if (nativeEvent != Q_NULLPTR) {
|
||||
delete nativeEvent;
|
||||
nativeEvent = Q_NULLPTR;
|
||||
}
|
||||
}
|
||||
Q_INVOKABLE void run();
|
||||
|
||||
Q_INVOKABLE void navigate(const QString& route,const QJsonObject& argument = {},FluRegister* fluRegister = nullptr);
|
||||
|
||||
Q_INVOKABLE void init(QQuickWindow *window);
|
||||
|
||||
Q_INVOKABLE QJsonArray awesomelist(const QString& keyword = "");
|
||||
|
||||
Q_INVOKABLE void clipText(const QString& text);
|
||||
|
||||
Q_INVOKABLE QString uuid();
|
||||
|
||||
Q_INVOKABLE void closeApp();
|
||||
Q_INVOKABLE void setFluApp(FluApp* val);
|
||||
Q_INVOKABLE void setFluTheme(FluTheme* val);
|
||||
Q_INVOKABLE void setFluColors(FluColors* val);
|
||||
|
||||
public:
|
||||
QMap<quint64, QQuickWindow*> wnds;
|
||||
static FluApp* fluApp;
|
||||
static FluTheme* fluTheme;
|
||||
static FluColors* flutColors;
|
||||
private:
|
||||
static FluApp* m_instance;
|
||||
NativeEventFilter *nativeEvent = Q_NULLPTR;
|
||||
QWindow *appWindow;
|
||||
};
|
||||
|
||||
|
@ -1,15 +1,5 @@
|
||||
#include "FluColors.h"
|
||||
|
||||
FluColors* FluColors::m_instance = nullptr;
|
||||
|
||||
FluColors *FluColors::getInstance()
|
||||
{
|
||||
if(FluColors::m_instance == nullptr){
|
||||
FluColors::m_instance = new FluColors;
|
||||
}
|
||||
return FluColors::m_instance;
|
||||
}
|
||||
|
||||
FluColors::FluColors(QObject *parent)
|
||||
: QObject{parent}
|
||||
{
|
||||
|
@ -2,6 +2,7 @@
|
||||
#define FLUCOLORS_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QtQml/qqml.h>
|
||||
#include "FluColorSet.h"
|
||||
#include "stdafx.h"
|
||||
|
||||
@ -41,13 +42,10 @@ class FluColors : public QObject
|
||||
Q_PROPERTY_AUTO(FluColorSet*,Blue);
|
||||
Q_PROPERTY_AUTO(FluColorSet*,Teal);
|
||||
Q_PROPERTY_AUTO(FluColorSet*,Green);
|
||||
|
||||
QML_NAMED_ELEMENT(FluColors)
|
||||
QML_SINGLETON
|
||||
public:
|
||||
explicit FluColors(QObject *parent = nullptr);
|
||||
static FluColors *getInstance();
|
||||
private:
|
||||
static FluColors* m_instance;
|
||||
|
||||
};
|
||||
|
||||
#endif // FLUCOLORS_H
|
||||
|
@ -12,7 +12,7 @@ FluRegister::FluRegister(QObject *parent)
|
||||
}
|
||||
|
||||
void FluRegister::launch(const QJsonObject& argument){
|
||||
FluApp::getInstance()->navigate(path(),argument,this);
|
||||
FluApp::fluApp->navigate(path(),argument,this);
|
||||
}
|
||||
|
||||
void FluRegister::onResult(const QJsonObject& data){
|
||||
|
@ -1,27 +1,17 @@
|
||||
#include "FluTheme.h"
|
||||
|
||||
#include "FluColors.h"
|
||||
#include "Def.h"
|
||||
#include <QPalette>
|
||||
#include "FluApp.h"
|
||||
#include <QGuiApplication>
|
||||
|
||||
FluTheme* FluTheme::m_instance = nullptr;
|
||||
|
||||
FluTheme *FluTheme::getInstance()
|
||||
{
|
||||
if(FluTheme::m_instance == nullptr){
|
||||
FluTheme::m_instance = new FluTheme;
|
||||
}
|
||||
return FluTheme::m_instance;
|
||||
}
|
||||
|
||||
FluTheme::FluTheme(QObject *parent)
|
||||
: QObject{parent}
|
||||
{
|
||||
connect(this,&FluTheme::darkModeChanged,this,[=]{
|
||||
Q_EMIT darkChanged();
|
||||
});
|
||||
primaryColor(FluColors::getInstance()->Blue());
|
||||
primaryColor(FluApp::flutColors->Blue());
|
||||
textSize(13);
|
||||
nativeText(false);
|
||||
frameless(true);
|
||||
|
@ -2,6 +2,7 @@
|
||||
#define FLUTHEME_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QtQml/qqml.h>
|
||||
#include "FluColorSet.h"
|
||||
#include "stdafx.h"
|
||||
|
||||
@ -14,13 +15,13 @@ class FluTheme : public QObject
|
||||
Q_PROPERTY_AUTO(int,darkMode);
|
||||
Q_PROPERTY_AUTO(bool,nativeText);
|
||||
Q_PROPERTY_AUTO(int,textSize);
|
||||
QML_NAMED_ELEMENT(FluTheme)
|
||||
QML_SINGLETON
|
||||
public:
|
||||
explicit FluTheme(QObject *parent = nullptr);
|
||||
static FluTheme *getInstance();
|
||||
bool dark();
|
||||
Q_SIGNAL void darkChanged();
|
||||
private:
|
||||
static FluTheme* m_instance;
|
||||
bool _dark;
|
||||
bool eventFilter(QObject *obj, QEvent *event);
|
||||
bool systemDark();
|
||||
|
121
src/Fluent.cpp
121
src/Fluent.cpp
@ -1,121 +0,0 @@
|
||||
#include "Fluent.h"
|
||||
|
||||
#include <QFontDatabase>
|
||||
#include <QQmlContext>
|
||||
#include <QGuiApplication>
|
||||
#include <QQuickWindow>
|
||||
#include "FluColors.h"
|
||||
#include "NativeEventFilter.h"
|
||||
#include "FluTheme.h"
|
||||
#include "WindowHelper.h"
|
||||
#include "FluApp.h"
|
||||
#include "Def.h"
|
||||
|
||||
Fluent* Fluent::m_instance = nullptr;
|
||||
|
||||
Fluent *Fluent::getInstance()
|
||||
{
|
||||
if(Fluent::m_instance == nullptr){
|
||||
Fluent::m_instance = new Fluent;
|
||||
}
|
||||
return Fluent::m_instance;
|
||||
}
|
||||
|
||||
QString Fluent::version() const
|
||||
{
|
||||
return QStringLiteral(VERSION_IN);
|
||||
}
|
||||
|
||||
void Fluent::registerTypes(const char *uri){
|
||||
Q_INIT_RESOURCE(res);
|
||||
int major = 1;
|
||||
int minor = 0;
|
||||
|
||||
qmlRegisterType<WindowHelper>(uri,major,minor,"WindowHelper");
|
||||
qmlRegisterType<FluColorSet>(uri,major,minor,"FluColorSet");
|
||||
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluBreadcrumbBar.qml"),uri,major,minor,"FluBreadcrumbBar");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluRatingControl.qml"),uri,major,minor,"FluRatingControl");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluStatusView.qml"),uri,major,minor,"FluStatusView");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluPagination.qml"),uri,major,minor,"FluPagination");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluToggleButton.qml"),uri,major,minor,"FluToggleButton");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluTableView.qml"),uri,major,minor,"FluTableView");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluPivotItem.qml"),uri,major,minor,"FluPivotItem");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluPivot.qml"),uri,major,minor,"FluPivot");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluFlipView.qml"),uri,major,minor,"FluFlipView");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluPaneItemExpander.qml"),uri,major,minor,"FluPaneItemExpander");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluTabView.qml"),uri,major,minor,"FluTabView");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluArea.qml"),uri,major,minor,"FluArea");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluBadge.qml"),uri,major,minor,"FluBadge");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluMediaPlayer.qml"),uri,major,minor,"FluMediaPlayer");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluContentPage.qml"),uri,major,minor,"FluContentPage");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluScrollablePage.qml"),uri,major,minor,"FluScrollablePage");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluPaneItemHeader.qml"),uri,major,minor,"FluPaneItemHeader");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluPaneItem.qml"),uri,major,minor,"FluPaneItem");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluPaneItemSeparator.qml"),uri,major,minor,"FluPaneItemSeparator");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluNavigationView.qml"),uri,major,minor,"FluNavigationView");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluCalendarPicker.qml"),uri,major,minor,"FluCalendarPicker");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluCalendarView.qml"),uri,major,minor,"FluCalendarView");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluDatePicker.qml"),uri,major,minor,"FluDatePicker");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluTimePicker.qml"),uri,major,minor,"FluTimePicker");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluColorView.qml"),uri,major,minor,"FluColorView");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluColorPicker.qml"),uri,major,minor,"FluColorPicker");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluCarousel.qml"),uri,major,minor,"FluCarousel");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluAutoSuggestBox.qml"),uri,major,minor,"FluAutoSuggestBox");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluExpander.qml"),uri,major,minor,"FluExpander");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluTreeView.qml"),uri,major,minor,"FluTreeView");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluContentDialog.qml"),uri,major,minor,"FluContentDialog");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluMenuItem.qml"),uri,major,minor,"FluMenuItem");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluMenu.qml"),uri,major,minor,"FluMenu");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluScrollBar.qml"),uri,major,minor,"FluScrollBar");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluTextButton.qml"),uri,major,minor,"FluTextButton");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluMultilineTextBox.qml"),uri,major,minor,"FluMultilineTextBox");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluTooltip.qml"),uri,major,minor,"FluTooltip");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluDivider.qml"),uri,major,minor,"FluDivider");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluIcon.qml"),uri,major,minor,"FluIcon");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluObject.qml"),uri,major,minor,"FluObject");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluInfoBar.qml"),uri,major,minor,"FluInfoBar");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluWindow.qml"),uri,major,minor,"FluWindow");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluRectangle.qml"),uri,major,minor,"FluRectangle");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluAppBar.qml"),uri,major,minor,"FluAppBar");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluButton.qml"),uri,major,minor,"FluButton");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluCheckBox.qml"),uri,major,minor,"FluCheckBox");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluComboBox.qml"),uri,major,minor,"FluComboBox");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluDropDownButton.qml"),uri,major,minor,"FluDropDownButton");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluFilledButton.qml"),uri,major,minor,"FluFilledButton");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluIconButton.qml"),uri,major,minor,"FluIconButton");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluProgressBar.qml"),uri,major,minor,"FluProgressBar");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluProgressRing.qml"),uri,major,minor,"FluProgressRing");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluRadioButton.qml"),uri,major,minor,"FluRadioButton");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluSlider.qml"),uri,major,minor,"FluSlider");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluTextBox.qml"),uri,major,minor,"FluTextBox");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluPasswordBox.qml"),uri,major,minor,"FluPasswordBox");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluText.qml"),uri,major,minor,"FluText");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluFilledButton.qml"),uri,major,minor,"FluFilledButton");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluToggleSwitch.qml"),uri,major,minor,"FluToggleSwitch");
|
||||
|
||||
qmlRegisterUncreatableMetaObject(Fluent_Awesome::staticMetaObject, uri,major,minor,"FluentIcons", "Access to enums & flags only");
|
||||
qmlRegisterUncreatableMetaObject(Fluent_DarkMode::staticMetaObject, uri,major,minor,"FluDarkMode", "Access to enums & flags only");
|
||||
|
||||
}
|
||||
|
||||
void Fluent::initializeEngine(QQmlEngine *engine, const char *uri)
|
||||
{
|
||||
nativeEvent = new NativeEventFilter();
|
||||
qApp->installNativeEventFilter(nativeEvent);
|
||||
Q_UNUSED(engine)
|
||||
Q_UNUSED(uri)
|
||||
#ifdef Q_OS_WIN
|
||||
QFont font;
|
||||
font.setFamily("Microsoft YaHei");
|
||||
QGuiApplication::setFont(font);
|
||||
// QQuickWindow::setTextRenderType(QQuickWindow::NativeTextRendering);
|
||||
#endif
|
||||
QFontDatabase::addApplicationFont(":/com.zhuzichu/res/font/Segoe_Fluent_Icons.ttf");
|
||||
FluApp* app = FluApp::getInstance();
|
||||
engine->rootContext()->setContextProperty("FluApp",app);
|
||||
FluColors* colors = FluColors::getInstance();
|
||||
engine->rootContext()->setContextProperty("FluColors",colors);
|
||||
FluTheme* theme = FluTheme::getInstance();
|
||||
engine->rootContext()->setContextProperty("FluTheme",theme);
|
||||
}
|
27
src/Fluent.h
27
src/Fluent.h
@ -1,27 +0,0 @@
|
||||
#ifndef FLUENT_H
|
||||
#define FLUENT_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QQmlEngine>
|
||||
#include "NativeEventFilter.h"
|
||||
|
||||
class Fluent: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
Q_INVOKABLE QString version() const;
|
||||
~Fluent(){
|
||||
if (nativeEvent != Q_NULLPTR) {
|
||||
delete nativeEvent;
|
||||
nativeEvent = Q_NULLPTR;
|
||||
}
|
||||
}
|
||||
void registerTypes(const char *uri);
|
||||
void initializeEngine(QQmlEngine *engine, const char *uri);
|
||||
static Fluent *getInstance();
|
||||
private:
|
||||
static Fluent* m_instance;
|
||||
NativeEventFilter *nativeEvent = Q_NULLPTR;
|
||||
};
|
||||
|
||||
#endif // FLUENT_H
|
@ -1,15 +0,0 @@
|
||||
#include "FluentUI.h"
|
||||
#include "Fluent.h"
|
||||
|
||||
void FluentUI::registerTypes(const char *uri){
|
||||
Fluent::getInstance()->registerTypes(uri);
|
||||
}
|
||||
|
||||
void FluentUI::initializeEngine(QQmlEngine *engine, const char *uri){
|
||||
Fluent::getInstance()->initializeEngine(engine,uri);
|
||||
}
|
||||
|
||||
void FluentUI::initialize(QQmlEngine *engine){
|
||||
Fluent::getInstance()->registerTypes(URI_STR);
|
||||
Fluent::getInstance()->initializeEngine(engine,URI_STR);
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
#ifndef FLUENTUI_H
|
||||
#define FLUENTUI_H
|
||||
|
||||
#include <QQmlEngine>
|
||||
|
||||
class Q_DECL_EXPORT FluentUI
|
||||
{
|
||||
|
||||
public:
|
||||
static void registerTypes(const char *uri) ;
|
||||
static void initializeEngine(QQmlEngine *engine, const char *uri);
|
||||
static void initialize(QQmlEngine *engine);
|
||||
};
|
||||
|
||||
#endif // FLUENTUI_H
|
@ -1,51 +0,0 @@
|
||||
QT += qml quick svg
|
||||
CONFIG += plugin c++17
|
||||
TEMPLATE = lib
|
||||
TARGET = FluentUI
|
||||
TARGET = $$qtLibraryTarget($$TARGET)
|
||||
uri = FluentUI
|
||||
|
||||
CONFIG += sharedlib # staticlib or sharedlib
|
||||
|
||||
RESOURCES += \
|
||||
res.qrc
|
||||
|
||||
HEADERS += \
|
||||
Def.h \
|
||||
FluApp.h \
|
||||
FluColorSet.h \
|
||||
FluColors.h \
|
||||
FluRegister.h \
|
||||
FluTheme.h \
|
||||
Fluent.h \
|
||||
FluentUI.h \
|
||||
NativeEventFilter.h \
|
||||
WindowHelper.h \
|
||||
qml_plugin.h \
|
||||
stdafx.h
|
||||
|
||||
SOURCES += \
|
||||
Def.cpp \
|
||||
FluApp.cpp \
|
||||
FluColorSet.cpp \
|
||||
FluColors.cpp \
|
||||
FluRegister.cpp \
|
||||
FluTheme.cpp \
|
||||
Fluent.cpp \
|
||||
FluentUI.cpp \
|
||||
NativeEventFilter.cpp \
|
||||
WindowHelper.cpp \
|
||||
qml_plugin.cpp \
|
||||
|
||||
win32 {
|
||||
LIBS += -ldwmapi -luser32
|
||||
}
|
||||
|
||||
DEFINES += VERSION_IN=\\\"1.0.0\\\"
|
||||
DEFINES += URI_STR=\\\"$$uri\\\"
|
||||
|
||||
contains(QMAKE_HOST.os,Windows) {
|
||||
include(./build_windows.pri)
|
||||
}else{
|
||||
include(./build_macos.pri)
|
||||
}
|
@ -11,11 +11,11 @@
|
||||
bool NativeEventFilter::nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result)
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
if (eventType == "windows_generic_MSG" && FluTheme::getInstance()->frameless()) {
|
||||
if (eventType == "windows_generic_MSG" && FluApp::fluTheme->frameless()) {
|
||||
MSG* msg = static_cast<MSG *>(message);
|
||||
if (msg == Q_NULLPTR)
|
||||
return false;
|
||||
if(!FluApp::getInstance()->wnds.contains((WId)msg->hwnd)){
|
||||
if(!FluApp::fluApp->wnds.contains((WId)msg->hwnd)){
|
||||
return false;
|
||||
}
|
||||
switch(msg->message) {
|
||||
@ -27,7 +27,7 @@ bool NativeEventFilter::nativeEventFilter(const QByteArray &eventType, void *mes
|
||||
return true;
|
||||
}
|
||||
case WM_NCHITTEST: {
|
||||
auto view = FluApp::getInstance()->wnds[(WId)msg->hwnd];
|
||||
auto view = FluApp::fluApp->wnds[(WId)msg->hwnd];
|
||||
bool isResize = !(view->maximumWidth()==view->minimumWidth()&&view->maximumHeight()==view->minimumHeight());
|
||||
const LONG borderWidth = 8;
|
||||
RECT winrect;
|
||||
|
@ -30,7 +30,7 @@ void WindowHelper::initWindow(QQuickWindow* window){
|
||||
void WindowHelper::firstUpdate(){
|
||||
if(isFisrt){
|
||||
#ifdef Q_OS_WIN
|
||||
if(FluTheme::getInstance()->frameless()){
|
||||
if(FluApp::fluTheme->frameless()){
|
||||
HWND wnd = (HWND)window->winId();
|
||||
SetWindowLongPtr(wnd, GWL_STYLE, static_cast<LONG>(Style::aero_borderless));
|
||||
const MARGINS shadow_on = { 1, 1, 1, 1 };
|
||||
@ -54,7 +54,7 @@ QVariant WindowHelper::createRegister(QQuickWindow* window,const QString& path){
|
||||
|
||||
void WindowHelper::destoryWindow(){
|
||||
if(this->window){
|
||||
FluApp::getInstance()->wnds.remove(this->window->winId());
|
||||
FluApp::fluApp->wnds.remove(this->window->winId());
|
||||
this->window->deleteLater();
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
#include <QObject>
|
||||
#include <QQuickWindow>
|
||||
#include <QtQml/qqml.h>
|
||||
#include <QQuickItem>
|
||||
#include <QWindow>
|
||||
#include <QJsonObject>
|
||||
@ -10,14 +11,13 @@
|
||||
class WindowHelper : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
QML_NAMED_ELEMENT(WindowHelper)
|
||||
public:
|
||||
explicit WindowHelper(QObject *parent = nullptr);
|
||||
|
||||
Q_INVOKABLE void initWindow(QQuickWindow* window);
|
||||
Q_INVOKABLE void destoryWindow();
|
||||
Q_INVOKABLE QVariant createRegister(QQuickWindow* window,const QString& path);
|
||||
|
||||
Q_INVOKABLE void firstUpdate();
|
||||
|
||||
private:
|
||||
|
@ -1,4 +0,0 @@
|
||||
module FluentUI
|
||||
plugin FluentUI
|
||||
classname FluentUIQmlPlugin
|
||||
typeinfo plugin.qmltypes
|
@ -1,32 +0,0 @@
|
||||
set(OUTP ${CMAKE_BINARY_DIR}/bin/FluentUI/)
|
||||
|
||||
add_definitions(-DMACOS)
|
||||
|
||||
set(CMAKE_INSTALL_PREFIX ${OUTP})
|
||||
set(CMAKE_INSTALL_DESTDIR ${OUTP})
|
||||
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
set(QMAKE_MOC_OPTIONS -Muri=${uri})
|
||||
|
||||
add_custom_command(
|
||||
TARGET ${PROJECT_NAME} POST_BUILD
|
||||
COMMAND chmod -R 777 ${CMAKE_CURRENT_SOURCE_DIR}/macos_install.sh
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
TARGET ${PROJECT_NAME} POST_BUILD
|
||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/macos_install.sh PRESET ${CMAKE_CURRENT_SOURCE_DIR}/ ${OUTP}
|
||||
)
|
||||
|
||||
|
||||
|
||||
if(${TARGET_TYPE} STREQUAL "SHARED")
|
||||
|
||||
set(INST_QMLPATH ${QT_INSTALL_QML}/FluentUI)
|
||||
add_custom_command(
|
||||
TARGET ${PROJECT_NAME} POST_BUILD
|
||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/macos_install.sh INSTALL ${CMAKE_CURRENT_SOURCE_DIR}/ ${OUTP} ${INST_QMLPATH}
|
||||
)
|
||||
|
||||
endif()
|
@ -1,17 +0,0 @@
|
||||
OUTP = $$OUT_PWD/../bin/FluentUI/
|
||||
|
||||
DESTDIR += $$OUTP
|
||||
|
||||
QMAKE_MOC_OPTIONS += -Muri=$$uri
|
||||
QMAKE_PRE_LINK += chmod -R 777 $$PWD/macos_install.sh;
|
||||
QMAKE_PRE_LINK += $$PWD/macos_install.sh PRESET $$PWD/ $$OUTP;
|
||||
|
||||
CONFIG(sharedlib){
|
||||
INST_QMLPATH = $$[QT_INSTALL_QML]/$$replace(uri, \\., /)
|
||||
|
||||
QMAKE_POST_LINK += $$PWD/macos_install.sh INSTALL $$PWD/ $$OUTP $$INST_QMLPATH;
|
||||
|
||||
exists($$PWD/../../dev.pri){
|
||||
include($$PWD/../../dev.pri)
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
set(OUTP "${CMAKE_BINARY_DIR}/bin/FluentUI")
|
||||
set(BUILDBIN_PATH "${OUTP}")
|
||||
set(QTQMLFLUENT_PATH "${QT_INSTALL_QML}/FluentUI")
|
||||
set(PRESET_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build-preset")
|
||||
set(SOLIBFILE_PATH "${CMAKE_BINARY_DIR}/libFluentUI.so")
|
||||
set(ANDROID NO)
|
||||
if (ANDROID)
|
||||
set(ANDROID YES)
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${OUTP})
|
||||
else()
|
||||
set(CMAKE_INSTALL_PREFIX "${OUTP}")
|
||||
endif()
|
||||
set(SHAREDSCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/win_install.bat SHARED ${CMAKE_CURRENT_SOURCE_DIR} ${PRESET_PATH} ${BUILDBIN_PATH} ${QTQMLFLUENT_PATH} ${ANDROID} ${SOLIBFILE_PATH})
|
||||
set(STATICSCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/win_install.bat STATIC ${CMAKE_CURRENT_SOURCE_DIR} ${PRESET_PATH} ${BUILDBIN_PATH} ${QTQMLFLUENT_PATH} ${ANDROID} ${SOLIBFILE_PATH})
|
||||
string(REPLACE "/" "\\" SHAREDSCRIPT "${SHAREDSCRIPT}")
|
||||
string(REPLACE "/" "\\" STATICSCRIPT "${STATICSCRIPT}")
|
||||
if (${TARGET_TYPE} STREQUAL "SHARED")
|
||||
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
||||
COMMAND ${SHAREDSCRIPT}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
else()
|
||||
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
||||
COMMAND ${STATICSCRIPT}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
endif()
|
@ -1,20 +0,0 @@
|
||||
OUTP = $$OUT_PWD/../bin/FluentUI
|
||||
BUILDBIN_PATH = $$replace(OUTP, src/../bin, bin)
|
||||
QTQMLFLUENT_PATH = $$[QT_INSTALL_QML]/FluentUI
|
||||
PRESET_PATH = $$PWD/build-preset
|
||||
SOLIBFILE_PATH = $$OUT_PWD/libFluentUI.so
|
||||
ANDROID = NO
|
||||
android{
|
||||
ANDROID=YES
|
||||
QMAKE_PRE_LINK *= md $$replace(OUTP, /, \\)
|
||||
}else{
|
||||
DESTDIR += $$OUTP
|
||||
}
|
||||
SHAREDSCRIPT = "$$PWD\win_install.bat" SHARED "$$PWD" "$$PRESET_PATH" "$$BUILDBIN_PATH" "$$QTQMLFLUENT_PATH" $$ANDROID "$$SOLIBFILE_PATH"
|
||||
STATICSCRIPT = "$$PWD\win_install.bat" STATIC "$$PWD" "$$PRESET_PATH" "$$BUILDBIN_PATH" "$$QTQMLFLUENT_PATH" $$ANDROID "$$SOLIBFILE_PATH"
|
||||
CONFIG(sharedlib){
|
||||
QMAKE_POST_LINK *= $$replace(SHAREDSCRIPT, /, \\)
|
||||
}
|
||||
else{
|
||||
QMAKE_POST_LINK *= $$replace(STATICSCRIPT, /, \\)
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import "content"
|
||||
import "Content"
|
||||
|
||||
Rectangle {
|
||||
id: colorPicker
|
@ -1,4 +1,6 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import FluentUI
|
||||
|
||||
Rectangle{
|
||||
|
@ -1,5 +1,7 @@
|
||||
import QtQuick
|
||||
import "../colorpicker"
|
||||
import QtQuick.Controls
|
||||
import FluentUI
|
||||
import "ColorPicker"
|
||||
|
||||
Item {
|
||||
|
@ -1,4 +1,5 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import FluentUI
|
||||
|
||||
Item {
|
@ -2,6 +2,7 @@
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Window
|
||||
import FluentUI
|
||||
|
||||
Popup {
|
||||
id: popup
|
@ -1,4 +1,5 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import FluentUI
|
||||
|
||||
Item {
|
@ -1,4 +1,6 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import FluentUI
|
||||
|
||||
Text {
|
||||
|
@ -1,4 +1,5 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import FluentUI
|
||||
|
||||
FluObject {
|
@ -1,6 +1,7 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import FluentUI
|
||||
|
||||
Menu {
|
||||
|
@ -1,5 +1,6 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import FluentUI
|
||||
|
||||
Item {
|
||||
|
||||
@ -16,7 +17,6 @@ Item {
|
||||
}
|
||||
height: 32
|
||||
|
||||
|
||||
Rectangle{
|
||||
anchors.centerIn: parent
|
||||
width: control.width-40
|
@ -1,4 +1,6 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import FluentUI
|
||||
|
||||
QtObject {
|
||||
id:flu_object;
|
@ -1,4 +1,5 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import FluentUI
|
||||
|
||||
QtObject {
|
@ -1,4 +1,6 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import FluentUI
|
||||
|
||||
QtObject {
|
||||
readonly property string key : FluApp.uuid()
|
@ -1,4 +1,5 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import FluentUI
|
||||
|
||||
FluObject {
|
@ -1,4 +1,6 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import FluentUI
|
||||
|
||||
QtObject {
|
||||
readonly property string key : FluApp.uuid()
|
@ -1,4 +1,6 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import FluentUI
|
||||
|
||||
QtObject {
|
||||
readonly property string key : FluApp.uuid()
|
@ -1,4 +1,5 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import FluentUI
|
||||
|
||||
QtObject {
|
@ -1,5 +1,6 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import FluentUI
|
||||
|
||||
FluRectangle {
|
||||
|
@ -1,5 +1,6 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import FluentUI
|
||||
|
||||
Rectangle {
|
||||
|
@ -1,6 +1,7 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import Qt5Compat.GraphicalEffects
|
||||
import FluentUI
|
||||
|
||||
Item{
|
||||
|
@ -1,4 +1,6 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import FluentUI
|
||||
|
||||
Item {
|
||||
|
15
src/imports/FluentUI/Controls/FluSingleton.qml
Normal file
15
src/imports/FluentUI/Controls/FluSingleton.qml
Normal file
@ -0,0 +1,15 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import FluentUI
|
||||
|
||||
QtObject {
|
||||
|
||||
id:control
|
||||
|
||||
Component.onCompleted: {
|
||||
FluApp.setFluApp(FluApp)
|
||||
FluApp.setFluColors(FluColors)
|
||||
FluApp.setFluTheme(FluTheme)
|
||||
}
|
||||
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import Qt5Compat.GraphicalEffects
|
||||
import FluentUI
|
||||
|
||||
Item{
|
||||
|
@ -1,4 +1,5 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import FluentUI
|
||||
|
||||
Text {
|
@ -1,5 +1,7 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import Qt5Compat.GraphicalEffects
|
||||
import FluentUI
|
||||
|
||||
Rectangle{
|
||||
|
@ -1,5 +1,7 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Window
|
||||
import FluentUI
|
||||
|
||||
MouseArea {
|
||||
|
68
src/imports/FluentUI/qmldir
Normal file
68
src/imports/FluentUI/qmldir
Normal file
@ -0,0 +1,68 @@
|
||||
module FluentUI
|
||||
FluAppBar 1.0 FluAppBar.qml
|
||||
FluArea 1.0 FluArea.qml
|
||||
FluAutoSuggestBox 1.0 FluAutoSuggestBox.qml
|
||||
FluBadge 1.0 FluBadge.qml
|
||||
FluBreadcrumbBar 1.0 FluBreadcrumbBar.qml
|
||||
FluButton 1.0 FluButton.qml
|
||||
FluCalendarPicker 1.0 FluCalendarPicker.qml
|
||||
FluCalendarView 1.0 FluCalendarView.qml
|
||||
FluCarousel 1.0 FluCarousel.qml
|
||||
FluCheckBox 1.0 FluCheckBox.qml
|
||||
FluColorPicker 1.0 FluColorPicker.qml
|
||||
FluColorView 1.0 FluColorView.qml
|
||||
FluComboBox 1.0 FluComboBox.qml
|
||||
FluContentDialog 1.0 FluContentDialog.qml
|
||||
FluContentPage 1.0 FluContentPage.qml
|
||||
FluDatePicker 1.0 FluDatePicker.qml
|
||||
FluDivider 1.0 FluDivider.qml
|
||||
FluDropDownButton 1.0 FluDropDownButton.qml
|
||||
FluExpander 1.0 FluExpander.qml
|
||||
FluFilledButton 1.0 FluFilledButton.qml
|
||||
FluFlipView 1.0 FluFlipView.qml
|
||||
FluFocusRectangle 1.0 FluFocusRectangle.qml
|
||||
FluIcon 1.0 FluIcon.qml
|
||||
FluIconButton 1.0 FluIconButton.qml
|
||||
FluInfoBar 1.0 FluInfoBar.qml
|
||||
FluItem 1.0 FluItem.qml
|
||||
FluMediaPlayer 1.0 FluMediaPlayer.qml
|
||||
FluMenu 1.0 FluMenu.qml
|
||||
FluMenuItem 1.0 FluMenuItem.qml
|
||||
FluMultilineTextBox 1.0 FluMultilineTextBox.qml
|
||||
FluNavigationView 1.0 FluNavigationView.qml
|
||||
FluObject 1.0 FluObject.qml
|
||||
FluPagination 1.0 FluPagination.qml
|
||||
FluPaneItem 1.0 FluPaneItem.qml
|
||||
FluPaneItemEmpty 1.0 FluPaneItemEmpty.qml
|
||||
FluPaneItemExpander 1.0 FluPaneItemExpander.qml
|
||||
FluPaneItemHeader 1.0 FluPaneItemHeader.qml
|
||||
FluPaneItemSeparator 1.0 FluPaneItemSeparator.qml
|
||||
FluPasswordBox 1.0 FluPasswordBox.qml
|
||||
FluPivot 1.0 FluPivot.qml
|
||||
FluPivotItem 1.0 FluPivotItem.qml
|
||||
FluProgressBar 1.0 FluProgressBar.qml
|
||||
FluProgressRing 1.0 FluProgressRing.qml
|
||||
FluRadioButton 1.0 FluRadioButton.qml
|
||||
FluRatingControl 1.0 FluRatingControl.qml
|
||||
FluRectangle 1.0 FluRectangle.qml
|
||||
FluScrollablePage 1.0 FluScrollablePage.qml
|
||||
FluScrollBar 1.0 FluScrollBar.qml
|
||||
FluShadow 1.0 FluShadow.qml
|
||||
FluSlider 1.0 FluSlider.qml
|
||||
FluStatusView 1.0 FluStatusView.qml
|
||||
FluTableView 1.0 FluTableView.qml
|
||||
FluTabView 1.0 FluTabView.qml
|
||||
FluText 1.0 FluText.qml
|
||||
FluTextBox 1.0 FluTextBox.qml
|
||||
FluTextBoxBackground 1.0 FluTextBoxBackground.qml
|
||||
FluTextBoxMenu 1.0 FluTextBoxMenu.qml
|
||||
FluTextButton 1.0 FluTextButton.qml
|
||||
FluTimePicker 1.0 FluTimePicker.qml
|
||||
FluToggleButton 1.0 FluToggleButton.qml
|
||||
FluToggleSwitch 1.0 FluToggleSwitch.qml
|
||||
FluTooltip 1.0 FluTooltip.qml
|
||||
FluTreeView 1.0 FluTreeView.qml
|
||||
FluWindow 1.0 FluWindow.qml
|
||||
FluWindowResize 1.0 FluWindowResize.qml
|
||||
FluSingleton 1.0 FluSingleton.qml
|
||||
plugin fluentuiplugin
|
@ -1,14 +0,0 @@
|
||||
RUN_TYPE=$1
|
||||
PRESET_PATH=$2
|
||||
BUILDER_BIN_PATH=$3
|
||||
QT_QML_FLUENT_PATH=$4
|
||||
|
||||
echo ${RUN_TYPE}
|
||||
if [ ${RUN_TYPE} = "PRESET" ]; then
|
||||
cp -r ${PRESET_PATH}/FluentUI.h ${BUILDER_BIN_PATH}
|
||||
cp -r ${PRESET_PATH}/build-preset/* ${BUILDER_BIN_PATH}
|
||||
else
|
||||
rm -rf ${QT_QML_FLUENT_PATH=}
|
||||
mkdir -pv ${QT_QML_FLUENT_PATH=}
|
||||
cp -r ${BUILDER_BIN_PATH}/* ${QT_QML_FLUENT_PATH=}
|
||||
fi
|
@ -1,12 +0,0 @@
|
||||
#include "qml_plugin.h"
|
||||
|
||||
void FluentUIQmlPlugin::registerTypes(const char *uri)
|
||||
{
|
||||
FluentUI::registerTypes(uri);
|
||||
}
|
||||
|
||||
void FluentUIQmlPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
|
||||
{
|
||||
FluentUI::initializeEngine(engine,uri);
|
||||
}
|
||||
|
@ -1,14 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <QQmlExtensionPlugin>
|
||||
#include <FluentUI.h>
|
||||
|
||||
class FluentUIQmlPlugin : public QQmlExtensionPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
|
||||
|
||||
public:
|
||||
void registerTypes(const char *uri) override;
|
||||
void initializeEngine(QQmlEngine *engine, const char *uri) override;
|
||||
};
|
76
src/res.qrc
76
src/res.qrc
@ -1,76 +0,0 @@
|
||||
<RCC>
|
||||
<qresource prefix="/com.zhuzichu">
|
||||
<file>controls/FluButton.qml</file>
|
||||
<file>controls/FluFilledButton.qml</file>
|
||||
<file>controls/FluText.qml</file>
|
||||
<file>controls/FluToggleSwitch.qml</file>
|
||||
<file>controls/FluIconButton.qml</file>
|
||||
<file>controls/FluCheckBox.qml</file>
|
||||
<file>controls/FluRadioButton.qml</file>
|
||||
<file>controls/FluSlider.qml</file>
|
||||
<file>controls/FluProgressRing.qml</file>
|
||||
<file>controls/FluProgressBar.qml</file>
|
||||
<file>controls/FluComboBox.qml</file>
|
||||
<file>controls/FluDropDownButton.qml</file>
|
||||
<file>controls/FluTextBox.qml</file>
|
||||
<file>controls/FluTimePicker.qml</file>
|
||||
<file>controls/FluAppBar.qml</file>
|
||||
<file>controls/FluRectangle.qml</file>
|
||||
<file>controls/FluWindow.qml</file>
|
||||
<file>controls/FluInfoBar.qml</file>
|
||||
<file>controls/FluObject.qml</file>
|
||||
<file>controls/FluIcon.qml</file>
|
||||
<file>controls/FluDivider.qml</file>
|
||||
<file>controls/FluTooltip.qml</file>
|
||||
<file>controls/FluTextBoxBackground.qml</file>
|
||||
<file>controls/FluWindowResize.qml</file>
|
||||
<file>controls/FluScrollBar.qml</file>
|
||||
<file>controls/FluMenu.qml</file>
|
||||
<file>controls/FluMenuItem.qml</file>
|
||||
<file>controls/FluShadow.qml</file>
|
||||
<file>controls/FluTextButton.qml</file>
|
||||
<file>controls/FluContentDialog.qml</file>
|
||||
<file>controls/FluTreeView.qml</file>
|
||||
<file>controls/FluExpander.qml</file>
|
||||
<file>controls/FluAutoSuggestBox.qml</file>
|
||||
<file>controls/FluNavigationView.qml</file>
|
||||
<file>controls/FluPaneItem.qml</file>
|
||||
<file>controls/FluPaneItemHeader.qml</file>
|
||||
<file>controls/FluPaneItemSeparator.qml</file>
|
||||
<file>controls/FluScrollablePage.qml</file>
|
||||
<file>controls/FluContentPage.qml</file>
|
||||
<file>controls/FluArea.qml</file>
|
||||
<file>res/font/Segoe_Fluent_Icons.ttf</file>
|
||||
<file>controls/FluDatePicker.qml</file>
|
||||
<file>controls/FluCalendarView.qml</file>
|
||||
<file>controls/FluCalendarPicker.qml</file>
|
||||
<file>controls/FluFocusRectangle.qml</file>
|
||||
<file>controls/FluCarousel.qml</file>
|
||||
<file>controls/FluBadge.qml</file>
|
||||
<file>controls/FluColorView.qml</file>
|
||||
<file>controls/FluColorPicker.qml</file>
|
||||
<file>colorpicker/ColorPicker.qml</file>
|
||||
<file>colorpicker/content/Checkerboard.qml</file>
|
||||
<file>colorpicker/content/ColorSlider.qml</file>
|
||||
<file>colorpicker/content/NumberBox.qml</file>
|
||||
<file>colorpicker/content/PanelBorder.qml</file>
|
||||
<file>colorpicker/content/SBPicker.qml</file>
|
||||
<file>controls/FluMediaPlayer.qml</file>
|
||||
<file>controls/FluTabView.qml</file>
|
||||
<file>controls/FluItem.qml</file>
|
||||
<file>controls/FluPaneItemExpander.qml</file>
|
||||
<file>controls/FluTextBoxMenu.qml</file>
|
||||
<file>controls/FluMultilineTextBox.qml</file>
|
||||
<file>controls/FluFlipView.qml</file>
|
||||
<file>controls/FluPivot.qml</file>
|
||||
<file>controls/FluPivotItem.qml</file>
|
||||
<file>controls/FluTableView.qml</file>
|
||||
<file>controls/FluPagination.qml</file>
|
||||
<file>controls/FluToggleButton.qml</file>
|
||||
<file>controls/FluStatusView.qml</file>
|
||||
<file>controls/FluPaneItemEmpty.qml</file>
|
||||
<file>controls/FluRatingControl.qml</file>
|
||||
<file>controls/FluPasswordBox.qml</file>
|
||||
<file>controls/FluBreadcrumbBar.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user