Compare commits

...

2 Commits

Author SHA1 Message Date
朱子楚\zhuzi
44acdbcf7f update 2024-04-11 20:29:59 +08:00
朱子楚\zhuzi
3997daaa11 update 2024-04-11 19:18:37 +08:00
29 changed files with 1541 additions and 1509 deletions

View File

@ -171,10 +171,5 @@ if (CMAKE_BUILD_TYPE MATCHES "Release")
SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
target_sources(Script-DeployRelease
PRIVATE
src/component/OpenGLItem.h src/component/OpenGLItem.cpp
)
endif ()
endif ()

View File

@ -127,7 +127,6 @@
<file>qml/global/ItemsOriginal.qml</file>
<file>qml/global/qmldir</file>
<file>qml/page/T_Acrylic.qml</file>
<file>qml/page/T_Awesome.qml</file>
<file>qml/page/T_Badge.qml</file>
<file>qml/page/T_BreadcrumbBar.qml</file>
<file>qml/page/T_Buttons.qml</file>
@ -210,6 +209,7 @@
<file>res/image/bg_scenic.jpg</file>
<file>qml/window/FluentInitializrWindow.qml</file>
<file>qml/page/T_OpenGL.qml</file>
<file>qml/page/T_Icons.qml</file>
</qresource>
<qresource prefix="/"/>
</RCC>

View File

@ -425,7 +425,7 @@
</message>
<message>
<location filename="qml/global/ItemsOriginal.qml" line="367"/>
<source>Awesome</source>
<source>Icons</source>
<translation type="unfinished"></translation>
</message>
<message>
@ -774,29 +774,6 @@ Updated content:
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>T_Awesome</name>
<message>
<location filename="qml/page/T_Awesome.qml" line="9"/>
<source>Awesome</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Awesome.qml" line="13"/>
<source>Please enter a keyword</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Awesome.qml" line="20"/>
<source>Search</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Awesome.qml" line="55"/>
<source>You Copied </source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>T_Badge</name>
<message>
@ -1386,6 +1363,29 @@ My only desire is to be permitted to drive out the traitors and restore the Han.
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>T_Icons</name>
<message>
<location filename="qml/page/T_Icons.qml" line="9"/>
<source>Icons</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Icons.qml" line="13"/>
<source>Please enter a keyword</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Icons.qml" line="20"/>
<source>Search</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Icons.qml" line="60"/>
<source>You Copied </source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>T_Image</name>
<message>

View File

@ -425,7 +425,7 @@
</message>
<message>
<location filename="qml/global/ItemsOriginal.qml" line="367"/>
<source>Awesome</source>
<source>Icons</source>
<translation type="unfinished"></translation>
</message>
<message>
@ -781,24 +781,20 @@ Updated content:
<context>
<name>T_Awesome</name>
<message>
<location filename="qml/page/T_Awesome.qml" line="9"/>
<source>Awesome</source>
<translation type="unfinished"></translation>
<translation type="obsolete"></translation>
</message>
<message>
<location filename="qml/page/T_Awesome.qml" line="13"/>
<source>Please enter a keyword</source>
<translation type="unfinished"></translation>
<translation type="obsolete"></translation>
</message>
<message>
<location filename="qml/page/T_Awesome.qml" line="20"/>
<source>Search</source>
<translation type="unfinished"></translation>
<translation type="obsolete"></translation>
</message>
<message>
<location filename="qml/page/T_Awesome.qml" line="55"/>
<source>You Copied </source>
<translation type="unfinished"></translation>
<translation type="obsolete"></translation>
</message>
</context>
<context>
@ -1417,6 +1413,29 @@ My only desire is to be permitted to drive out the traitors and restore the Han.
<translation type="unfinished">FluentUI Fluent UI </translation>
</message>
</context>
<context>
<name>T_Icons</name>
<message>
<location filename="qml/page/T_Icons.qml" line="9"/>
<source>Icons</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Icons.qml" line="13"/>
<source>Please enter a keyword</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Icons.qml" line="20"/>
<source>Search</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_Icons.qml" line="60"/>
<source>You Copied </source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>T_Image</name>
<message>

View File

@ -364,9 +364,9 @@ FluObject{
onTap: { navigationView.push(url) }
}
FluPaneItem{
title: qsTr("Awesome")
title: qsTr("Icons")
menuDelegate: paneItemMenu
url: "qrc:/example/qml/page/T_Awesome.qml"
url: "qrc:/example/qml/page/T_Icons.qml"
onTap: { navigationView.push(url) }
}
}

View File

@ -6,13 +6,13 @@ import FluentUI 1.0
FluContentPage {
title: qsTr("Awesome")
title: qsTr("Icons")
FluTextBox{
id:text_box
id: text_box
placeholderText: qsTr("Please enter a keyword")
anchors{
top:parent.top
top: parent.top
}
}
@ -28,43 +28,45 @@ FluContentPage {
}
}
GridView{
id:grid_view
cellWidth: 80
cellHeight: 80
id: grid_view
cellWidth: 110
cellHeight: 110
clip: true
boundsBehavior: GridView.StopAtBounds
model:FluTheme.awesomeList()
ScrollBar.vertical: FluScrollBar {}
anchors{
topMargin: 10
top:text_box.bottom
top: text_box.bottom
left: parent.left
right: parent.right
bottom: parent.bottom
}
delegate: Item {
width: 68
height: 80
width: 100
height: 100
FluIconButton{
id:item_icon
iconSource:modelData.icon
anchors.horizontalCenter: parent.horizontalCenter
iconSource: modelData.icon
iconSize: 30
padding: 0
verticalPadding: 0
horizontalPadding: 0
bottomPadding: 30
anchors.fill: parent
onClicked: {
var text ="FluentIcons."+modelData.name;
FluTools.clipText(text)
showSuccess(qsTr("You Copied ")+text)
}
}
FluText {
id:item_name
font.pixelSize: 10
font.family: FluTextStyle.family
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: item_icon.bottom
width:parent.width
wrapMode: Text.WrapAnywhere
text: modelData.name
horizontalAlignment: Text.AlignHCenter
FluText{
width: parent.width
horizontalAlignment: Qt.AlignHCenter
wrapMode: Text.WrapAnywhere
text: modelData.name
anchors.top: parent.top
anchors.topMargin: 60
}
}
}
}

View File

@ -14,5 +14,5 @@ private:
public:
SINGLETON(AppInfo)
Q_INVOKABLE [[maybe_unused]] void testCrash();
[[maybe_unused]] Q_INVOKABLE void testCrash();
};

View File

@ -21,4 +21,4 @@ private: \
public: \
static Class* getInstance() { \
return Singleton<Class>::getInstance(); \
}
} \

View File

@ -13,7 +13,7 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
#
add_definitions(-DFLUENTUI_VERSION=1,7,4,0)
add_definitions(-DFLUENTUI_VERSION=1,7,5,0)
if (FLUENTUI_BUILD_STATIC_LIB)
add_definitions(-DFLUENTUI_BUILD_STATIC_LIB)

1413
src/Def.h

File diff suppressed because it is too large Load Diff

View File

@ -8,6 +8,7 @@
#include <QFontDatabase>
#include <QClipboard>
#include <QTranslator>
#include <utility>
FluApp::FluApp(QObject *parent) : QObject{parent} {
_useSystemAppBar = false;
@ -16,10 +17,10 @@ FluApp::FluApp(QObject *parent) : QObject{parent} {
FluApp::~FluApp() = default;
void FluApp::init(QObject *target, QLocale locale) {
_locale = locale;
_locale = std::move(locale);
_engine = qmlEngine(target);
_translator = new QTranslator(this);
qApp->installTranslator(_translator);
QGuiApplication::installTranslator(_translator);
const QStringList uiLanguages = _locale.uiLanguages();
for (const QString &name: uiLanguages) {
const QString baseName = "fluentui_" + QLocale(name).name();

View File

@ -11,6 +11,9 @@ int generaNumber(int number) {
FluCaptcha::FluCaptcha(QQuickItem *parent) : QQuickPaintedItem(parent) {
_ignoreCase = false;
QFont fontStyle;
#ifdef Q_OS_WIN
fontStyle.setFamily("微软雅黑");
#endif
fontStyle.setPixelSize(28);
fontStyle.setBold(true);
font(fontStyle);

View File

@ -22,7 +22,7 @@ public:
Q_INVOKABLE void refresh();
Q_INVOKABLE [[maybe_unused]] bool verify(const QString &code);
[[maybe_unused]] Q_INVOKABLE bool verify(const QString &code);
private:
QString _code;

View File

@ -109,14 +109,14 @@ FluColors::FluColors(QObject *parent) : QObject{parent} {
_Green = green;
}
[[maybe_unused]] FluAccentColor *FluColors::createAccentColor(QColor primaryColor) {
[[maybe_unused]] FluAccentColor *FluColors::createAccentColor(const QColor& primaryColor) {
auto accentColor = new FluAccentColor(this);
accentColor->darkest(FluTools::getInstance()->withOpacity(primaryColor, 0.7));
accentColor->darker(FluTools::getInstance()->withOpacity(primaryColor, 0.8));
accentColor->dark(FluTools::getInstance()->withOpacity(primaryColor, 0.9));
accentColor->normal(primaryColor);
accentColor->dark(FluTools::getInstance()->withOpacity(primaryColor, 0.9));
accentColor->light(FluTools::getInstance()->withOpacity(primaryColor, 0.9));
accentColor->lighter(FluTools::getInstance()->withOpacity(primaryColor, 0.8));
accentColor->lightest(FluTools::getInstance()->withOpacity(primaryColor, 0.7));
accentColor->darker(FluTools::getInstance()->withOpacity(accentColor->dark(), 0.8));
accentColor->lighter(FluTools::getInstance()->withOpacity(accentColor->light(), 0.8));
accentColor->darkest(FluTools::getInstance()->withOpacity(accentColor->darker(), 0.7));
accentColor->lightest(FluTools::getInstance()->withOpacity(accentColor->lighter(), 0.7));
return accentColor;
}

View File

@ -55,7 +55,7 @@ private:
public:
SINGLETON(FluColors)
Q_INVOKABLE [[maybe_unused]] FluAccentColor *createAccentColor(QColor primaryColor);
[[maybe_unused]] Q_INVOKABLE FluAccentColor *createAccentColor(const QColor& primaryColor);
static FluColors *create(QQmlEngine *, QJSEngine *) { return getInstance(); }
};

View File

@ -33,17 +33,17 @@ public:
[[maybe_unused]] bool nativeEventFilter(const QByteArray &eventType, void *message, QT_NATIVE_EVENT_RESULT_TYPE *result) override;
Q_INVOKABLE [[maybe_unused]] void showFullScreen();
[[maybe_unused]] Q_INVOKABLE void showFullScreen();
Q_INVOKABLE void showMaximized();
Q_INVOKABLE [[maybe_unused]] void showMinimized();
[[maybe_unused]] Q_INVOKABLE void showMinimized();
Q_INVOKABLE void showNormal();
Q_INVOKABLE void setHitTestVisible(QQuickItem *);
Q_INVOKABLE [[maybe_unused]] void onDestruction();
[[maybe_unused]] Q_INVOKABLE void onDestruction();
protected:
bool eventFilter(QObject *obj, QEvent *event) override;

View File

@ -19,15 +19,15 @@ public:
bool lessThan(const QModelIndex &sourceLeft, const QModelIndex &sourceRight) const override;
Q_INVOKABLE [[maybe_unused]] QVariant getRow(int rowIndex);
[[maybe_unused]] Q_INVOKABLE QVariant getRow(int rowIndex);
Q_INVOKABLE [[maybe_unused]] void setRow(int rowIndex, const QVariant &val);
[[maybe_unused]] Q_INVOKABLE void setRow(int rowIndex, const QVariant &val);
Q_INVOKABLE [[maybe_unused]] void removeRow(int rowIndex, int rows);
[[maybe_unused]] Q_INVOKABLE void removeRow(int rowIndex, int rows);
Q_INVOKABLE [[maybe_unused]] [[maybe_unused]] void setComparator(const QJSValue &comparator);
[[maybe_unused]] Q_INVOKABLE void setComparator(const QJSValue &comparator);
Q_INVOKABLE [[maybe_unused]] void setFilter(const QJSValue &filter);
[[maybe_unused]] Q_INVOKABLE void setFilter(const QJSValue &filter);
private:
QJSValue _filter;

View File

@ -3,6 +3,7 @@
#include <QGuiApplication>
#include <QPalette>
#include "Def.h"
#include "FluentIconDef.h"
#include "FluColors.h"
bool systemDark() {
@ -54,7 +55,7 @@ bool FluTheme::eventFilter(QObject *, QEvent *event) {
[[maybe_unused]] QJsonArray FluTheme::awesomeList(const QString &keyword) {
QJsonArray arr;
QMetaEnum enumType = Fluent_Awesome::staticMetaObject.enumerator(Fluent_Awesome::staticMetaObject.indexOfEnumerator("Fluent_AwesomeType"));
QMetaEnum enumType = Fluent_Icons::staticMetaObject.enumerator(Fluent_Icons::staticMetaObject.indexOfEnumerator("Fluent_IconType"));
for (int i = 0; i <= enumType.keyCount() - 1; ++i) {
QString name = enumType.key(i);
int icon = enumType.value(i);

View File

@ -45,7 +45,7 @@ private:
public:
SINGLETON(FluTheme)
Q_INVOKABLE [[maybe_unused]] static QJsonArray awesomeList(const QString &keyword = "");
[[maybe_unused]] Q_INVOKABLE static QJsonArray awesomeList(const QString &keyword = "");
Q_SIGNAL void darkChanged();

1417
src/FluentIconDef.h Normal file

File diff suppressed because it is too large Load Diff

View File

@ -2,6 +2,7 @@
#include <QGuiApplication>
#include "Def.h"
#include "FluentIconDef.h"
#include "FluApp.h"
#include "FluColors.h"
#include "FluTheme.h"
@ -131,7 +132,7 @@ void FluentUI::registerTypes(const char *uri) const {
qmlRegisterSingletonType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluRouter.qml"), uri, major, minor, "FluRouter");
qmlRegisterSingletonType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluEventBus.qml"), uri, major, minor, "FluEventBus");
qmlRegisterUncreatableMetaObject(Fluent_Awesome::staticMetaObject, uri, major, minor, "FluentIcons", "Access to enums & flags only");
qmlRegisterUncreatableMetaObject(Fluent_Icons::staticMetaObject, uri, major, minor, "FluentIcons", "Access to enums & flags only");
qmlRegisterUncreatableMetaObject(FluThemeType::staticMetaObject, uri, major, minor, "FluThemeType", "Access to enums & flags only");
qmlRegisterUncreatableMetaObject(FluPageType::staticMetaObject, uri, major, minor, "FluPageType", "Access to enums & flags only");
qmlRegisterUncreatableMetaObject(FluWindowType::staticMetaObject, uri, major, minor, "FluWindowType", "Access to enums & flags only");

View File

@ -7,13 +7,15 @@ Text {
property int iconSize: 20
property color iconColor: FluTheme.dark ? "#FFFFFF" : "#000000"
id:control
font.family: "Segoe Fluent Icons"
font.family: font_loader.name
font.pixelSize: iconSize
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
color: iconColor
text: (String.fromCharCode(iconSource).toString(16))
opacity: iconSource>0
FontLoader{
source: "../Font/Segoe_Fluent_Icons.ttf"
id: font_loader
source: "qrc:/qt/qml/FluentUI/Font/FluentIcons.ttf"
}
}

View File

@ -21,6 +21,7 @@ T.SpinBox {
bottom: Math.min(control.from, control.to)
top: Math.max(control.from, control.to)
}
font: FluTextStyle.Body
contentItem: TextInput {
property color normalColor: FluTheme.dark ? Qt.rgba(255/255,255/255,255/255,1) : Qt.rgba(27/255,27/255,27/255,1)

View File

@ -2,7 +2,6 @@
<qresource prefix="/qt/qml">
<file>FluentUI/JS/Chart.js</file>
<file>FluentUI/Image/noise.png</file>
<file>FluentUI/Font/Segoe_Fluent_Icons.ttf</file>
<file>FluentUI/Controls/FluAcrylic.qml</file>
<file>FluentUI/Controls/FluAppBar.qml</file>
<file>FluentUI/Controls/FluAutoSuggestBox.qml</file>
@ -110,5 +109,6 @@
<file>FluentUI/Controls/FluSheet.qml</file>
<file>FluentUI/Controls/FluGroupBox.qml</file>
<file>FluentUI/Controls/FluControlBackground.qml</file>
<file>FluentUI/Font/FluentIcons.ttf</file>
</qresource>
</RCC>

View File

@ -7,13 +7,15 @@ Text {
property int iconSize: 20
property color iconColor: FluTheme.dark ? "#FFFFFF" : "#000000"
id:control
font.family: "Segoe Fluent Icons"
font.family: font_loader.name
font.pixelSize: iconSize
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
color: iconColor
text: (String.fromCharCode(iconSource).toString(16))
opacity: iconSource>0
FontLoader{
source: "../Font/Segoe_Fluent_Icons.ttf"
id: font_loader
source: "qrc:/qt/qml/FluentUI/Font/FluentIcons.ttf"
}
}

View File

@ -22,6 +22,7 @@ T.SpinBox {
bottom: Math.min(control.from, control.to)
top: Math.max(control.from, control.to)
}
font: FluTextStyle.Body
contentItem: TextInput {
property color normalColor: FluTheme.dark ? Qt.rgba(255/255,255/255,255/255,1) : Qt.rgba(27/255,27/255,27/255,1)

View File

@ -21,4 +21,4 @@ private: \
public: \
static Class* getInstance() { \
return Singleton<Class>::getInstance(); \
}
} \