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