mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-02-09 08:15:41 +08:00
Compare commits
No commits in common. "4997b991db3238376121af5aa9e9cbe3a52c4616" and "e6c4b792986fe0eae73748698b74f394ed81b6d6" have entirely different histories.
4997b991db
...
e6c4b79298
@ -160,6 +160,7 @@ void FluFrameless::componentComplete() {
|
|||||||
const auto uMsg = msg->message;
|
const auto uMsg = msg->message;
|
||||||
const auto wParam = msg->wParam;
|
const auto wParam = msg->wParam;
|
||||||
const auto lParam = msg->lParam;
|
const auto lParam = msg->lParam;
|
||||||
|
static int offsetXY;
|
||||||
if (uMsg == WM_WINDOWPOSCHANGING) {
|
if (uMsg == WM_WINDOWPOSCHANGING) {
|
||||||
auto *wp = reinterpret_cast<WINDOWPOS *>(lParam);
|
auto *wp = reinterpret_cast<WINDOWPOS *>(lParam);
|
||||||
if (wp != nullptr && (wp->flags & SWP_NOSIZE) == 0) {
|
if (wp != nullptr && (wp->flags & SWP_NOSIZE) == 0) {
|
||||||
@ -179,6 +180,9 @@ void FluFrameless::componentComplete() {
|
|||||||
*result = static_cast<QT_NATIVE_EVENT_RESULT_TYPE>(hitTestResult);
|
*result = static_cast<QT_NATIVE_EVENT_RESULT_TYPE>(hitTestResult);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (clientRect->left - originalLeft != 0) {
|
||||||
|
offsetXY = clientRect->left - originalLeft;
|
||||||
|
}
|
||||||
#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))
|
||||||
clientRect->top = originalTop;
|
clientRect->top = originalTop;
|
||||||
clientRect->bottom = originalBottom;
|
clientRect->bottom = originalBottom;
|
||||||
@ -186,19 +190,16 @@ void FluFrameless::componentComplete() {
|
|||||||
clientRect->right = originalRight;
|
clientRect->right = originalRight;
|
||||||
#else
|
#else
|
||||||
bool isMaximum = ::IsZoomed(hwnd);
|
bool isMaximum = ::IsZoomed(hwnd);
|
||||||
if (isMaximum) {
|
if (!isMaximum) {
|
||||||
auto geometry = window()->screen()->geometry();
|
|
||||||
auto offsetX = qAbs(geometry.left()-originalLeft);
|
|
||||||
auto offsetY = qAbs(geometry.top()-originalTop);
|
|
||||||
clientRect->top = originalTop + offsetY;
|
|
||||||
clientRect->bottom = originalBottom - offsetY;
|
|
||||||
clientRect->left = originalLeft + offsetX;
|
|
||||||
clientRect->right = originalRight - offsetX;
|
|
||||||
} else {
|
|
||||||
clientRect->top = originalTop;
|
clientRect->top = originalTop;
|
||||||
clientRect->bottom = originalBottom;
|
clientRect->bottom = originalBottom;
|
||||||
clientRect->left = originalLeft;
|
clientRect->left = originalLeft;
|
||||||
clientRect->right = originalRight;
|
clientRect->right = originalRight;
|
||||||
|
} else {
|
||||||
|
clientRect->top = originalTop + offsetXY;
|
||||||
|
clientRect->bottom = originalBottom - offsetXY;
|
||||||
|
clientRect->left = originalLeft + offsetXY;
|
||||||
|
clientRect->right = originalRight - offsetXY;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
_setMaximizeHovered(false);
|
_setMaximizeHovered(false);
|
||||||
@ -358,6 +359,8 @@ void FluFrameless::_showSystemMenu(QPoint point) {
|
|||||||
const QPoint origin = screen->geometry().topLeft();
|
const QPoint origin = screen->geometry().topLeft();
|
||||||
auto nativePos = QPointF(QPointF(point - origin) * window()->devicePixelRatio()).toPoint() + origin;
|
auto nativePos = QPointF(QPointF(point - origin) * window()->devicePixelRatio()).toPoint() + origin;
|
||||||
HWND hwnd = reinterpret_cast<HWND>(window()->winId());
|
HWND hwnd = reinterpret_cast<HWND>(window()->winId());
|
||||||
|
DWORD style = ::GetWindowLongPtr(hwnd, GWL_STYLE);
|
||||||
|
::SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_SYSMENU);
|
||||||
auto hMenu = ::GetSystemMenu(hwnd, FALSE);
|
auto hMenu = ::GetSystemMenu(hwnd, FALSE);
|
||||||
if (_isMaximized() || _isFullScreen()) {
|
if (_isMaximized() || _isFullScreen()) {
|
||||||
::EnableMenuItem(hMenu, SC_MOVE, MFS_DISABLED);
|
::EnableMenuItem(hMenu, SC_MOVE, MFS_DISABLED);
|
||||||
@ -378,6 +381,7 @@ void FluFrameless::_showSystemMenu(QPoint point) {
|
|||||||
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);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -402,15 +406,11 @@ bool FluFrameless::_hitMaximizeButton() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FluFrameless::_setMaximizePressed(bool val) {
|
void FluFrameless::_setMaximizePressed(bool val) {
|
||||||
if(_maximizeButton){
|
_maximizeButton->setProperty("down", val);
|
||||||
_maximizeButton->setProperty("down", val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FluFrameless::_setMaximizeHovered(bool val) {
|
void FluFrameless::_setMaximizeHovered(bool val) {
|
||||||
if(_maximizeButton){
|
_maximizeButton->setProperty("hover", val);
|
||||||
_maximizeButton->setProperty("hover", val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FluFrameless::_updateCursor(int edges) {
|
void FluFrameless::_updateCursor(int edges) {
|
||||||
|
@ -20,30 +20,6 @@ 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)
|
||||||
property alias view: table_view
|
property alias view: table_view
|
||||||
property var columnWidthProvider: function(column) {
|
|
||||||
var columnModel = control.columnSource[column]
|
|
||||||
var width = columnModel.width
|
|
||||||
if(width){
|
|
||||||
return width
|
|
||||||
}
|
|
||||||
var minimumWidth = columnModel.minimumWidth
|
|
||||||
if(minimumWidth){
|
|
||||||
return minimumWidth
|
|
||||||
}
|
|
||||||
return d.defaultItemWidth
|
|
||||||
}
|
|
||||||
property var rowHeightProvider: function(row) {
|
|
||||||
var rowModel = control.getRow(row)
|
|
||||||
var height = rowModel.height
|
|
||||||
if(height){
|
|
||||||
return height
|
|
||||||
}
|
|
||||||
var minimumHeight = rowModel._minimumHeight
|
|
||||||
if(minimumHeight){
|
|
||||||
return minimumHeight
|
|
||||||
}
|
|
||||||
return d.defaultItemHeight
|
|
||||||
}
|
|
||||||
id:control
|
id:control
|
||||||
color: {
|
color: {
|
||||||
if(Window.active){
|
if(Window.active){
|
||||||
@ -462,8 +438,30 @@ Rectangle {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
ScrollBar.horizontal:scroll_bar_h
|
ScrollBar.horizontal:scroll_bar_h
|
||||||
ScrollBar.vertical:scroll_bar_v
|
ScrollBar.vertical:scroll_bar_v
|
||||||
columnWidthProvider: control.columnWidthProvider
|
columnWidthProvider: function(column) {
|
||||||
rowHeightProvider: control.rowHeightProvider
|
var columnModel = control.columnSource[column]
|
||||||
|
var width = columnModel.width
|
||||||
|
if(width){
|
||||||
|
return width
|
||||||
|
}
|
||||||
|
var minimumWidth = columnModel.minimumWidth
|
||||||
|
if(minimumWidth){
|
||||||
|
return minimumWidth
|
||||||
|
}
|
||||||
|
return d.defaultItemWidth
|
||||||
|
}
|
||||||
|
rowHeightProvider: function(row) {
|
||||||
|
var rowModel = control.getRow(row)
|
||||||
|
var height = rowModel.height
|
||||||
|
if(height){
|
||||||
|
return height
|
||||||
|
}
|
||||||
|
var minimumHeight = rowModel._minimumHeight
|
||||||
|
if(minimumHeight){
|
||||||
|
return minimumHeight
|
||||||
|
}
|
||||||
|
return d.defaultItemHeight
|
||||||
|
}
|
||||||
model: table_sort_model
|
model: table_sort_model
|
||||||
clip: true
|
clip: true
|
||||||
onRowsChanged: {
|
onRowsChanged: {
|
||||||
@ -907,9 +905,7 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Repeater{
|
Repeater{
|
||||||
Component.onCompleted: {
|
model: control.columnSource
|
||||||
model = control.columnSource
|
|
||||||
}
|
|
||||||
delegate: FluLoader{
|
delegate: FluLoader{
|
||||||
id: item_layout_frozen
|
id: item_layout_frozen
|
||||||
readonly property int _index : model.index
|
readonly property int _index : model.index
|
||||||
|
@ -20,30 +20,6 @@ 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)
|
||||||
property alias view: table_view
|
property alias view: table_view
|
||||||
property var columnWidthProvider: function(column) {
|
|
||||||
var columnModel = control.columnSource[column]
|
|
||||||
var width = columnModel.width
|
|
||||||
if(width){
|
|
||||||
return width
|
|
||||||
}
|
|
||||||
var minimumWidth = columnModel.minimumWidth
|
|
||||||
if(minimumWidth){
|
|
||||||
return minimumWidth
|
|
||||||
}
|
|
||||||
return d.defaultItemWidth
|
|
||||||
}
|
|
||||||
property var rowHeightProvider: function(row) {
|
|
||||||
var rowModel = control.getRow(row)
|
|
||||||
var height = rowModel.height
|
|
||||||
if(height){
|
|
||||||
return height
|
|
||||||
}
|
|
||||||
var minimumHeight = rowModel._minimumHeight
|
|
||||||
if(minimumHeight){
|
|
||||||
return minimumHeight
|
|
||||||
}
|
|
||||||
return d.defaultItemHeight
|
|
||||||
}
|
|
||||||
id:control
|
id:control
|
||||||
color: {
|
color: {
|
||||||
if(Window.active){
|
if(Window.active){
|
||||||
@ -462,8 +438,30 @@ Rectangle {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
ScrollBar.horizontal:scroll_bar_h
|
ScrollBar.horizontal:scroll_bar_h
|
||||||
ScrollBar.vertical:scroll_bar_v
|
ScrollBar.vertical:scroll_bar_v
|
||||||
columnWidthProvider: control.columnWidthProvider
|
columnWidthProvider: function(column) {
|
||||||
rowHeightProvider: control.rowHeightProvider
|
var columnModel = control.columnSource[column]
|
||||||
|
var width = columnModel.width
|
||||||
|
if(width){
|
||||||
|
return width
|
||||||
|
}
|
||||||
|
var minimumWidth = columnModel.minimumWidth
|
||||||
|
if(minimumWidth){
|
||||||
|
return minimumWidth
|
||||||
|
}
|
||||||
|
return d.defaultItemWidth
|
||||||
|
}
|
||||||
|
rowHeightProvider: function(row) {
|
||||||
|
var rowModel = control.getRow(row)
|
||||||
|
var height = rowModel.height
|
||||||
|
if(height){
|
||||||
|
return height
|
||||||
|
}
|
||||||
|
var minimumHeight = rowModel._minimumHeight
|
||||||
|
if(minimumHeight){
|
||||||
|
return minimumHeight
|
||||||
|
}
|
||||||
|
return d.defaultItemHeight
|
||||||
|
}
|
||||||
model: table_sort_model
|
model: table_sort_model
|
||||||
clip: true
|
clip: true
|
||||||
onRowsChanged: {
|
onRowsChanged: {
|
||||||
@ -907,9 +905,7 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Repeater{
|
Repeater{
|
||||||
Component.onCompleted: {
|
model: control.columnSource
|
||||||
model = control.columnSource
|
|
||||||
}
|
|
||||||
delegate: FluLoader{
|
delegate: FluLoader{
|
||||||
id: item_layout_frozen
|
id: item_layout_frozen
|
||||||
readonly property int _index : model.index
|
readonly property int _index : model.index
|
||||||
|
Loading…
x
Reference in New Issue
Block a user