mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2024-10-30 15:57:37 +08:00
Compare commits
2 Commits
d222cb640c
...
da9f63eb24
Author | SHA1 | Date | |
---|---|---|---|
|
da9f63eb24 | ||
|
68015776ab |
@ -177,7 +177,6 @@
|
|||||||
<file>qml/window/SingleInstanceWindow.qml</file>
|
<file>qml/window/SingleInstanceWindow.qml</file>
|
||||||
<file>qml/window/SingleTaskWindow.qml</file>
|
<file>qml/window/SingleTaskWindow.qml</file>
|
||||||
<file>qml/window/StandardWindow.qml</file>
|
<file>qml/window/StandardWindow.qml</file>
|
||||||
<file>res/image/bg_scenic.png</file>
|
|
||||||
<file>res/image/image_1.jpg</file>
|
<file>res/image/image_1.jpg</file>
|
||||||
<file>qml/window/PageWindow.qml</file>
|
<file>qml/window/PageWindow.qml</file>
|
||||||
<file>qml/page/T_StaggeredLayout.qml</file>
|
<file>qml/page/T_StaggeredLayout.qml</file>
|
||||||
@ -209,5 +208,6 @@
|
|||||||
<file>qml/global/GlobalModel.qml</file>
|
<file>qml/global/GlobalModel.qml</file>
|
||||||
<file>qml/page/T_Sheet.qml</file>
|
<file>qml/page/T_Sheet.qml</file>
|
||||||
<file>qml/page/T_GroupBox.qml</file>
|
<file>qml/page/T_GroupBox.qml</file>
|
||||||
|
<file>res/image/bg_scenic.jpg</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
@ -53,7 +53,7 @@ FluScrollablePage{
|
|||||||
Image {
|
Image {
|
||||||
id:image
|
id:image
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
source: "qrc:/example/res/image/bg_scenic.png"
|
source: "qrc:/example/res/image/bg_scenic.jpg"
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
sourceSize: Qt.size(2*width,2*height)
|
sourceSize: Qt.size(2*width,2*height)
|
||||||
}
|
}
|
||||||
|
@ -344,7 +344,7 @@ FluWindow {
|
|||||||
id:callable
|
id:callable
|
||||||
property bool silent: true
|
property bool silent: true
|
||||||
onStart: {
|
onStart: {
|
||||||
console.debug("satrt check update...")
|
console.debug("start check update...")
|
||||||
}
|
}
|
||||||
onFinish: {
|
onFinish: {
|
||||||
console.debug("check update finish")
|
console.debug("check update finish")
|
||||||
|
@ -16,7 +16,7 @@ FluWindow {
|
|||||||
onInitArgument:
|
onInitArgument:
|
||||||
(arg)=>{
|
(arg)=>{
|
||||||
window.title = arg.title
|
window.title = arg.title
|
||||||
loader.setSource( arg.url,{animDisabled:true})
|
loader.setSource(arg.url,{animationEnabled:false})
|
||||||
}
|
}
|
||||||
FluLoader{
|
FluLoader{
|
||||||
id: loader
|
id: loader
|
||||||
|
BIN
example/res/image/bg_scenic.jpg
Normal file
BIN
example/res/image/bg_scenic.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 854 KiB |
Binary file not shown.
Before Width: | Height: | Size: 5.1 MiB |
@ -94,7 +94,7 @@ int main(int argc, char *argv[])
|
|||||||
engine.load(url);
|
engine.load(url);
|
||||||
const int exec = QGuiApplication::exec();
|
const int exec = QGuiApplication::exec();
|
||||||
if (exec == 931) {
|
if (exec == 931) {
|
||||||
QProcess::startDetached(qApp->applicationFilePath(), QStringList());
|
QProcess::startDetached(qApp->applicationFilePath(), qApp->arguments());
|
||||||
}
|
}
|
||||||
return exec;
|
return exec;
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,9 @@ FluFrameless::FluFrameless(QQuickItem *parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
FluFrameless::~FluFrameless(){
|
FluFrameless::~FluFrameless(){
|
||||||
|
}
|
||||||
|
|
||||||
|
void FluFrameless::onDestruction(){
|
||||||
qApp->removeNativeEventFilter(this);
|
qApp->removeNativeEventFilter(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,7 +145,6 @@ bool FluFrameless::nativeEventFilter(const QByteArray &eventType, void *message,
|
|||||||
}else{
|
}else{
|
||||||
offsetSize = 1;
|
offsetSize = 1;
|
||||||
}
|
}
|
||||||
_maximizeButton->setProperty("hover",false);
|
|
||||||
if(!isCompositionEnabled()){
|
if(!isCompositionEnabled()){
|
||||||
offsetSize = 0;
|
offsetSize = 0;
|
||||||
}
|
}
|
||||||
@ -152,6 +154,7 @@ bool FluFrameless::nativeEventFilter(const QByteArray &eventType, void *message,
|
|||||||
clientRect->left = originalLeft + offsetSize;
|
clientRect->left = originalLeft + offsetSize;
|
||||||
clientRect->right = originalRight - offsetSize;
|
clientRect->right = originalRight - offsetSize;
|
||||||
}
|
}
|
||||||
|
_setMaximizeHovered(false);
|
||||||
*result = WVR_REDRAW;
|
*result = WVR_REDRAW;
|
||||||
return true;
|
return true;
|
||||||
}else if(uMsg == WM_NCHITTEST){
|
}else if(uMsg == WM_NCHITTEST){
|
||||||
@ -159,10 +162,10 @@ bool FluFrameless::nativeEventFilter(const QByteArray &eventType, void *message,
|
|||||||
if (*result == HTNOWHERE) {
|
if (*result == HTNOWHERE) {
|
||||||
*result = HTZOOM;
|
*result = HTZOOM;
|
||||||
}
|
}
|
||||||
_setMaximizeHoverd(true);
|
_setMaximizeHovered(true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
_setMaximizeHoverd(false);
|
_setMaximizeHovered(false);
|
||||||
_setMaximizePressed(false);
|
_setMaximizePressed(false);
|
||||||
*result = 0;
|
*result = 0;
|
||||||
POINT nativeGlobalPos{GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)};
|
POINT nativeGlobalPos{GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)};
|
||||||
@ -341,7 +344,7 @@ void FluFrameless::_setMaximizePressed(bool val){
|
|||||||
_maximizeButton->setProperty("down",val);
|
_maximizeButton->setProperty("down",val);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FluFrameless::_setMaximizeHoverd(bool val){
|
void FluFrameless::_setMaximizeHovered(bool val){
|
||||||
_maximizeButton->setProperty("hover",val);
|
_maximizeButton->setProperty("hover",val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@ public:
|
|||||||
Q_INVOKABLE void showMinimized();
|
Q_INVOKABLE void showMinimized();
|
||||||
Q_INVOKABLE void showNormal();
|
Q_INVOKABLE void showNormal();
|
||||||
Q_INVOKABLE void setHitTestVisible(QQuickItem*);
|
Q_INVOKABLE void setHitTestVisible(QQuickItem*);
|
||||||
|
Q_INVOKABLE void onDestruction();
|
||||||
protected:
|
protected:
|
||||||
bool eventFilter(QObject *obj, QEvent *event) override;
|
bool eventFilter(QObject *obj, QEvent *event) override;
|
||||||
private:
|
private:
|
||||||
@ -48,7 +49,7 @@ private:
|
|||||||
bool _hitAppBar();
|
bool _hitAppBar();
|
||||||
bool _hitMaximizeButton();
|
bool _hitMaximizeButton();
|
||||||
void _setMaximizePressed(bool val);
|
void _setMaximizePressed(bool val);
|
||||||
void _setMaximizeHoverd(bool val);
|
void _setMaximizeHovered(bool val);
|
||||||
private:
|
private:
|
||||||
qint64 _current;
|
qint64 _current;
|
||||||
int _edges = 0;
|
int _edges = 0;
|
||||||
|
@ -76,7 +76,7 @@ QObject* FluTreeModel::getRow(int row){
|
|||||||
return _rows.at(row);
|
return _rows.at(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FluTreeModel::checkRow(int row,bool chekced){
|
void FluTreeModel::checkRow(int row,bool checked){
|
||||||
auto itemData = _rows.at(row);
|
auto itemData = _rows.at(row);
|
||||||
if(itemData->hasChildren()){
|
if(itemData->hasChildren()){
|
||||||
QList<FluNode*> stack = itemData->_children;
|
QList<FluNode*> stack = itemData->_children;
|
||||||
@ -85,7 +85,7 @@ void FluTreeModel::checkRow(int row,bool chekced){
|
|||||||
auto item = stack.at(stack.count()-1);
|
auto item = stack.at(stack.count()-1);
|
||||||
stack.pop_back();
|
stack.pop_back();
|
||||||
if(!item->hasChildren()){
|
if(!item->hasChildren()){
|
||||||
item->_checked = chekced;
|
item->_checked = checked;
|
||||||
}
|
}
|
||||||
QList<FluNode*> children = item->_children;
|
QList<FluNode*> children = item->_children;
|
||||||
if(!children.isEmpty()){
|
if(!children.isEmpty()){
|
||||||
@ -96,10 +96,10 @@ void FluTreeModel::checkRow(int row,bool chekced){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
if(itemData->_checked == chekced){
|
if(itemData->_checked == checked){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
itemData->_checked = chekced;
|
itemData->_checked = checked;
|
||||||
}
|
}
|
||||||
Q_EMIT layoutChanged(QList<QPersistentModelIndex>(),QAbstractItemModel::VerticalSortHint);
|
Q_EMIT layoutChanged(QList<QPersistentModelIndex>(),QAbstractItemModel::VerticalSortHint);
|
||||||
QList<FluNode*> data;
|
QList<FluNode*> data;
|
||||||
@ -201,7 +201,7 @@ void FluTreeModel::expand(int row){
|
|||||||
insertRows(row+1,insertData);
|
insertRows(row+1,insertData);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FluTreeModel::dragAnddrop(int dragIndex,int dropIndex,bool isDropTopArea){
|
void FluTreeModel::dragAndDrop(int dragIndex,int dropIndex,bool isDropTopArea){
|
||||||
if(dropIndex>_rows.count() || dropIndex<0){
|
if(dropIndex>_rows.count() || dropIndex<0){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -102,10 +102,10 @@ public:
|
|||||||
Q_INVOKABLE void setDataSource(QList<QMap<QString,QVariant>> data);
|
Q_INVOKABLE void setDataSource(QList<QMap<QString,QVariant>> data);
|
||||||
Q_INVOKABLE void collapse(int row);
|
Q_INVOKABLE void collapse(int row);
|
||||||
Q_INVOKABLE void expand(int row);
|
Q_INVOKABLE void expand(int row);
|
||||||
Q_INVOKABLE void dragAnddrop(int dragIndex,int dropIndex,bool isDropTopArea);
|
Q_INVOKABLE void dragAndDrop(int dragIndex,int dropIndex,bool isDropTopArea);
|
||||||
Q_INVOKABLE FluNode* getNode(int row);
|
Q_INVOKABLE FluNode* getNode(int row);
|
||||||
Q_INVOKABLE void refreshNode(int row);
|
Q_INVOKABLE void refreshNode(int row);
|
||||||
Q_INVOKABLE void checkRow(int row,bool chekced);
|
Q_INVOKABLE void checkRow(int row,bool checked);
|
||||||
Q_INVOKABLE bool hitHasChildrenExpanded(int row);
|
Q_INVOKABLE bool hitHasChildrenExpanded(int row);
|
||||||
Q_INVOKABLE void allExpand();
|
Q_INVOKABLE void allExpand();
|
||||||
Q_INVOKABLE void allCollapse();
|
Q_INVOKABLE void allCollapse();
|
||||||
|
@ -224,7 +224,7 @@ Item {
|
|||||||
onReleased: {
|
onReleased: {
|
||||||
loader_container.sourceComponent = undefined
|
loader_container.sourceComponent = undefined
|
||||||
if(d.dropIndex !== -1){
|
if(d.dropIndex !== -1){
|
||||||
tree_model.dragAnddrop(d.dragIndex,d.dropIndex,d.isDropTopArea)
|
tree_model.dragAndDrop(d.dragIndex,d.dropIndex,d.isDropTopArea)
|
||||||
}
|
}
|
||||||
d.dropIndex = -1
|
d.dropIndex = -1
|
||||||
d.dragIndex = -1
|
d.dragIndex = -1
|
||||||
|
@ -103,6 +103,9 @@ Window {
|
|||||||
frameless.setHitTestVisible(appBar.layoutMacosButtons)
|
frameless.setHitTestVisible(appBar.layoutMacosButtons)
|
||||||
frameless.setHitTestVisible(appBar.layoutStandardbuttons)
|
frameless.setHitTestVisible(appBar.layoutStandardbuttons)
|
||||||
}
|
}
|
||||||
|
Component.onDestruction: {
|
||||||
|
frameless.onDestruction()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Component{
|
Component{
|
||||||
id:com_background
|
id:com_background
|
||||||
|
@ -224,7 +224,7 @@ Item {
|
|||||||
onReleased: {
|
onReleased: {
|
||||||
loader_container.sourceComponent = undefined
|
loader_container.sourceComponent = undefined
|
||||||
if(d.dropIndex !== -1){
|
if(d.dropIndex !== -1){
|
||||||
tree_model.dragAnddrop(d.dragIndex,d.dropIndex,d.isDropTopArea)
|
tree_model.dragAndDrop(d.dragIndex,d.dropIndex,d.isDropTopArea)
|
||||||
}
|
}
|
||||||
d.dropIndex = -1
|
d.dropIndex = -1
|
||||||
d.dragIndex = -1
|
d.dragIndex = -1
|
||||||
|
@ -102,6 +102,9 @@ Window {
|
|||||||
frameless.setHitTestVisible(appBar.layoutMacosButtons)
|
frameless.setHitTestVisible(appBar.layoutMacosButtons)
|
||||||
frameless.setHitTestVisible(appBar.layoutStandardbuttons)
|
frameless.setHitTestVisible(appBar.layoutStandardbuttons)
|
||||||
}
|
}
|
||||||
|
Component.onDestruction: {
|
||||||
|
frameless.onDestruction()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Component{
|
Component{
|
||||||
id:com_background
|
id:com_background
|
||||||
|
Loading…
Reference in New Issue
Block a user