Compare commits

...

7 Commits

Author SHA1 Message Date
朱子楚\zhuzi b3e26d17a2 update 2024-03-09 23:42:01 +08:00
朱子楚\zhuzi 0e55f31fe2 Merge branch 'main' of https://github.com/zhuzichu520/FluentUI 2024-03-09 22:39:39 +08:00
朱子楚\zhuzi f624007fec update 2024-03-09 22:39:34 +08:00
zhuzichu 65844ef105
Merge pull request #456 from mentalfl0w/patch-1
CMakeLists: simplify code.
2024-03-09 22:39:08 +08:00
Dylan Liu 799df5c644
CMakeLists: simplify code. 2024-03-09 22:33:51 +08:00
朱子楚\zhuzi afd888d7a0 update 2024-03-09 22:26:21 +08:00
朱子楚\zhuzi 1d5f8772e1 update 2024-03-09 22:19:10 +08:00
41 changed files with 89 additions and 89 deletions

View File

@ -18,10 +18,8 @@ option(FLUENTUI_BUILD_STATIC_LIB "Build static library." OFF)
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core) find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core) find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)
set(QT_SDK_DIR "${Qt${QT_VERSION_MAJOR}_DIR}") set(QT_SDK_DIR "${Qt${QT_VERSION_MAJOR}_DIR}/../../..")
cmake_path(GET QT_SDK_DIR PARENT_PATH QT_SDK_DIR) cmake_path(SET QT_SDK_DIR NORMALIZE ${QT_SDK_DIR})
cmake_path(GET QT_SDK_DIR PARENT_PATH QT_SDK_DIR)
cmake_path(GET QT_SDK_DIR PARENT_PATH QT_SDK_DIR)
#QML<QT_SDK_DIR_PATH>\qml\FluentUI #QML<QT_SDK_DIR_PATH>\qml\FluentUI
set(FLUENTUI_QML_PLUGIN_DIRECTORY "" CACHE PATH "Path to FluentUI plugin") set(FLUENTUI_QML_PLUGIN_DIRECTORY "" CACHE PATH "Path to FluentUI plugin")

View File

@ -680,7 +680,7 @@
<location filename="qml/window/MainWindow.qml" line="118"/> <location filename="qml/window/MainWindow.qml" line="118"/>
<location filename="qml-Qt6/window/MainWindow.qml" line="118"/> <location filename="qml-Qt6/window/MainWindow.qml" line="118"/>
<source>Open in Separate Window</source> <source>Open in Separate Window</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/window/MainWindow.qml" line="215"/> <location filename="qml/window/MainWindow.qml" line="215"/>

View File

@ -62,7 +62,7 @@ FluContentPage {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.top: item_icon.bottom anchors.top: item_icon.bottom
width:parent.width width:parent.width
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
text: modelData.name text: modelData.name
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
} }

View File

@ -23,7 +23,7 @@ FluScrollablePage{
right: parent.right right: parent.right
} }
FluText{ FluText{
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
width: parent.width width: parent.width
text: qsTr("It usually appears in the upper right corner of the notification icon or avatar to display the number of messages that need to be processed") text: qsTr("It usually appears in the upper right corner of the notification icon or avatar to display the number of messages that need to be processed")
} }

View File

@ -64,7 +64,7 @@ FluScrollablePage{
FluText{ FluText{
id:text_info id:text_info
width: scrollview.width width: scrollview.width
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
padding: 14 padding: 14
text: qsTr("Permit me to observe: the late emperor was taken from us before he could finish his life`s work, the restoration of Han. Today, the empire is still divided in three, and our very survival is threatened. Yet still the officials at court and the soldiers throughout the realm remain loyal to you, your majesty. Because they remember the late emperor, all of them, and they wish to repay his kindness in service to you. This is the moment to extend your divine influence, to honour the memory of the late Emperor and strengthen the morale of your officers. It is not time to listen to bad advice, or close your ears to the suggestions of loyal men. text: qsTr("Permit me to observe: the late emperor was taken from us before he could finish his life`s work, the restoration of Han. Today, the empire is still divided in three, and our very survival is threatened. Yet still the officials at court and the soldiers throughout the realm remain loyal to you, your majesty. Because they remember the late emperor, all of them, and they wish to repay his kindness in service to you. This is the moment to extend your divine influence, to honour the memory of the late Emperor and strengthen the morale of your officers. It is not time to listen to bad advice, or close your ears to the suggestions of loyal men.
The court and the administration are as one. Both must be judged by one standard. Those who are loyal and good must get what they deserve, but so must the evil-doers who break the law. This will demonstrate the justice of your rule. There cannot be one law for the court and another for the administration. The court and the administration are as one. Both must be judged by one standard. Those who are loyal and good must get what they deserve, but so must the evil-doers who break the law. This will demonstrate the justice of your rule. There cannot be one law for the court and another for the administration.
@ -97,7 +97,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han.
FluText{ FluText{
id:text_info id:text_info
width: scrollview.width width: scrollview.width
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
padding: 14 padding: 14
text: qsTr("Permit me to observe: the late emperor was taken from us before he could finish his life`s work...") text: qsTr("Permit me to observe: the late emperor was taken from us before he could finish his life`s work...")
} }

View File

@ -118,7 +118,7 @@ FluScrollablePage{
Layout.leftMargin: 20 Layout.leftMargin: 20
color: FluColors.Grey120 color: FluColors.Grey120
font.pixelSize: 12 font.pixelSize: 12
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
} }
} }
FluIcon{ FluIcon{
@ -214,7 +214,7 @@ FluScrollablePage{
id:item_desc id:item_desc
text:desc text:desc
color:FluColors.Grey120 color:FluColors.Grey120
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
elide: Text.ElideRight elide: Text.ElideRight
font: FluTextStyle.Caption font: FluTextStyle.Caption
maximumLineCount: 2 maximumLineCount: 2

View File

@ -552,7 +552,7 @@ FluContentPage{
FluText{ FluText{
id:text_info id:text_info
width: scrollview.width width: scrollview.width
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
padding: 14 padding: 14
} }
} }

View File

@ -23,7 +23,7 @@ FluScrollablePage{
Component{ Component{
id:com_lable id:com_lable
FluText{ FluText{
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
font.bold: true font.bold: true
horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft
text: modelData.lable text: modelData.lable
@ -41,7 +41,7 @@ FluScrollablePage{
Component{ Component{
id:com_text id:com_text
FluText{ FluText{
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft
text: modelData.text text: modelData.text
font.bold: true font.bold: true

View File

@ -44,7 +44,7 @@ FluWindow {
leftMargin: 10 leftMargin: 10
rightMargin: 10 rightMargin: 10
} }
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
text: qsTr("We apologize for the inconvenience caused by an unexpected error") text: qsTr("We apologize for the inconvenience caused by an unexpected error")
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter

View File

@ -32,7 +32,7 @@ FluWindow {
text:loader.itemLodaer().sourceComponent.errorString() text:loader.itemLodaer().sourceComponent.errorString()
color:"red" color:"red"
anchors.fill: parent anchors.fill: parent
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
padding: 20 padding: 20
verticalAlignment: Qt.AlignVCenter verticalAlignment: Qt.AlignVCenter
horizontalAlignment: Qt.AlignHCenter horizontalAlignment: Qt.AlignHCenter

View File

@ -13,8 +13,8 @@ FluWindow {
id:window id:window
title: "FluentUI" title: "FluentUI"
width: 960 width: 1000
height: 600 height: 680
minimumWidth: 520 minimumWidth: 520
minimumHeight: 200 minimumHeight: 200
launchMode: FluWindowType.SingleTask launchMode: FluWindowType.SingleTask
@ -112,11 +112,10 @@ FluWindow {
Component{ Component{
id: nav_item_right_menu id: nav_item_right_menu
FluMenu{ FluMenu{
id: menu width: 186
width: 130
FluMenuItem{ FluMenuItem{
text: qsTr("Open in Separate Window") text: qsTr("Open in Separate Window")
visible: true font.pixelSize: 12
onClicked: { onClicked: {
FluApp.navigate("/pageWindow",{title:modelData.title,url:modelData.url}) FluApp.navigate("/pageWindow",{title:modelData.title,url:modelData.url})
} }

View File

@ -22,7 +22,7 @@ FluWindow {
} }
FluText{ FluText{
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
anchors{ anchors{
left: parent.left left: parent.left
right: parent.right right: parent.right

View File

@ -62,7 +62,7 @@ FluContentPage {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.top: item_icon.bottom anchors.top: item_icon.bottom
width:parent.width width:parent.width
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
text: modelData.name text: modelData.name
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
} }

View File

@ -23,7 +23,7 @@ FluScrollablePage{
right: parent.right right: parent.right
} }
FluText{ FluText{
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
width: parent.width width: parent.width
text: qsTr("It usually appears in the upper right corner of the notification icon or avatar to display the number of messages that need to be processed") text: qsTr("It usually appears in the upper right corner of the notification icon or avatar to display the number of messages that need to be processed")
} }

View File

@ -64,7 +64,7 @@ FluScrollablePage{
FluText{ FluText{
id:text_info id:text_info
width: scrollview.width width: scrollview.width
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
padding: 14 padding: 14
text: qsTr("Permit me to observe: the late emperor was taken from us before he could finish his life`s work, the restoration of Han. Today, the empire is still divided in three, and our very survival is threatened. Yet still the officials at court and the soldiers throughout the realm remain loyal to you, your majesty. Because they remember the late emperor, all of them, and they wish to repay his kindness in service to you. This is the moment to extend your divine influence, to honour the memory of the late Emperor and strengthen the morale of your officers. It is not time to listen to bad advice, or close your ears to the suggestions of loyal men. text: qsTr("Permit me to observe: the late emperor was taken from us before he could finish his life`s work, the restoration of Han. Today, the empire is still divided in three, and our very survival is threatened. Yet still the officials at court and the soldiers throughout the realm remain loyal to you, your majesty. Because they remember the late emperor, all of them, and they wish to repay his kindness in service to you. This is the moment to extend your divine influence, to honour the memory of the late Emperor and strengthen the morale of your officers. It is not time to listen to bad advice, or close your ears to the suggestions of loyal men.
The court and the administration are as one. Both must be judged by one standard. Those who are loyal and good must get what they deserve, but so must the evil-doers who break the law. This will demonstrate the justice of your rule. There cannot be one law for the court and another for the administration. The court and the administration are as one. Both must be judged by one standard. Those who are loyal and good must get what they deserve, but so must the evil-doers who break the law. This will demonstrate the justice of your rule. There cannot be one law for the court and another for the administration.
@ -97,7 +97,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han.
FluText{ FluText{
id:text_info id:text_info
width: scrollview.width width: scrollview.width
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
padding: 14 padding: 14
text: qsTr("Permit me to observe: the late emperor was taken from us before he could finish his life`s work...") text: qsTr("Permit me to observe: the late emperor was taken from us before he could finish his life`s work...")
} }

View File

@ -118,7 +118,7 @@ FluScrollablePage{
Layout.leftMargin: 20 Layout.leftMargin: 20
color: FluColors.Grey120 color: FluColors.Grey120
font.pixelSize: 12 font.pixelSize: 12
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
} }
} }
FluIcon{ FluIcon{
@ -214,7 +214,7 @@ FluScrollablePage{
id:item_desc id:item_desc
text:desc text:desc
color:FluColors.Grey120 color:FluColors.Grey120
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
elide: Text.ElideRight elide: Text.ElideRight
font: FluTextStyle.Caption font: FluTextStyle.Caption
maximumLineCount: 2 maximumLineCount: 2

View File

@ -552,7 +552,7 @@ FluContentPage{
FluText{ FluText{
id:text_info id:text_info
width: scrollview.width width: scrollview.width
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
padding: 14 padding: 14
} }
} }

View File

@ -23,7 +23,7 @@ FluScrollablePage{
Component{ Component{
id:com_lable id:com_lable
FluText{ FluText{
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
font.bold: true font.bold: true
horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft
text: modelData.lable text: modelData.lable
@ -41,7 +41,7 @@ FluScrollablePage{
Component{ Component{
id:com_text id:com_text
FluText{ FluText{
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft
text: modelData.text text: modelData.text
font.bold: true font.bold: true

View File

@ -44,7 +44,7 @@ FluWindow {
leftMargin: 10 leftMargin: 10
rightMargin: 10 rightMargin: 10
} }
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
text: qsTr("We apologize for the inconvenience caused by an unexpected error") text: qsTr("We apologize for the inconvenience caused by an unexpected error")
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter

View File

@ -32,7 +32,7 @@ FluWindow {
text:loader.itemLodaer().sourceComponent.errorString() text:loader.itemLodaer().sourceComponent.errorString()
color:"red" color:"red"
anchors.fill: parent anchors.fill: parent
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
padding: 20 padding: 20
verticalAlignment: Qt.AlignVCenter verticalAlignment: Qt.AlignVCenter
horizontalAlignment: Qt.AlignHCenter horizontalAlignment: Qt.AlignHCenter

View File

@ -13,8 +13,8 @@ FluWindow {
id:window id:window
title: "FluentUI" title: "FluentUI"
width: 960 width: 1000
height: 600 height: 680
minimumWidth: 520 minimumWidth: 520
minimumHeight: 200 minimumHeight: 200
launchMode: FluWindowType.SingleTask launchMode: FluWindowType.SingleTask
@ -112,11 +112,10 @@ FluWindow {
Component{ Component{
id: nav_item_right_menu id: nav_item_right_menu
FluMenu{ FluMenu{
id: menu width: 186
width: 130
FluMenuItem{ FluMenuItem{
text: qsTr("Open in Separate Window") text: qsTr("Open in Separate Window")
visible: true font.pixelSize: 12
onClicked: { onClicked: {
FluApp.navigate("/pageWindow",{title:modelData.title,url:modelData.url}) FluApp.navigate("/pageWindow",{title:modelData.title,url:modelData.url})
} }

View File

@ -22,7 +22,7 @@ FluWindow {
} }
FluText{ FluText{
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
anchors{ anchors{
left: parent.left left: parent.left
right: parent.right right: parent.right

View File

@ -20,12 +20,12 @@ static inline QByteArray qtNativeEventType()
static inline bool isCompositionEnabled(){ static inline bool isCompositionEnabled(){
typedef HRESULT (WINAPI* DwmIsCompositionEnabledPtr)(BOOL *pfEnabled); typedef HRESULT (WINAPI* DwmIsCompositionEnabledPtr)(BOOL *pfEnabled);
HMODULE module = LoadLibraryW(L"dwmapi.dll"); HMODULE module = ::LoadLibraryW(L"dwmapi.dll");
if (module) if (module)
{ {
BOOL composition_enabled = false; BOOL composition_enabled = false;
DwmIsCompositionEnabledPtr dwm_is_composition_enabled; DwmIsCompositionEnabledPtr dwm_is_composition_enabled;
dwm_is_composition_enabled= reinterpret_cast<DwmIsCompositionEnabledPtr>(GetProcAddress(module, "DwmIsCompositionEnabled")); dwm_is_composition_enabled= reinterpret_cast<DwmIsCompositionEnabledPtr>(::GetProcAddress(module, "DwmIsCompositionEnabled"));
if (dwm_is_composition_enabled) if (dwm_is_composition_enabled)
{ {
dwm_is_composition_enabled(&composition_enabled); dwm_is_composition_enabled(&composition_enabled);
@ -64,7 +64,7 @@ bool FramelessEventFilter::nativeEventFilter(const QByteArray &eventType, void *
if (wp != nullptr && (wp->flags & SWP_NOSIZE) == 0) if (wp != nullptr && (wp->flags & SWP_NOSIZE) == 0)
{ {
wp->flags |= SWP_NOCOPYBITS; wp->flags |= SWP_NOCOPYBITS;
*result = 0; *result = ::DefWindowProcW(hwnd, uMsg, wParam, lParam);
return true; return true;
} }
return false; return false;
@ -82,7 +82,7 @@ bool FramelessEventFilter::nativeEventFilter(const QByteArray &eventType, void *
return true; return true;
} }
int offsetSize = 0; int offsetSize = 0;
bool isMaximum = IsZoomed(hwnd); bool isMaximum = ::IsZoomed(hwnd);
offsetXY = QPoint(abs(clientRect->left - originalLeft),abs(clientRect->top - originalTop)); offsetXY = QPoint(abs(clientRect->left - originalLeft),abs(clientRect->top - originalTop));
if(isMaximum || _helper->fullScreen()){ if(isMaximum || _helper->fullScreen()){
_helper->setOriginalPos(QPoint(originalLeft,originalTop)); _helper->setOriginalPos(QPoint(originalLeft,originalTop));
@ -171,7 +171,7 @@ bool FramelessEventFilter::nativeEventFilter(const QByteArray &eventType, void *
*result = FALSE; *result = FALSE;
return true; return true;
}else if(uMsg == WM_NCACTIVATE){ }else if(uMsg == WM_NCACTIVATE){
*result = DefWindowProcW(hwnd, WM_NCACTIVATE, wParam, -1); *result = ::DefWindowProcW(hwnd, WM_NCACTIVATE, wParam, -1);
return true; return true;
}else if(uMsg == WM_GETMINMAXINFO){ }else if(uMsg == WM_GETMINMAXINFO){
#if QT_VERSION < QT_VERSION_CHECK(6,2,4) #if QT_VERSION < QT_VERSION_CHECK(6,2,4)
@ -322,21 +322,21 @@ void FluFramelessHelper::componentComplete(){
HWND hwnd = reinterpret_cast<HWND>(window->winId()); HWND hwnd = reinterpret_cast<HWND>(window->winId());
DWORD style = ::GetWindowLong(hwnd, GWL_STYLE); DWORD style = ::GetWindowLong(hwnd, GWL_STYLE);
if(resizeable()){ if(resizeable()){
SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_MAXIMIZEBOX | WS_THICKFRAME); ::SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_MAXIMIZEBOX | WS_THICKFRAME);
}else{ }else{
SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_THICKFRAME); ::SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_THICKFRAME);
} }
LONG exstyle = ::GetWindowLong(hwnd, GWL_EXSTYLE); LONG exstyle = ::GetWindowLong(hwnd, GWL_EXSTYLE);
exstyle = exstyle | WS_EX_LAYERED; exstyle = exstyle | WS_EX_LAYERED;
SetWindowLongPtr(hwnd, GWL_EXSTYLE, exstyle); ::SetWindowLongPtr(hwnd, GWL_EXSTYLE, exstyle);
SetLayeredWindowAttributes(hwnd, RGB(251, 255, 242), 0, LWA_COLORKEY); ::SetLayeredWindowAttributes(hwnd, RGB(251, 255, 242), 0, LWA_COLORKEY);
connect(window,&QQuickWindow::activeChanged,this,[this,hwnd]{ connect(window,&QQuickWindow::activeChanged,this,[this,hwnd]{
if(this->window->isActive()){ if(this->window->isActive()){
LONG exstyle = ::GetWindowLong(hwnd, GWL_EXSTYLE); LONG exstyle = ::GetWindowLong(hwnd, GWL_EXSTYLE);
if(exstyle & WS_EX_LAYERED){ if(exstyle & WS_EX_LAYERED){
exstyle = exstyle &~ WS_EX_LAYERED; exstyle = exstyle &~ WS_EX_LAYERED;
SetWindowLongPtr(hwnd, GWL_EXSTYLE, exstyle); ::SetWindowLongPtr(hwnd, GWL_EXSTYLE, exstyle);
SetWindowPos(hwnd,nullptr,0,0,0,0,SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED); ::SetWindowPos(hwnd,nullptr,0,0,0,0,SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
} }
} }
}); });
@ -362,36 +362,36 @@ void FluFramelessHelper::componentComplete(){
void FluFramelessHelper::_onScreenChanged(){ void FluFramelessHelper::_onScreenChanged(){
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
HWND hwnd = reinterpret_cast<HWND>(window->winId()); HWND hwnd = reinterpret_cast<HWND>(window->winId());
SetWindowPos(hwnd,0,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED | SWP_NOOWNERZORDER); ::SetWindowPos(hwnd,0,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED | SWP_NOOWNERZORDER);
RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW); ::RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW);
#endif #endif
} }
void FluFramelessHelper::showSystemMenu(QPoint point){ void FluFramelessHelper::showSystemMenu(QPoint point){
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
HWND hwnd = reinterpret_cast<HWND>(window->winId()); HWND hwnd = reinterpret_cast<HWND>(window->winId());
DWORD style = GetWindowLongPtr(hwnd,GWL_STYLE); DWORD style = ::GetWindowLongPtr(hwnd,GWL_STYLE);
SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_SYSMENU); ::SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_SYSMENU);
const HMENU hMenu = ::GetSystemMenu(hwnd, FALSE); const HMENU hMenu = ::GetSystemMenu(hwnd, FALSE);
if(maximized() || fullScreen()){ if(maximized() || fullScreen()){
EnableMenuItem(hMenu,SC_MOVE,MFS_DISABLED); ::EnableMenuItem(hMenu,SC_MOVE,MFS_DISABLED);
EnableMenuItem(hMenu,SC_RESTORE,MFS_ENABLED); ::EnableMenuItem(hMenu,SC_RESTORE,MFS_ENABLED);
}else{ }else{
EnableMenuItem(hMenu,SC_MOVE,MFS_ENABLED); ::EnableMenuItem(hMenu,SC_MOVE,MFS_ENABLED);
EnableMenuItem(hMenu,SC_RESTORE,MFS_DISABLED); ::EnableMenuItem(hMenu,SC_RESTORE,MFS_DISABLED);
} }
if(resizeable() && !maximized() && !fullScreen()){ if(resizeable() && !maximized() && !fullScreen()){
EnableMenuItem(hMenu,SC_SIZE,MFS_ENABLED); ::EnableMenuItem(hMenu,SC_SIZE,MFS_ENABLED);
EnableMenuItem(hMenu,SC_MAXIMIZE,MFS_ENABLED); ::EnableMenuItem(hMenu,SC_MAXIMIZE,MFS_ENABLED);
}else{ }else{
EnableMenuItem(hMenu,SC_SIZE,MFS_DISABLED); ::EnableMenuItem(hMenu,SC_SIZE,MFS_DISABLED);
EnableMenuItem(hMenu,SC_MAXIMIZE,MFS_DISABLED); ::EnableMenuItem(hMenu,SC_MAXIMIZE,MFS_DISABLED);
} }
const int result = TrackPopupMenu(hMenu, (TPM_RETURNCMD | (QGuiApplication::isRightToLeft() ? TPM_RIGHTALIGN : TPM_LEFTALIGN)), point.x()*window->devicePixelRatio(), point.y()*window->devicePixelRatio(), 0, hwnd, nullptr); const int result = ::TrackPopupMenu(hMenu, (TPM_RETURNCMD | (QGuiApplication::isRightToLeft() ? TPM_RIGHTALIGN : TPM_LEFTALIGN)), point.x()*window->devicePixelRatio(), point.y()*window->devicePixelRatio(), 0, hwnd, nullptr);
if (result != FALSE) { if (result != FALSE) {
PostMessageW(hwnd, WM_SYSCOMMAND, result, 0); ::PostMessageW(hwnd, WM_SYSCOMMAND, result, 0);
} }
SetWindowLongPtr(hwnd, GWL_STYLE, style &~ WS_SYSMENU); ::SetWindowLongPtr(hwnd, GWL_STYLE, style &~ WS_SYSMENU);
#endif #endif
} }
@ -400,9 +400,9 @@ void FluFramelessHelper::_onStayTopChange(){
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
HWND hwnd = reinterpret_cast<HWND>(window->winId()); HWND hwnd = reinterpret_cast<HWND>(window->winId());
if(isStayTop){ if(isStayTop){
SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); ::SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
}else{ }else{
SetWindowPos(hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); ::SetWindowPos(hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
} }
#else #else
window->setFlag(Qt::WindowStaysOnTopHint,isStayTop); window->setFlag(Qt::WindowStaysOnTopHint,isStayTop);

View File

@ -41,7 +41,7 @@ FluPopup {
FluText{ FluText{
id:text_message id:text_message
font: FluTextStyle.Body font: FluTextStyle.Body
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
text:message text:message
width: parent.width width: parent.width
topPadding: 4 topPadding: 4
@ -67,7 +67,7 @@ FluPopup {
topPadding: 20 topPadding: 20
leftPadding: 20 leftPadding: 20
rightPadding: 20 rightPadding: 20
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
} }
FluLoader{ FluLoader{
sourceComponent: com_message sourceComponent: com_message

View File

@ -45,7 +45,7 @@ Button {
radius: parent.radius radius: parent.radius
anchors{ anchors{
fill: parent fill: parent
topMargin: control.enabled ? 1 : 0 topMargin: control.enabled ? 0 : 0
leftMargin: control.enabled ? 1 : 0 leftMargin: control.enabled ? 1 : 0
rightMargin: control.enabled ? 1 : 0 rightMargin: control.enabled ? 1 : 0
bottomMargin: control.enabled ? 2 : 0 bottomMargin: control.enabled ? 2 : 0

View File

@ -192,13 +192,13 @@ FluObject {
spacing: 5 spacing: 5
FluText{ FluText{
text:_super.text text:_super.text
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
width: Math.min(implicitWidth,mcontrol.maxWidth) width: Math.min(implicitWidth,mcontrol.maxWidth)
} }
FluText{ FluText{
text: _super.moremsg text: _super.moremsg
visible: _super.moremsg visible: _super.moremsg
wrapMode : Text.WordWrap wrapMode : Text.WrapAnywhere
textColor: FluColors.Grey120 textColor: FluColors.Grey120
width: Math.min(implicitWidth,mcontrol.maxWidth) width: Math.min(implicitWidth,mcontrol.maxWidth)
} }

View File

@ -40,6 +40,7 @@ T.MenuItem {
icon.height: 24 icon.height: 24
icon.color: control.palette.windowText icon.color: control.palette.windowText
height: visible ? implicitHeight : 0 height: visible ? implicitHeight : 0
font:FluTextStyle.Body
Component{ Component{
id:com_icon id:com_icon
FluIcon{ FluIcon{
@ -69,6 +70,7 @@ T.MenuItem {
FluText { FluText {
id:content_text id:content_text
text: control.text text: control.text
font: control.font
color: control.textColor color: control.textColor
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }

View File

@ -20,7 +20,7 @@ TextArea{
return normalColor return normalColor
} }
font:FluTextStyle.Body font:FluTextStyle.Body
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
padding: 8 padding: 8
leftPadding: padding+4 leftPadding: padding+4
renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering

View File

@ -141,7 +141,7 @@ Rectangle {
id:item_text id:item_text
text: String(display) text: String(display)
elide: Text.ElideRight elide: Text.ElideRight
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
anchors{ anchors{
fill: parent fill: parent
leftMargin: 11 leftMargin: 11

View File

@ -95,7 +95,7 @@ Item{
Component{ Component{
id:com_lable id:com_lable
FluText{ FluText{
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft
text: { text: {
if(modelData.lable){ if(modelData.lable){
@ -110,7 +110,7 @@ Item{
Component{ Component{
id:com_text id:com_text
FluText{ FluText{
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft
text: modelData.text text: modelData.text
textFormat: Text.RichText textFormat: Text.RichText

View File

@ -61,7 +61,7 @@ Button {
radius: parent.radius radius: parent.radius
anchors{ anchors{
fill: parent fill: parent
topMargin: checked && enabled ? 1 : 0 topMargin: checked && enabled ? 0 : 0
leftMargin: checked && enabled ? 1 : 0 leftMargin: checked && enabled ? 1 : 0
rightMargin: checked && enabled ? 1 : 0 rightMargin: checked && enabled ? 1 : 0
bottomMargin: checked && enabled ? 2 : 0 bottomMargin: checked && enabled ? 2 : 0

View File

@ -145,7 +145,7 @@ Popup{
FluText{ FluText{
id: text_desc id: text_desc
font: FluTextStyle.Body font: FluTextStyle.Body
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
maximumLineCount: 4 maximumLineCount: 4
elide: Text.ElideRight elide: Text.ElideRight
text: d.step.description text: d.step.description

View File

@ -41,7 +41,7 @@ FluPopup {
FluText{ FluText{
id:text_message id:text_message
font: FluTextStyle.Body font: FluTextStyle.Body
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
text:message text:message
width: parent.width width: parent.width
topPadding: 4 topPadding: 4
@ -67,7 +67,7 @@ FluPopup {
topPadding: 20 topPadding: 20
leftPadding: 20 leftPadding: 20
rightPadding: 20 rightPadding: 20
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
} }
FluLoader{ FluLoader{
sourceComponent: com_message sourceComponent: com_message

View File

@ -46,7 +46,7 @@ Button {
radius: parent.radius radius: parent.radius
anchors{ anchors{
fill: parent fill: parent
topMargin: control.enabled ? 1 : 0 topMargin: control.enabled ? 0 : 0
leftMargin: control.enabled ? 1 : 0 leftMargin: control.enabled ? 1 : 0
rightMargin: control.enabled ? 1 : 0 rightMargin: control.enabled ? 1 : 0
bottomMargin: control.enabled ? 2 : 0 bottomMargin: control.enabled ? 2 : 0

View File

@ -192,13 +192,13 @@ FluObject {
spacing: 5 spacing: 5
FluText{ FluText{
text:_super.text text:_super.text
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
width: Math.min(implicitWidth,mcontrol.maxWidth) width: Math.min(implicitWidth,mcontrol.maxWidth)
} }
FluText{ FluText{
text: _super.moremsg text: _super.moremsg
visible: _super.moremsg visible: _super.moremsg
wrapMode : Text.WordWrap wrapMode : Text.WrapAnywhere
textColor: FluColors.Grey120 textColor: FluColors.Grey120
width: Math.min(implicitWidth,mcontrol.maxWidth) width: Math.min(implicitWidth,mcontrol.maxWidth)
} }

View File

@ -41,6 +41,7 @@ T.MenuItem {
icon.height: 24 icon.height: 24
icon.color: control.palette.windowText icon.color: control.palette.windowText
height: visible ? implicitHeight : 0 height: visible ? implicitHeight : 0
font:FluTextStyle.Body
Component{ Component{
id:com_icon id:com_icon
FluIcon{ FluIcon{
@ -70,6 +71,7 @@ T.MenuItem {
FluText { FluText {
id:content_text id:content_text
text: control.text text: control.text
font: control.font
color: control.textColor color: control.textColor
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }

View File

@ -21,7 +21,7 @@ TextArea{
return normalColor return normalColor
} }
font:FluTextStyle.Body font:FluTextStyle.Body
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
padding: 8 padding: 8
leftPadding: padding+4 leftPadding: padding+4
renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering

View File

@ -142,7 +142,7 @@ Rectangle {
id:item_text id:item_text
text: String(display) text: String(display)
elide: Text.ElideRight elide: Text.ElideRight
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
anchors{ anchors{
fill: parent fill: parent
leftMargin: 11 leftMargin: 11

View File

@ -95,7 +95,7 @@ Item{
Component{ Component{
id:com_lable id:com_lable
FluText{ FluText{
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft
text: { text: {
if(modelData.lable){ if(modelData.lable){
@ -110,7 +110,7 @@ Item{
Component{ Component{
id:com_text id:com_text
FluText{ FluText{
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft
text: modelData.text text: modelData.text
textFormat: Text.RichText textFormat: Text.RichText

View File

@ -57,7 +57,7 @@ Button {
radius: parent.radius radius: parent.radius
anchors{ anchors{
fill: parent fill: parent
topMargin: checked && enabled ? 1 : 0 topMargin: checked && enabled ? 0 : 0
leftMargin: checked && enabled ? 1 : 0 leftMargin: checked && enabled ? 1 : 0
rightMargin: checked && enabled ? 1 : 0 rightMargin: checked && enabled ? 1 : 0
bottomMargin: checked && enabled ? 2 : 0 bottomMargin: checked && enabled ? 2 : 0

View File

@ -145,7 +145,7 @@ Popup{
FluText{ FluText{
id: text_desc id: text_desc
font: FluTextStyle.Body font: FluTextStyle.Body
wrapMode: Text.WordWrap wrapMode: Text.WrapAnywhere
maximumLineCount: 4 maximumLineCount: 4
elide: Text.ElideRight elide: Text.ElideRight
text: d.step.description text: d.step.description