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
|
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)
|
find_program(QML_PLUGIN_DUMP NAMES qmlplugindump)
|
||||||
add_custom_target(Script-Generate-QmlTypes
|
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
|
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;
|
*result = HTCLIENT;
|
||||||
return true;
|
return true;
|
||||||
} else if (uMsg == WM_NCPAINT) {
|
} 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()) {
|
if (isCompositionEnabled()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
*result = FALSE;
|
*result = FALSE;
|
||||||
return true;
|
return true;
|
||||||
|
#endif
|
||||||
} else if (uMsg == WM_NCACTIVATE) {
|
} 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()) {
|
if (isCompositionEnabled()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
*result = TRUE;
|
*result = TRUE;
|
||||||
return true;
|
return true;
|
||||||
|
#endif
|
||||||
} else if (uMsg == WM_GETMINMAXINFO) {
|
} else if (uMsg == WM_GETMINMAXINFO) {
|
||||||
#if (QT_VERSION == QT_VERSION_CHECK(6, 5, 3) || QT_VERSION == QT_VERSION_CHECK(6, 6, 0))
|
#if (QT_VERSION == QT_VERSION_CHECK(6, 5, 3) || QT_VERSION == QT_VERSION_CHECK(6, 6, 0))
|
||||||
auto *minmaxInfo = reinterpret_cast<MINMAXINFO *>(lParam);
|
auto *minmaxInfo = reinterpret_cast<MINMAXINFO *>(lParam);
|
||||||
|
@ -19,6 +19,7 @@ Rectangle {
|
|||||||
property bool verticalHeaderVisible: true
|
property bool verticalHeaderVisible: true
|
||||||
property color selectedBorderColor: FluTheme.primaryColor
|
property color selectedBorderColor: FluTheme.primaryColor
|
||||||
property color selectedColor: FluTools.withOpacity(FluTheme.primaryColor,0.3)
|
property color selectedColor: FluTools.withOpacity(FluTheme.primaryColor,0.3)
|
||||||
|
property alias view: table_view
|
||||||
id:control
|
id:control
|
||||||
color: {
|
color: {
|
||||||
if(Window.active){
|
if(Window.active){
|
||||||
@ -47,6 +48,9 @@ Rectangle {
|
|||||||
header_column_model.rows = [headerRow]
|
header_column_model.rows = [headerRow]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Component.onDestruction: {
|
||||||
|
table_view.contentY = 0
|
||||||
|
}
|
||||||
QtObject{
|
QtObject{
|
||||||
id:d
|
id:d
|
||||||
property var current
|
property var current
|
||||||
@ -896,6 +900,7 @@ Rectangle {
|
|||||||
item_table_frozen_header.contentX = columnModel.width * _index
|
item_table_frozen_header.contentX = columnModel.width * _index
|
||||||
item_table_frozen.contentX = columnModel.width * _index
|
item_table_frozen.contentX = columnModel.width * _index
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,7 @@ Rectangle {
|
|||||||
property color selectedBorderColor: FluTheme.primaryColor
|
property color selectedBorderColor: FluTheme.primaryColor
|
||||||
property color selectedColor: FluTools.withOpacity(FluTheme.primaryColor,0.3)
|
property color selectedColor: FluTools.withOpacity(FluTheme.primaryColor,0.3)
|
||||||
readonly property alias current: d.current
|
readonly property alias current: d.current
|
||||||
|
property alias view: table_view
|
||||||
id:control
|
id:control
|
||||||
color: {
|
color: {
|
||||||
if(Window.active){
|
if(Window.active){
|
||||||
@ -45,6 +46,9 @@ Rectangle {
|
|||||||
id:tree_model
|
id:tree_model
|
||||||
columnSource: control.columnSource
|
columnSource: control.columnSource
|
||||||
}
|
}
|
||||||
|
Component.onDestruction: {
|
||||||
|
table_view.contentY = 0
|
||||||
|
}
|
||||||
onDepthPaddingChanged: {
|
onDepthPaddingChanged: {
|
||||||
table_view.forceLayout()
|
table_view.forceLayout()
|
||||||
}
|
}
|
||||||
|
@ -122,12 +122,21 @@ Window {
|
|||||||
fillMode: Image.PreserveAspectCrop
|
fillMode: Image.PreserveAspectCrop
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
var geometry = FluTools.desktopAvailableGeometry(window)
|
img_back.updateLayout()
|
||||||
width = geometry.width
|
|
||||||
height = geometry.height
|
|
||||||
sourceSize = Qt.size(width,height)
|
|
||||||
source = FluTools.getUrlByFilePath(FluTheme.desktopImagePath)
|
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{
|
Connections{
|
||||||
target: FluTheme
|
target: FluTheme
|
||||||
function onDesktopImagePathChanged(){
|
function onDesktopImagePathChanged(){
|
||||||
@ -157,7 +166,7 @@ Window {
|
|||||||
blurRadius: 64
|
blurRadius: 64
|
||||||
visible: window.active && FluTheme.blurBehindWindowEnabled
|
visible: window.active && FluTheme.blurBehindWindowEnabled
|
||||||
tintColor: FluTheme.dark ? Qt.rgba(0, 0, 0, 1) : Qt.rgba(1, 1, 1, 1)
|
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 bool verticalHeaderVisible: true
|
||||||
property color selectedBorderColor: FluTheme.primaryColor
|
property color selectedBorderColor: FluTheme.primaryColor
|
||||||
property color selectedColor: FluTools.withOpacity(FluTheme.primaryColor,0.3)
|
property color selectedColor: FluTools.withOpacity(FluTheme.primaryColor,0.3)
|
||||||
|
property alias view: table_view
|
||||||
id:control
|
id:control
|
||||||
color: {
|
color: {
|
||||||
if(Window.active){
|
if(Window.active){
|
||||||
@ -47,6 +48,9 @@ Rectangle {
|
|||||||
header_column_model.rows = [headerRow]
|
header_column_model.rows = [headerRow]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Component.onDestruction: {
|
||||||
|
table_view.contentY = 0
|
||||||
|
}
|
||||||
QtObject{
|
QtObject{
|
||||||
id:d
|
id:d
|
||||||
property var current
|
property var current
|
||||||
@ -896,6 +900,7 @@ Rectangle {
|
|||||||
item_table_frozen_header.contentX = columnModel.width * _index
|
item_table_frozen_header.contentX = columnModel.width * _index
|
||||||
item_table_frozen.contentX = columnModel.width * _index
|
item_table_frozen.contentX = columnModel.width * _index
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,7 @@ Rectangle {
|
|||||||
property color selectedBorderColor: FluTheme.primaryColor
|
property color selectedBorderColor: FluTheme.primaryColor
|
||||||
property color selectedColor: FluTools.withOpacity(FluTheme.primaryColor,0.3)
|
property color selectedColor: FluTools.withOpacity(FluTheme.primaryColor,0.3)
|
||||||
readonly property alias current: d.current
|
readonly property alias current: d.current
|
||||||
|
property alias view: table_view
|
||||||
id:control
|
id:control
|
||||||
color: {
|
color: {
|
||||||
if(Window.active){
|
if(Window.active){
|
||||||
@ -28,21 +29,26 @@ Rectangle {
|
|||||||
tree_model.setDataSource(dataSource)
|
tree_model.setDataSource(dataSource)
|
||||||
}
|
}
|
||||||
onColumnSourceChanged: {
|
onColumnSourceChanged: {
|
||||||
var columns= []
|
if(columnSource.length !== 0){
|
||||||
var headerRow = {}
|
var columns= []
|
||||||
columnSource.forEach(function(item){
|
var headerRow = {}
|
||||||
var column = Qt.createQmlObject('import Qt.labs.qmlmodels 1.0;TableModelColumn{}',control);
|
columnSource.forEach(function(item){
|
||||||
column.display = item.dataIndex
|
var column = Qt.createQmlObject('import Qt.labs.qmlmodels 1.0;TableModelColumn{}',control);
|
||||||
columns.push(column)
|
column.display = item.dataIndex
|
||||||
headerRow[item.dataIndex] = item.title
|
columns.push(column)
|
||||||
})
|
headerRow[item.dataIndex] = item.title
|
||||||
header_column_model.columns = columns
|
})
|
||||||
header_column_model.rows = [headerRow]
|
header_column_model.columns = columns
|
||||||
|
header_column_model.rows = [headerRow]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
FluTreeModel{
|
FluTreeModel{
|
||||||
id:tree_model
|
id:tree_model
|
||||||
columnSource: control.columnSource
|
columnSource: control.columnSource
|
||||||
}
|
}
|
||||||
|
Component.onDestruction: {
|
||||||
|
table_view.contentY = 0
|
||||||
|
}
|
||||||
onDepthPaddingChanged: {
|
onDepthPaddingChanged: {
|
||||||
table_view.forceLayout()
|
table_view.forceLayout()
|
||||||
}
|
}
|
||||||
|
@ -121,12 +121,21 @@ Window {
|
|||||||
fillMode: Image.PreserveAspectCrop
|
fillMode: Image.PreserveAspectCrop
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
var geometry = FluTools.desktopAvailableGeometry(window)
|
img_back.updateLayout()
|
||||||
width = geometry.width
|
|
||||||
height = geometry.height
|
|
||||||
sourceSize = Qt.size(width,height)
|
|
||||||
source = FluTools.getUrlByFilePath(FluTheme.desktopImagePath)
|
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{
|
Connections{
|
||||||
target: FluTheme
|
target: FluTheme
|
||||||
function onDesktopImagePathChanged(){
|
function onDesktopImagePathChanged(){
|
||||||
@ -156,7 +165,7 @@ Window {
|
|||||||
blurRadius: 64
|
blurRadius: 64
|
||||||
visible: window.active && FluTheme.blurBehindWindowEnabled
|
visible: window.active && FluTheme.blurBehindWindowEnabled
|
||||||
tintColor: FluTheme.dark ? Qt.rgba(0, 0, 0, 1) : Qt.rgba(1, 1, 1, 1)
|
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