update
parent
1ad1aa058a
commit
d9ed37d3af
|
@ -21,9 +21,6 @@ FluWindow {
|
|||
showFps: true
|
||||
}
|
||||
|
||||
Item{
|
||||
id:data
|
||||
|
||||
ListModel{
|
||||
id:nav_items
|
||||
ListElement{
|
||||
|
@ -46,6 +43,10 @@ FluWindow {
|
|||
text:"InfoBar"
|
||||
page:"qrc:/T_InfoBar.qml"
|
||||
}
|
||||
ListElement{
|
||||
text:"Dialog"
|
||||
page:"qrc:/T_Dialog.qml"
|
||||
}
|
||||
ListElement{
|
||||
text:"Progress"
|
||||
page:"qrc:/T_Progress.qml"
|
||||
|
@ -67,7 +68,6 @@ FluWindow {
|
|||
page:"qrc:/T_Typography.qml"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FluIconButton{
|
||||
icon:FluentIcons.FA_navicon
|
||||
|
@ -123,25 +123,6 @@ FluWindow {
|
|||
|
||||
|
||||
Rectangle{
|
||||
color: {
|
||||
if(FluTheme.isDark){
|
||||
if(item_mouse.containsMouse){
|
||||
return "#292929"
|
||||
}
|
||||
if(nav_list.currentIndex === index){
|
||||
return "#2D2D2D"
|
||||
}
|
||||
return "#00000000"
|
||||
}else{
|
||||
if(item_mouse.containsMouse){
|
||||
return "#EDEDED"
|
||||
}
|
||||
if(nav_list.currentIndex === index){
|
||||
return "#EAEAEA"
|
||||
}
|
||||
return "#00000000"
|
||||
}
|
||||
}
|
||||
radius: 4
|
||||
anchors{
|
||||
top: parent.top
|
||||
|
@ -153,8 +134,6 @@ FluWindow {
|
|||
leftMargin: 6
|
||||
rightMargin: 6
|
||||
}
|
||||
|
||||
|
||||
MouseArea{
|
||||
id:item_mouse
|
||||
hoverEnabled: true
|
||||
|
@ -163,6 +142,25 @@ FluWindow {
|
|||
nav_list.currentIndex = index
|
||||
}
|
||||
}
|
||||
color: {
|
||||
if(FluTheme.isDark){
|
||||
if(nav_list.currentIndex === index){
|
||||
return "#2D2D2D"
|
||||
}
|
||||
if(item_mouse.containsMouse){
|
||||
return "#292929"
|
||||
}
|
||||
return "#202020"
|
||||
}else{
|
||||
if(nav_list.currentIndex === index){
|
||||
return "#EAEAEA"
|
||||
}
|
||||
if(item_mouse.containsMouse){
|
||||
return "#EDEDED"
|
||||
}
|
||||
return "#F3f3f3"
|
||||
}
|
||||
}
|
||||
|
||||
FluText{
|
||||
text:model.text
|
||||
|
@ -171,8 +169,6 @@ FluWindow {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,13 +5,11 @@ import QtQuick.Window 2.15
|
|||
import FluentUI 1.0
|
||||
|
||||
Item {
|
||||
|
||||
FluText{
|
||||
id:title
|
||||
text:"Awesome"
|
||||
fontStyle: FluText.TitleLarge
|
||||
}
|
||||
|
||||
FluTextBox{
|
||||
id:text_box
|
||||
placeholderText: "请输入关键字"
|
||||
|
@ -20,7 +18,6 @@ Item {
|
|||
top:title.bottom
|
||||
}
|
||||
}
|
||||
|
||||
FluFilledButton{
|
||||
text:"搜索"
|
||||
anchors{
|
||||
|
@ -32,7 +29,6 @@ Item {
|
|||
grid_view.model = FluApp.awesomelist(text_box.text)
|
||||
}
|
||||
}
|
||||
|
||||
GridView{
|
||||
id:grid_view
|
||||
cellWidth: 120
|
||||
|
@ -48,10 +44,8 @@ Item {
|
|||
bottom: parent.bottom
|
||||
}
|
||||
delegate: Item {
|
||||
|
||||
width: 120
|
||||
height: 60
|
||||
|
||||
FluIconButton{
|
||||
id:item_icon
|
||||
icon:modelData.icon
|
||||
|
@ -62,7 +56,6 @@ Item {
|
|||
showSuccess("您复制了 "+text)
|
||||
}
|
||||
}
|
||||
|
||||
FluText {
|
||||
id:item_name
|
||||
font.pixelSize: 10;
|
||||
|
@ -70,10 +63,6 @@ Item {
|
|||
anchors.top: item_icon.bottom
|
||||
text: modelData.name
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,25 +1,28 @@
|
|||
import QtQuick 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick.Window 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtGraphicalEffects 1.15
|
||||
import FluentUI 1.0
|
||||
|
||||
Item {
|
||||
|
||||
width: parent.width
|
||||
|
||||
|
||||
ColumnLayout{
|
||||
spacing: 5
|
||||
|
||||
width: parent.width
|
||||
|
||||
FluText{
|
||||
id:title
|
||||
text:"Buttons"
|
||||
fontStyle: FluText.TitleLarge
|
||||
}
|
||||
|
||||
|
||||
ScrollView{
|
||||
clip: true
|
||||
width: parent.width
|
||||
contentWidth: parent.width
|
||||
anchors{
|
||||
top: title.bottom
|
||||
bottom: parent.bottom
|
||||
}
|
||||
ColumnLayout{
|
||||
spacing: 5
|
||||
width: parent.width
|
||||
RowLayout{
|
||||
Layout.topMargin: 20
|
||||
width: parent.width
|
||||
|
@ -41,12 +44,9 @@ Item {
|
|||
text:"Disabled"
|
||||
}
|
||||
}
|
||||
|
||||
FluDivider{
|
||||
Layout.fillWidth: true ; height:1;
|
||||
}
|
||||
|
||||
|
||||
RowLayout{
|
||||
Layout.topMargin: 20
|
||||
width: parent.width
|
||||
|
@ -68,14 +68,9 @@ Item {
|
|||
text:"Disabled"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
FluDivider{
|
||||
Layout.fillWidth: true ; height:1
|
||||
}
|
||||
|
||||
|
||||
RowLayout{
|
||||
Layout.topMargin: 20
|
||||
width: parent.width
|
||||
|
@ -98,18 +93,14 @@ Item {
|
|||
text:"Disabled"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FluDivider{
|
||||
Layout.fillWidth: true ; height:1
|
||||
}
|
||||
|
||||
RowLayout{
|
||||
Layout.topMargin: 20
|
||||
width: parent.width
|
||||
ColumnLayout{
|
||||
spacing: 8
|
||||
|
||||
Repeater{
|
||||
id:repeater
|
||||
property int selecIndex : 0
|
||||
|
@ -137,5 +128,5 @@ Item {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
import QtQuick 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick.Window 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtGraphicalEffects 1.15
|
||||
import FluentUI 1.0
|
||||
|
||||
Item {
|
||||
FluText{
|
||||
id:title
|
||||
text:"Dialog"
|
||||
fontStyle: FluText.TitleLarge
|
||||
}
|
||||
ScrollView{
|
||||
clip: true
|
||||
width: parent.width
|
||||
contentWidth: parent.width
|
||||
anchors{
|
||||
top: title.bottom
|
||||
bottom: parent.bottom
|
||||
}
|
||||
ColumnLayout{
|
||||
spacing: 5
|
||||
FluButton{
|
||||
Layout.topMargin: 20
|
||||
text:"Show Dialog"
|
||||
onClicked: {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,19 +1,26 @@
|
|||
import QtQuick 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick.Window 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtGraphicalEffects 1.15
|
||||
import FluentUI 1.0
|
||||
|
||||
Item {
|
||||
|
||||
ColumnLayout{
|
||||
spacing: 5
|
||||
|
||||
|
||||
FluText{
|
||||
id:title
|
||||
text:"InfoBar"
|
||||
fontStyle: FluText.TitleLarge
|
||||
}
|
||||
ScrollView{
|
||||
clip: true
|
||||
width: parent.width
|
||||
contentWidth: parent.width
|
||||
anchors{
|
||||
top: title.bottom
|
||||
bottom: parent.bottom
|
||||
}
|
||||
ColumnLayout{
|
||||
spacing: 5
|
||||
|
||||
FluButton{
|
||||
text:"Info"
|
||||
|
@ -22,7 +29,6 @@ Item {
|
|||
showInfo("这是一个Info样式的InfoBar")
|
||||
}
|
||||
}
|
||||
|
||||
FluButton{
|
||||
text:"Warning"
|
||||
Layout.topMargin: 20
|
||||
|
@ -30,7 +36,6 @@ Item {
|
|||
showWarning("这是一个Warning样式的InfoBar")
|
||||
}
|
||||
}
|
||||
|
||||
FluButton{
|
||||
text:"Error"
|
||||
Layout.topMargin: 20
|
||||
|
@ -38,7 +43,6 @@ Item {
|
|||
showError("这是一个Error样式的InfoBar")
|
||||
}
|
||||
}
|
||||
|
||||
FluButton{
|
||||
text:"Success"
|
||||
Layout.topMargin: 20
|
||||
|
@ -46,9 +50,6 @@ Item {
|
|||
showSuccess("这是一个Success样式的InfoBar这是一个Success样式的InfoBar")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,18 +1,26 @@
|
|||
import QtQuick 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick.Window 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtGraphicalEffects 1.15
|
||||
import FluentUI 1.0
|
||||
|
||||
Item {
|
||||
|
||||
ColumnLayout{
|
||||
spacing: 5
|
||||
|
||||
FluText{
|
||||
id:title
|
||||
text:"Progress"
|
||||
fontStyle: FluText.TitleLarge
|
||||
}
|
||||
ScrollView{
|
||||
clip: true
|
||||
width: parent.width
|
||||
contentWidth: parent.width
|
||||
anchors{
|
||||
top: title.bottom
|
||||
bottom: parent.bottom
|
||||
}
|
||||
ColumnLayout{
|
||||
spacing: 5
|
||||
FluProgressBar{
|
||||
Layout.topMargin: 20
|
||||
}
|
||||
|
@ -29,7 +37,6 @@ Item {
|
|||
Layout.topMargin: 10
|
||||
indeterminate: false
|
||||
}
|
||||
|
||||
FluSlider{
|
||||
Layout.topMargin: 30
|
||||
value:50
|
||||
|
@ -40,3 +47,4 @@ Item {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,72 +1,72 @@
|
|||
import QtQuick 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Window 2.15
|
||||
import QtGraphicalEffects 1.15
|
||||
import FluentUI 1.0
|
||||
|
||||
Item {
|
||||
|
||||
ColumnLayout{
|
||||
spacing: 5
|
||||
|
||||
FluText{
|
||||
id:title
|
||||
text:"Rectangle"
|
||||
fontStyle: FluText.TitleLarge
|
||||
}
|
||||
|
||||
ScrollView{
|
||||
clip: true
|
||||
width: parent.width
|
||||
contentWidth: parent.width
|
||||
anchors{
|
||||
top: title.bottom
|
||||
bottom: parent.bottom
|
||||
}
|
||||
ColumnLayout{
|
||||
spacing: 5
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
RowLayout{
|
||||
Layout.topMargin: 20
|
||||
|
||||
FluRectangle{
|
||||
width: 50
|
||||
height: 50
|
||||
color:"#0078d4"
|
||||
radius:[0,0,0,0]
|
||||
}
|
||||
|
||||
FluRectangle{
|
||||
width: 50
|
||||
height: 50
|
||||
color:"#744da9"
|
||||
radius:[15,15,15,15]
|
||||
}
|
||||
|
||||
FluRectangle{
|
||||
width: 50
|
||||
height: 50
|
||||
color:"#ffeb3b"
|
||||
radius:[15,0,0,0]
|
||||
}
|
||||
|
||||
FluRectangle{
|
||||
width: 50
|
||||
height: 50
|
||||
color:"#f7630c"
|
||||
radius:[0,15,0,0]
|
||||
}
|
||||
|
||||
FluRectangle{
|
||||
width: 50
|
||||
height: 50
|
||||
color:"#e71123"
|
||||
radius:[0,0,15,0]
|
||||
}
|
||||
|
||||
FluRectangle{
|
||||
width: 50
|
||||
height: 50
|
||||
color:"#b4009e"
|
||||
radius:[0,0,0,15]
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
FluText{
|
||||
text:"配合图片使用"
|
||||
fontStyle: FluText.Subtitle
|
||||
Layout.topMargin: 20
|
||||
}
|
||||
|
||||
RowLayout{
|
||||
spacing: 14
|
||||
FluRectangle{
|
||||
|
@ -114,7 +114,6 @@ Item {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
FluRectangle{
|
||||
width: 1080/5
|
||||
height: 1439/5
|
||||
|
@ -129,3 +128,4 @@ Item {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,27 +1,30 @@
|
|||
import QtQuick 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick.Window 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtGraphicalEffects 1.15
|
||||
import FluentUI 1.0
|
||||
|
||||
Item {
|
||||
|
||||
ColumnLayout{
|
||||
spacing: 5
|
||||
|
||||
|
||||
FluText{
|
||||
id:title
|
||||
text:"Slider"
|
||||
fontStyle: FluText.TitleLarge
|
||||
}
|
||||
|
||||
ScrollView{
|
||||
clip: true
|
||||
width: parent.width
|
||||
contentWidth: parent.width
|
||||
anchors{
|
||||
top: title.bottom
|
||||
bottom: parent.bottom
|
||||
}
|
||||
ColumnLayout{
|
||||
spacing: 5
|
||||
FluSlider{
|
||||
Layout.topMargin: 20
|
||||
value: 50
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,14 +6,21 @@ import QtGraphicalEffects 1.15
|
|||
import FluentUI 1.0
|
||||
|
||||
Item {
|
||||
|
||||
ColumnLayout{
|
||||
spacing: 5
|
||||
|
||||
FluText{
|
||||
id:title
|
||||
text:"TextBox"
|
||||
fontStyle: FluText.TitleLarge
|
||||
}
|
||||
ScrollView{
|
||||
clip: true
|
||||
width: parent.width
|
||||
contentWidth: parent.width
|
||||
anchors{
|
||||
top: title.bottom
|
||||
bottom: parent.bottom
|
||||
}
|
||||
ColumnLayout{
|
||||
spacing: 5
|
||||
FluTextBox{
|
||||
Layout.topMargin: 20
|
||||
placeholderText: "单行输入框"
|
||||
|
@ -26,3 +33,4 @@ Item {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,22 +1,28 @@
|
|||
import QtQuick 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick.Window 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtGraphicalEffects 1.15
|
||||
import FluentUI 1.0
|
||||
|
||||
Item {
|
||||
|
||||
ColumnLayout{
|
||||
spacing: 5
|
||||
|
||||
FluText{
|
||||
id:title
|
||||
text:"Theme"
|
||||
fontStyle: FluText.TitleLarge
|
||||
}
|
||||
ScrollView{
|
||||
clip: true
|
||||
width: parent.width
|
||||
contentWidth: parent.width
|
||||
anchors{
|
||||
top: title.bottom
|
||||
bottom: parent.bottom
|
||||
}
|
||||
ColumnLayout{
|
||||
spacing: 5
|
||||
RowLayout{
|
||||
Layout.topMargin: 20
|
||||
|
||||
|
||||
Repeater{
|
||||
model: [FluColors.Yellow,FluColors.Orange,FluColors.Red,FluColors.Magenta,FluColors.Purple,FluColors.Blue,FluColors.Teal,FluColors.Green]
|
||||
delegate: Rectangle{
|
||||
|
@ -44,3 +50,4 @@ Item {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,26 +1,30 @@
|
|||
import QtQuick 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick.Window 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtGraphicalEffects 1.15
|
||||
import FluentUI 1.0
|
||||
|
||||
Item {
|
||||
|
||||
ColumnLayout{
|
||||
spacing: 5
|
||||
|
||||
|
||||
FluText{
|
||||
id:title
|
||||
text:"ToggleSwitch"
|
||||
fontStyle: FluText.TitleLarge
|
||||
}
|
||||
|
||||
ScrollView{
|
||||
clip: true
|
||||
width: parent.width
|
||||
contentWidth: parent.width
|
||||
anchors{
|
||||
top: title.bottom
|
||||
bottom: parent.bottom
|
||||
}
|
||||
ColumnLayout{
|
||||
spacing: 5
|
||||
FluToggleSwitch{
|
||||
Layout.topMargin: 20
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,54 +1,56 @@
|
|||
import QtQuick 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick.Controls 2.15
|
||||
import FluentUI 1.0
|
||||
|
||||
Item {
|
||||
|
||||
FluText{
|
||||
id:title
|
||||
text:"Theme"
|
||||
fontStyle: FluText.TitleLarge
|
||||
}
|
||||
ScrollView{
|
||||
clip: true
|
||||
width: parent.width
|
||||
contentWidth: parent.width
|
||||
anchors{
|
||||
top: title.bottom
|
||||
bottom: parent.bottom
|
||||
}
|
||||
ColumnLayout{
|
||||
|
||||
spacing: 5
|
||||
|
||||
FluText{
|
||||
text:"Display"
|
||||
fontStyle: FluText.Display
|
||||
}
|
||||
|
||||
FluText{
|
||||
text:"Title Large"
|
||||
fontStyle: FluText.TitleLarge
|
||||
}
|
||||
|
||||
FluText{
|
||||
text:"Title"
|
||||
fontStyle: FluText.Title
|
||||
}
|
||||
|
||||
FluText{
|
||||
text:"Subtitle"
|
||||
fontStyle: FluText.Subtitle
|
||||
}
|
||||
|
||||
FluText{
|
||||
text:"Body Large"
|
||||
fontStyle: FluText.BodyLarge
|
||||
}
|
||||
|
||||
FluText{
|
||||
text:"Body Strong"
|
||||
fontStyle: FluText.BodyStrong
|
||||
}
|
||||
|
||||
FluText{
|
||||
text:"Body"
|
||||
fontStyle: FluText.Body
|
||||
}
|
||||
|
||||
FluText{
|
||||
text:"Caption"
|
||||
fontStyle: FluText.Caption
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
QT += quick concurrent
|
||||
CONFIG += c++11 qtquickcompiler utf8_source
|
||||
CONFIG += c++11
|
||||
|
||||
DEFINES += QT_DEPRECATED_WARNINGS QT_NO_WARNING_OUTPUT
|
||||
|
||||
|
|
|
@ -27,5 +27,6 @@
|
|||
<file>T_Awesome.qml</file>
|
||||
<file>T_TextBox.qml</file>
|
||||
<file>T_Theme.qml</file>
|
||||
<file>T_Dialog.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
|
@ -32,10 +32,6 @@ void Fluent::registerTypes(const char *uri){
|
|||
|
||||
qmlRegisterType<WindowHelper>(uri,major,minor,"WindowHelper");
|
||||
qmlRegisterType<FluColorSet>(uri,major,minor,"FluColorSet");
|
||||
// qmlRegisterSingletonType(QUrl("qrc:/com.zhuzichu/controls/FluColors.qml"),uri,major,minor,"FluColors");
|
||||
// qmlRegisterSingletonType(QUrl("qrc:/com.zhuzichu/controls/FluTheme.qml"),uri,major,minor,"FluTheme");
|
||||
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluColorSetOld.qml"),uri,major,minor,"FluColorSetOld");
|
||||
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluMenu.qml"),uri,major,minor,"FluMenu");
|
||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluMenuItem.qml"),uri,major,minor,"FluMenuItem");
|
||||
|
|
|
@ -12,15 +12,6 @@ public:
|
|||
bool m_deleteLater = false;
|
||||
QQuickItem *m_titleItem = nullptr;
|
||||
};
|
||||
|
||||
static bool isMaxWin(QWindow* win)
|
||||
{
|
||||
return win->windowState() == Qt::WindowMaximized;
|
||||
}
|
||||
static bool isFullWin(QQuickView* win)
|
||||
{
|
||||
return win->windowState() == Qt::WindowFullScreen;
|
||||
}
|
||||
FramelessView::FramelessView(QWindow *parent) : Super(parent), d(new FramelessViewPrivate)
|
||||
{
|
||||
setFlags(Qt::CustomizeWindowHint | Qt::Window | Qt::FramelessWindowHint | Qt::WindowMinMaxButtonsHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint);
|
||||
|
@ -109,53 +100,6 @@ bool FramelessView::nativeEvent(const QByteArray &eventType, void *message, qint
|
|||
bool FramelessView::nativeEvent(const QByteArray &eventType, void *message, long *result)
|
||||
#endif
|
||||
{
|
||||
if (!result)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#if (QT_VERSION == QT_VERSION_CHECK(5, 11, 1))
|
||||
const auto msg = *reinterpret_cast<MSG**>(message);
|
||||
#else
|
||||
const auto msg = static_cast<LPMSG>(message);
|
||||
#endif
|
||||
if (!msg || !msg->hwnd)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
switch (msg->message)
|
||||
{
|
||||
case WM_NCCALCSIZE: {
|
||||
#if 1
|
||||
const auto mode = static_cast<BOOL>(msg->wParam);
|
||||
const auto clientRect = mode ? &(reinterpret_cast<LPNCCALCSIZE_PARAMS>(msg->lParam)->rgrc[0]) : reinterpret_cast<LPRECT>(msg->lParam);
|
||||
if (mode == TRUE)
|
||||
{
|
||||
*result = WVR_REDRAW;
|
||||
//规避 拖动border进行resize时界面闪烁
|
||||
if (!isMaxWin(this) && !isFullWin(this))
|
||||
{
|
||||
if (clientRect->top != 0)
|
||||
{
|
||||
clientRect->top -= 0.1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (clientRect->top != 0)
|
||||
{
|
||||
clientRect->top += 0.1;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#else
|
||||
*result = 0;
|
||||
return true;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
return Super::nativeEvent(eventType, message, result);
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,13 @@ import FluentUI 1.0
|
|||
Rectangle{
|
||||
|
||||
id:root
|
||||
color: FluTheme.isDark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||
|
||||
property color borerlessColor : FluTheme.isDark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||
color: {
|
||||
if(Window.window == null)
|
||||
return borerlessColor
|
||||
return Window.window.active ? borerlessColor : Qt.lighter(FluTheme.primaryColor.lightest,1.1)
|
||||
}
|
||||
height: 50
|
||||
width: {
|
||||
if(parent==null)
|
||||
|
@ -19,30 +25,31 @@ Rectangle{
|
|||
property bool showDark: false
|
||||
property bool showFps: false
|
||||
|
||||
property var window: Window.window
|
||||
|
||||
property bool resizable: {
|
||||
if(Window.window == null){
|
||||
if(window == null){
|
||||
return false
|
||||
}
|
||||
return !(Window.window.minimumHeight === Window.window.maximumHeight && Window.window.maximumWidth === Window.window.minimumWidth)
|
||||
return !(window.minimumHeight === window.maximumHeight && window.maximumWidth === window.minimumWidth)
|
||||
}
|
||||
|
||||
MouseArea{
|
||||
anchors.fill: parent
|
||||
anchors.topMargin: 5
|
||||
acceptedButtons: Qt.LeftButton
|
||||
hoverEnabled: true
|
||||
onPressed: Window.window.startSystemMove()
|
||||
onDoubleClicked: {
|
||||
if(resizable)
|
||||
toggleMaximized();
|
||||
TapHandler {
|
||||
onTapped: if (tapCount === 2) toggleMaximized()
|
||||
gesturePolicy: TapHandler.DragThreshold
|
||||
}
|
||||
|
||||
DragHandler {
|
||||
target: null
|
||||
grabPermissions: TapHandler.CanTakeOverFromAnything
|
||||
onActiveChanged: if (active) { window.startSystemMove(); }
|
||||
}
|
||||
|
||||
function toggleMaximized() {
|
||||
if (Window.window.visibility === Window.Maximized) {
|
||||
Window.window.showNormal();
|
||||
if (window.visibility === Window.Maximized) {
|
||||
window.showNormal();
|
||||
} else {
|
||||
Window.window.showMaximized();
|
||||
window.showMaximized();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -98,14 +105,14 @@ Rectangle{
|
|||
textColor: root.textColor
|
||||
color:hovered ? "#20000000" : "#00000000"
|
||||
onClicked: {
|
||||
Window.window.showMinimized()
|
||||
window.showMinimized()
|
||||
}
|
||||
}
|
||||
FluIconButton{
|
||||
property bool isRestore:{
|
||||
if(Window.window == null)
|
||||
if(window == null)
|
||||
return false
|
||||
return Window.Maximized === Window.window.visibility
|
||||
return Window.Maximized === window.visibility
|
||||
}
|
||||
icon : isRestore ? FluentIcons.FA_window_restore : FluentIcons.FA_window_maximize
|
||||
color:hovered ? "#20000000" : "#00000000"
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
import QtQuick 2.15
|
||||
|
||||
QtObject {
|
||||
|
||||
property color darkest: Qt.rgba(0/255,74/255,131/255,1)
|
||||
property color darker:Qt.rgba(0/255,84/255,148/255,1)
|
||||
property color dark:Qt.rgba(0/255,102/255,180/255,1)
|
||||
property color normal:Qt.rgba(0/255,120/255,212/255,1)
|
||||
property color light:Qt.rgba(38/255,140/255,218/255,1)
|
||||
property color lighter:Qt.rgba(76/255,160/255,224/255,1)
|
||||
property color lightest:Qt.rgba(96/255,171/255,228/255,1)
|
||||
|
||||
}
|
|
@ -1,112 +0,0 @@
|
|||
pragma Singleton
|
||||
|
||||
import QtQuick 2.15
|
||||
|
||||
QtObject {
|
||||
|
||||
property color _Black: Qt.rgba(0/255,0/255,0/255,1)
|
||||
property color _White: Qt.rgba(255/255,255/255,255/255,1)
|
||||
|
||||
property color _Grey10: Qt.rgba(250/255,249/255,248/255,1)
|
||||
property color _Grey20: Qt.rgba(243/255,242/255,241/255,1)
|
||||
property color _Grey30: Qt.rgba(237/255,235/255,233/255,1)
|
||||
property color _Grey40: Qt.rgba(225/255,223/255,221/255,1)
|
||||
property color _Grey50: Qt.rgba(210/255,208/255,206/255,1)
|
||||
property color _Grey60: Qt.rgba(200/255,198/255,196/255,1)
|
||||
property color _Grey70: Qt.rgba(190/255,187/255,184/255,1)
|
||||
property color _Grey80: Qt.rgba(179/255,176/255,173/255,1)
|
||||
property color _Grey90: Qt.rgba(161/255,159/255,157/255,1)
|
||||
property color _Grey100: Qt.rgba(151/255,149/255,147/255,1)
|
||||
property color _Grey110: Qt.rgba(138/255,136/255,134/255,1)
|
||||
property color _Grey120: Qt.rgba(121/255,119/255,117/255,1)
|
||||
property color _Grey130: Qt.rgba(96/255,94/255,92/255,1)
|
||||
property color _Grey140: Qt.rgba(72/255,70/255,68/255,1)
|
||||
property color _Grey150: Qt.rgba(59/255,58/255,57/255,1)
|
||||
property color _Grey160: Qt.rgba(50/255,49/255,48/255,1)
|
||||
property color _Grey170: Qt.rgba(41/255,40/255,39/255,1)
|
||||
property color _Grey180: Qt.rgba(37/255,36/255,35/255,1)
|
||||
property color _Grey190: Qt.rgba(32/255,31/255,30/255,1)
|
||||
property color _Grey200: Qt.rgba(27/255,26/255,25/255,1)
|
||||
property color _Grey210: Qt.rgba(22/255,21/255,20/255,1)
|
||||
property color _Grey220: Qt.rgba(17/255,16/255,15/255,1)
|
||||
|
||||
property FluColorSetOld _Yellow:FluColorSetOld{
|
||||
darkest: Qt.rgba(249/255,168/255,37/255,1)
|
||||
darker:Qt.rgba(251/255,192/255,45/255,1)
|
||||
dark:Qt.rgba(253/255,216/255,53/255,1)
|
||||
normal:Qt.rgba(255/255,235/255,59/255,1)
|
||||
light:Qt.rgba(255/255,238/255,88/255,1)
|
||||
lighter:Qt.rgba(255/255,241/255,118/255,1)
|
||||
lightest:Qt.rgba(255/255,245/255,157/255,1)
|
||||
}
|
||||
|
||||
property FluColorSetOld _Orange:FluColorSetOld{
|
||||
darkest: Qt.rgba(153/255,61/255,7/255,1)
|
||||
darker:Qt.rgba(172/255,68/255,8/255,1)
|
||||
dark:Qt.rgba(209/255,84/255,10/255,1)
|
||||
normal:Qt.rgba(247/255,99/255,12/255,1)
|
||||
light:Qt.rgba(248/255,122/255,48/255,1)
|
||||
lighter:Qt.rgba(249/255,145/255,84/255,1)
|
||||
lightest:Qt.rgba(250/255,158/255,104/255,1)
|
||||
}
|
||||
|
||||
property FluColorSetOld _Red:FluColorSetOld{
|
||||
darkest: Qt.rgba(143/255,10/255,21/255,1)
|
||||
darker:Qt.rgba(162/255,11/255,24/255,1)
|
||||
dark:Qt.rgba(185/255,13/255,28/255,1)
|
||||
normal:Qt.rgba(232/255,17/255,35/255,1)
|
||||
light:Qt.rgba(236/255,64/255,79/255,1)
|
||||
lighter:Qt.rgba(238/255,88/255,101/255,1)
|
||||
lightest:Qt.rgba(240/255,107/255,118/255,1)
|
||||
}
|
||||
|
||||
property FluColorSetOld _Magenta:FluColorSetOld{
|
||||
darkest: Qt.rgba(111/255,0/255,79/255,1)
|
||||
darker:Qt.rgba(126/255,0/255,110/255,1)
|
||||
dark:Qt.rgba(144/255,0/255,126/255,1)
|
||||
normal:Qt.rgba(180/255,0/255,158/255,1)
|
||||
light:Qt.rgba(195/255,51/255,177/255,1)
|
||||
lighter:Qt.rgba(202/255,76/255,187/255,1)
|
||||
lightest:Qt.rgba(208/255,96/255,194/255,1)
|
||||
}
|
||||
|
||||
property FluColorSetOld _Purple:FluColorSetOld{
|
||||
darkest: Qt.rgba(71/255,47/255,104/255,1)
|
||||
darker:Qt.rgba(81/255,53/255,118/255,1)
|
||||
dark:Qt.rgba(100/255,66/255,147/255,1)
|
||||
normal:Qt.rgba(116/255,77/255,169/255,1)
|
||||
light:Qt.rgba(134/255,100/255,180/255,1)
|
||||
lighter:Qt.rgba(157/255,130/255,194/255,1)
|
||||
lightest:Qt.rgba(168/255,144/255,201/255,1)
|
||||
}
|
||||
|
||||
property FluColorSetOld _Blue:FluColorSetOld{
|
||||
darkest: Qt.rgba(0/255,74/255,131/255,1)
|
||||
darker:Qt.rgba(0/255,84/255,148/255,1)
|
||||
dark:Qt.rgba(0/255,102/255,180/255,1)
|
||||
normal:Qt.rgba(0/255,120/255,212/255,1)
|
||||
light:Qt.rgba(38/255,140/255,218/255,1)
|
||||
lighter:Qt.rgba(76/255,160/255,224/255,1)
|
||||
lightest:Qt.rgba(96/255,171/255,228/255,1)
|
||||
}
|
||||
|
||||
property FluColorSetOld _Teal:FluColorSetOld{
|
||||
darkest: Qt.rgba(0/255,110/255,91/255,1)
|
||||
darker:Qt.rgba(0/255,124/255,103/255,1)
|
||||
dark:Qt.rgba(0/255,151/255,125/255,1)
|
||||
normal:Qt.rgba(0/255,178/255,148/255,1)
|
||||
light:Qt.rgba(38/255,189/255,164/255,1)
|
||||
lighter:Qt.rgba(76/255,201/255,180/255,1)
|
||||
lightest:Qt.rgba(96/255,207/255,188/255,1)
|
||||
}
|
||||
|
||||
property FluColorSetOld _Green:FluColorSetOld{
|
||||
darkest: Qt.rgba(9/255,76/255,9/255,1)
|
||||
darker:Qt.rgba(12/255,93/255,12/255,1)
|
||||
dark:Qt.rgba(14/255,111/255,14/255,1)
|
||||
normal:Qt.rgba(16/255,124/255,16/255,1)
|
||||
light:Qt.rgba(39/255,137/255,39/255,1)
|
||||
lighter:Qt.rgba(75/255,156/255,75/255,1)
|
||||
lightest:Qt.rgba(106/255,173/255,106/255,1)
|
||||
}
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
pragma Singleton
|
||||
|
||||
import QtQuick 2.15
|
||||
|
||||
QtObject {
|
||||
|
||||
property FluColorSetOld primaryColor: FluColorsOld._Teal
|
||||
|
||||
|
||||
}
|
|
@ -20,18 +20,20 @@ Item {
|
|||
property int maximumWidth
|
||||
property int minimumHeight
|
||||
property int maximumHeight
|
||||
|
||||
property int borderless:{
|
||||
if(Window.window == null)
|
||||
if(window === null)
|
||||
return 4
|
||||
if(Window.window.visibility === Window.Maximized){
|
||||
return 0
|
||||
}
|
||||
return 4
|
||||
}
|
||||
default property alias content: container.children
|
||||
|
||||
FluWindowResize{}
|
||||
default property alias content: container.data
|
||||
|
||||
FluWindowResize{
|
||||
border:borderless
|
||||
}
|
||||
|
||||
Behavior on opacity{
|
||||
NumberAnimation{
|
||||
|
@ -39,13 +41,17 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
Rectangle{
|
||||
color: FluTheme.isDark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||
property color borerlessColor : FluTheme.isDark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||
color: {
|
||||
if(window === null)
|
||||
return borerlessColor
|
||||
return window.active ? borerlessColor : Qt.lighter(FluTheme.primaryColor.lightest,1.1)
|
||||
}
|
||||
border.width: 1
|
||||
anchors.fill: parent
|
||||
radius: 4
|
||||
border.color:FluTheme.isDark ? Qt.darker(FluTheme.primaryColor.lighter,1.3) : Qt.lighter(FluTheme.primaryColor.dark,1.3)
|
||||
border.color:FluTheme.isDark ? Qt.darker(FluTheme.primaryColor.lighter,1.3) : Qt.lighter(FluTheme.primaryColor.dark,1.2)
|
||||
}
|
||||
|
||||
Rectangle{
|
||||
|
|
|
@ -4,13 +4,14 @@ import QtQuick.Window 2.15
|
|||
MouseArea {
|
||||
|
||||
property int border: 4
|
||||
property var window: Window.window
|
||||
property bool fixedSize: {
|
||||
if(Window.window == null)
|
||||
if(window == null)
|
||||
return true
|
||||
if(Window.window.visibility === Window.Maximized || Window.window.visibility === Window.FullScreen){
|
||||
if(window.visibility === Window.Maximized || window.visibility === Window.FullScreen){
|
||||
return true
|
||||
}
|
||||
return (Window.window.minimumWidth === Window.window.maximumWidth && Window.window.minimumHeight === Window.window.maximumHeight)
|
||||
return (window.minimumWidth === window.maximumWidth && window.minimumHeight === window.maximumHeight)
|
||||
}
|
||||
|
||||
anchors.fill: parent
|
||||
|
|
|
@ -32,8 +32,5 @@
|
|||
<file>controls/FluMenuItem.qml</file>
|
||||
<file>controls/FluShadow.qml</file>
|
||||
<file>controls/FluTextButton.qml</file>
|
||||
<file>controls/FluColorSetOld.qml</file>
|
||||
<file>controls/FluColorsOld.qml</file>
|
||||
<file>controls/FluThemeOld.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
Loading…
Reference in New Issue