mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-01-22 20:04:32 +08:00
Compare commits
4 Commits
0d61e33ef1
...
4cca680029
Author | SHA1 | Date | |
---|---|---|---|
|
4cca680029 | ||
|
fe2543ab4d | ||
|
394a42cb94 | ||
|
ac253a3de5 |
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user