Compare commits

...

4 Commits

Author SHA1 Message Date
朱子楚\zhuzi
4cca680029 update 2024-05-05 22:05:18 +08:00
朱子楚\zhuzi
fe2543ab4d fix bug 2024-05-05 22:03:41 +08:00
朱子楚\zhuzi
394a42cb94 update 2024-05-05 21:33:47 +08:00
朱子楚\zhuzi
ac253a3de5 fix bug 2024-05-05 20:32:48 +08:00
8 changed files with 69 additions and 21 deletions

View File

@ -180,7 +180,7 @@ target_link_libraries(${PROJECT_NAME} PUBLIC
Qt${QT_VERSION_MAJOR}::Qml
)
if (${QT_VERSION_MAJOR} LESS_EQUAL 6)
if ((${QT_VERSION_MAJOR} LESS_EQUAL 6) AND (CMAKE_BUILD_TYPE MATCHES "Release"))
find_program(QML_PLUGIN_DUMP NAMES qmlplugindump)
add_custom_target(Script-Generate-QmlTypes
COMMAND ${QML_PLUGIN_DUMP} -nonrelocatable FluentUI 1.0 ${CMAKE_CURRENT_BINARY_DIR} > ${CMAKE_CURRENT_SOURCE_DIR}/Qt5/imports/FluentUI/plugins.qmltypes

View File

@ -259,17 +259,27 @@ void FluFrameless::componentComplete() {
*result = HTCLIENT;
return true;
} else if (uMsg == WM_NCPAINT) {
#if (QT_VERSION == QT_VERSION_CHECK(6, 5, 3) || QT_VERSION == QT_VERSION_CHECK(6, 6, 0))
*result = FALSE;
return true;
#else
if (isCompositionEnabled()) {
return false;
}
*result = FALSE;
return true;
#endif
} else if (uMsg == WM_NCACTIVATE) {
#if (QT_VERSION == QT_VERSION_CHECK(6, 5, 3) || QT_VERSION == QT_VERSION_CHECK(6, 6, 0))
*result = TRUE;
return true;
#else
if (isCompositionEnabled()) {
return false;
}
*result = TRUE;
return true;
#endif
} else if (uMsg == WM_GETMINMAXINFO) {
#if (QT_VERSION == QT_VERSION_CHECK(6, 5, 3) || QT_VERSION == QT_VERSION_CHECK(6, 6, 0))
auto *minmaxInfo = reinterpret_cast<MINMAXINFO *>(lParam);

View File

@ -19,6 +19,7 @@ Rectangle {
property bool verticalHeaderVisible: true
property color selectedBorderColor: FluTheme.primaryColor
property color selectedColor: FluTools.withOpacity(FluTheme.primaryColor,0.3)
property alias view: table_view
id:control
color: {
if(Window.active){
@ -47,6 +48,9 @@ Rectangle {
header_column_model.rows = [headerRow]
}
}
Component.onDestruction: {
table_view.contentY = 0
}
QtObject{
id:d
property var current
@ -896,6 +900,7 @@ Rectangle {
item_table_frozen_header.contentX = columnModel.width * _index
item_table_frozen.contentX = columnModel.width * _index
}
}
}
}

View File

@ -17,6 +17,7 @@ Rectangle {
property color selectedBorderColor: FluTheme.primaryColor
property color selectedColor: FluTools.withOpacity(FluTheme.primaryColor,0.3)
readonly property alias current: d.current
property alias view: table_view
id:control
color: {
if(Window.active){
@ -45,6 +46,9 @@ Rectangle {
id:tree_model
columnSource: control.columnSource
}
Component.onDestruction: {
table_view.contentY = 0
}
onDepthPaddingChanged: {
table_view.forceLayout()
}

View File

@ -122,12 +122,21 @@ Window {
fillMode: Image.PreserveAspectCrop
asynchronous: true
Component.onCompleted: {
var geometry = FluTools.desktopAvailableGeometry(window)
width = geometry.width
height = geometry.height
sourceSize = Qt.size(width,height)
img_back.updateLayout()
source = FluTools.getUrlByFilePath(FluTheme.desktopImagePath)
}
Connections{
target: window
function onScreenChanged(){
img_back.updateLayout()
}
}
function updateLayout(){
var geometry = FluTools.desktopAvailableGeometry(window)
img_back.width = geometry.width
img_back.height = geometry.height
img_back.sourceSize = Qt.size(img_back.width,img_back.height)
}
Connections{
target: FluTheme
function onDesktopImagePathChanged(){
@ -157,7 +166,7 @@ Window {
blurRadius: 64
visible: window.active && FluTheme.blurBehindWindowEnabled
tintColor: FluTheme.dark ? Qt.rgba(0, 0, 0, 1) : Qt.rgba(1, 1, 1, 1)
targetRect: Qt.rect(window.x,window.y,window.width,window.height)
targetRect: Qt.rect(window.x-window.screen.virtualX,window.y-window.screen.virtualY,window.width,window.height)
}
}
}

View File

@ -19,6 +19,7 @@ Rectangle {
property bool verticalHeaderVisible: true
property color selectedBorderColor: FluTheme.primaryColor
property color selectedColor: FluTools.withOpacity(FluTheme.primaryColor,0.3)
property alias view: table_view
id:control
color: {
if(Window.active){
@ -47,6 +48,9 @@ Rectangle {
header_column_model.rows = [headerRow]
}
}
Component.onDestruction: {
table_view.contentY = 0
}
QtObject{
id:d
property var current
@ -896,6 +900,7 @@ Rectangle {
item_table_frozen_header.contentX = columnModel.width * _index
item_table_frozen.contentX = columnModel.width * _index
}
}
}
}

View File

@ -17,6 +17,7 @@ Rectangle {
property color selectedBorderColor: FluTheme.primaryColor
property color selectedColor: FluTools.withOpacity(FluTheme.primaryColor,0.3)
readonly property alias current: d.current
property alias view: table_view
id:control
color: {
if(Window.active){
@ -28,21 +29,26 @@ Rectangle {
tree_model.setDataSource(dataSource)
}
onColumnSourceChanged: {
var columns= []
var headerRow = {}
columnSource.forEach(function(item){
var column = Qt.createQmlObject('import Qt.labs.qmlmodels 1.0;TableModelColumn{}',control);
column.display = item.dataIndex
columns.push(column)
headerRow[item.dataIndex] = item.title
})
header_column_model.columns = columns
header_column_model.rows = [headerRow]
if(columnSource.length !== 0){
var columns= []
var headerRow = {}
columnSource.forEach(function(item){
var column = Qt.createQmlObject('import Qt.labs.qmlmodels 1.0;TableModelColumn{}',control);
column.display = item.dataIndex
columns.push(column)
headerRow[item.dataIndex] = item.title
})
header_column_model.columns = columns
header_column_model.rows = [headerRow]
}
}
FluTreeModel{
id:tree_model
columnSource: control.columnSource
}
Component.onDestruction: {
table_view.contentY = 0
}
onDepthPaddingChanged: {
table_view.forceLayout()
}

View File

@ -121,12 +121,21 @@ Window {
fillMode: Image.PreserveAspectCrop
asynchronous: true
Component.onCompleted: {
var geometry = FluTools.desktopAvailableGeometry(window)
width = geometry.width
height = geometry.height
sourceSize = Qt.size(width,height)
img_back.updateLayout()
source = FluTools.getUrlByFilePath(FluTheme.desktopImagePath)
}
Connections{
target: window
function onScreenChanged(){
img_back.updateLayout()
}
}
function updateLayout(){
var geometry = FluTools.desktopAvailableGeometry(window)
img_back.width = geometry.width
img_back.height = geometry.height
img_back.sourceSize = Qt.size(img_back.width,img_back.height)
}
Connections{
target: FluTheme
function onDesktopImagePathChanged(){
@ -156,7 +165,7 @@ Window {
blurRadius: 64
visible: window.active && FluTheme.blurBehindWindowEnabled
tintColor: FluTheme.dark ? Qt.rgba(0, 0, 0, 1) : Qt.rgba(1, 1, 1, 1)
targetRect: Qt.rect(window.x,window.y,window.width,window.height)
targetRect: Qt.rect(window.x-window.screen.virtualX,window.y-window.screen.virtualY,window.width,window.height)
}
}
}