mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-07-02 16:15:28 +08:00
update
This commit is contained in:
@ -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;
|
||||
|
@ -111,12 +111,12 @@ FluColors::FluColors(QObject *parent) : QObject{parent} {
|
||||
|
||||
[[maybe_unused]] FluAccentColor *FluColors::createAccentColor(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;
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ private:
|
||||
public:
|
||||
SINGLETON(FluColors)
|
||||
|
||||
Q_INVOKABLE [[maybe_unused]] FluAccentColor *createAccentColor(QColor primaryColor);
|
||||
[[maybe_unused]] Q_INVOKABLE FluAccentColor *createAccentColor(QColor primaryColor);
|
||||
|
||||
static FluColors *create(QQmlEngine *, QJSEngine *) { return getInstance(); }
|
||||
};
|
||||
};
|
||||
|
@ -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;
|
||||
@ -73,4 +73,4 @@ private:
|
||||
int _margins = 8;
|
||||
quint64 _clickTimer = 0;
|
||||
QList<QPointer<QQuickItem>> _hitTestList;
|
||||
};
|
||||
};
|
||||
|
@ -19,17 +19,17 @@ 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;
|
||||
QJSValue _comparator;
|
||||
};
|
||||
};
|
||||
|
@ -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);
|
||||
|
@ -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
1417
src/FluentIconDef.h
Normal file
File diff suppressed because it is too large
Load Diff
@ -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");
|
||||
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
@ -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>
|
||||
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user