Compare commits
2 Commits
fde1b5ff3a
...
d397b88892
Author | SHA1 | Date |
---|---|---|
|
d397b88892 | |
|
ae2d517ad0 |
|
@ -407,7 +407,7 @@ FluContentPage{
|
||||||
text: "Download File"
|
text: "Download File"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
folder_dialog.showDialog(function(path){
|
folder_dialog.showDialog(function(path){
|
||||||
FluNetwork.get("http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4")
|
FluNetwork.get("http://vjs.zencdn.net/v/oceans.mp4")
|
||||||
.toDownload(path)
|
.toDownload(path)
|
||||||
.bind(root)
|
.bind(root)
|
||||||
.go(callable_download_file)
|
.go(callable_download_file)
|
||||||
|
@ -421,7 +421,7 @@ FluContentPage{
|
||||||
text: "Breakpoint Download File"
|
text: "Breakpoint Download File"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
folder_dialog.showDialog(function(path){
|
folder_dialog.showDialog(function(path){
|
||||||
FluNetwork.get("http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4")
|
FluNetwork.get("http://vjs.zencdn.net/v/oceans.mp4")
|
||||||
.toDownload(path,true)
|
.toDownload(path,true)
|
||||||
.bind(root)
|
.bind(root)
|
||||||
.go(callable_breakpoint_download_file)
|
.go(callable_breakpoint_download_file)
|
||||||
|
@ -521,7 +521,7 @@ FluContentPage{
|
||||||
property var onSelectListener
|
property var onSelectListener
|
||||||
id: folder_dialog
|
id: folder_dialog
|
||||||
folder: StandardPaths.standardLocations(StandardPaths.DownloadLocation)[0]
|
folder: StandardPaths.standardLocations(StandardPaths.DownloadLocation)[0]
|
||||||
currentFile: StandardPaths.standardLocations(StandardPaths.DownloadLocation)[0]+"/big_buck_bunny.mp4"
|
currentFile: StandardPaths.standardLocations(StandardPaths.DownloadLocation)[0]+"/oceans.mp4"
|
||||||
fileMode: FileDialog.SaveFile
|
fileMode: FileDialog.SaveFile
|
||||||
onAccepted: {
|
onAccepted: {
|
||||||
folder_dialog.onSelectListener(FluTools.toLocalPath(folder_dialog.currentFile))
|
folder_dialog.onSelectListener(FluTools.toLocalPath(folder_dialog.currentFile))
|
||||||
|
|
|
@ -408,7 +408,7 @@ FluContentPage{
|
||||||
text: "Download File"
|
text: "Download File"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
folder_dialog.showDialog(function(path){
|
folder_dialog.showDialog(function(path){
|
||||||
FluNetwork.get("http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4")
|
FluNetwork.get("http://vjs.zencdn.net/v/oceans.mp4")
|
||||||
.toDownload(path)
|
.toDownload(path)
|
||||||
.bind(root)
|
.bind(root)
|
||||||
.go(callable_download_file)
|
.go(callable_download_file)
|
||||||
|
@ -422,7 +422,7 @@ FluContentPage{
|
||||||
text: "Breakpoint Download File"
|
text: "Breakpoint Download File"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
folder_dialog.showDialog(function(path){
|
folder_dialog.showDialog(function(path){
|
||||||
FluNetwork.get("http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4")
|
FluNetwork.get("http://vjs.zencdn.net/v/oceans.mp4")
|
||||||
.toDownload(path,true)
|
.toDownload(path,true)
|
||||||
.bind(root)
|
.bind(root)
|
||||||
.go(callable_breakpoint_download_file)
|
.go(callable_breakpoint_download_file)
|
||||||
|
@ -522,7 +522,7 @@ FluContentPage{
|
||||||
property var onSelectListener
|
property var onSelectListener
|
||||||
id: folder_dialog
|
id: folder_dialog
|
||||||
folder: StandardPaths.standardLocations(StandardPaths.DownloadLocation)[0]
|
folder: StandardPaths.standardLocations(StandardPaths.DownloadLocation)[0]
|
||||||
currentFile: StandardPaths.standardLocations(StandardPaths.DownloadLocation)[0]+"/big_buck_bunny.mp4"
|
currentFile: StandardPaths.standardLocations(StandardPaths.DownloadLocation)[0]+"/oceans.mp4"
|
||||||
fileMode: FileDialog.SaveFile
|
fileMode: FileDialog.SaveFile
|
||||||
onAccepted: {
|
onAccepted: {
|
||||||
folder_dialog.onSelectListener(FluTools.toLocalPath(folder_dialog.currentFile))
|
folder_dialog.onSelectListener(FluTools.toLocalPath(folder_dialog.currentFile))
|
||||||
|
|
|
@ -16,15 +16,6 @@ static inline QByteArray qtNativeEventType()
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool isTaskbarAutoHide() {
|
|
||||||
APPBARDATA appBarData;
|
|
||||||
memset(&appBarData, 0, sizeof(appBarData));
|
|
||||||
appBarData.cbSize = sizeof(appBarData);
|
|
||||||
appBarData.hWnd = FindWindowW(L"Shell_TrayWnd", NULL);
|
|
||||||
LPARAM lParam = SHAppBarMessage(ABM_GETSTATE, &appBarData);
|
|
||||||
return lParam & ABS_AUTOHIDE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline QColor getAccentColor(){
|
static inline QColor getAccentColor(){
|
||||||
typedef HRESULT (WINAPI* DwmGetColorizationColorPtr)(DWORD* pcrColorization,BOOL* pfOpaqueBlend);
|
typedef HRESULT (WINAPI* DwmGetColorizationColorPtr)(DWORD* pcrColorization,BOOL* pfOpaqueBlend);
|
||||||
HMODULE module = LoadLibraryW(L"dwmapi.dll");
|
HMODULE module = LoadLibraryW(L"dwmapi.dll");
|
||||||
|
@ -126,9 +117,6 @@ bool FramelessEventFilter::nativeEventFilter(const QByteArray &eventType, void *
|
||||||
bool isMax = IsZoomed(hwnd);
|
bool isMax = IsZoomed(hwnd);
|
||||||
if(isMax){
|
if(isMax){
|
||||||
_helper->setOriginalPos(QPoint(originalLeft,originalTop));
|
_helper->setOriginalPos(QPoint(originalLeft,originalTop));
|
||||||
if(isTaskbarAutoHide()){
|
|
||||||
clientRect->bottom -= 1;
|
|
||||||
}
|
|
||||||
offsetTop = 0;
|
offsetTop = 0;
|
||||||
}else{
|
}else{
|
||||||
_helper->setOriginalPos({});
|
_helper->setOriginalPos({});
|
||||||
|
@ -148,7 +136,8 @@ bool FramelessEventFilter::nativeEventFilter(const QByteArray &eventType, void *
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
*result = HTCLIENT;
|
||||||
|
return true;
|
||||||
}else if(uMsg == WM_NCLBUTTONDBLCLK || uMsg == WM_NCLBUTTONDOWN){
|
}else if(uMsg == WM_NCLBUTTONDBLCLK || uMsg == WM_NCLBUTTONDOWN){
|
||||||
if(FluTools::getInstance()->isWindows11OrGreater() && _helper->hoverMaxBtn() && _helper->resizeable()){
|
if(FluTools::getInstance()->isWindows11OrGreater() && _helper->hoverMaxBtn() && _helper->resizeable()){
|
||||||
QMouseEvent event = QMouseEvent(QEvent::MouseButtonPress, QPoint(), QPoint(), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
|
QMouseEvent event = QMouseEvent(QEvent::MouseButtonPress, QPoint(), QPoint(), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
|
||||||
|
|
|
@ -162,7 +162,7 @@ QString NetworkParams::buildCacheKey(){
|
||||||
|
|
||||||
void NetworkParams::go(NetworkCallable* callable){
|
void NetworkParams::go(NetworkCallable* callable){
|
||||||
QJSValueList data;
|
QJSValueList data;
|
||||||
data<<qjsEngine(FluNetwork::getInstance())->newQObject(this);
|
data<<qjsEngine(callable)->newQObject(this);
|
||||||
FluNetwork::getInstance()->_interceptor.call(data);
|
FluNetwork::getInstance()->_interceptor.call(data);
|
||||||
if(_downloadParam){
|
if(_downloadParam){
|
||||||
FluNetwork::getInstance()->handleDownload(this,callable);
|
FluNetwork::getInstance()->handleDownload(this,callable);
|
||||||
|
@ -364,6 +364,18 @@ void FluNetwork::handleDownload(NetworkParams* params,NetworkCallable* c){
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
loop.exec();
|
loop.exec();
|
||||||
|
int httpStatus = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
|
||||||
|
if(httpStatus == 200){
|
||||||
|
if(!callable.isNull()){
|
||||||
|
callable->success(destPath);
|
||||||
|
}
|
||||||
|
printRequestEndLog(request,params,reply,destPath);
|
||||||
|
}else{
|
||||||
|
if(!callable.isNull()){
|
||||||
|
callable->error(httpStatus,reply->errorString(),destPath);
|
||||||
|
}
|
||||||
|
printRequestEndLog(request,params,reply,destPath);
|
||||||
|
}
|
||||||
if(conn_destoryed){
|
if(conn_destoryed){
|
||||||
disconnect(conn_destoryed);
|
disconnect(conn_destoryed);
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,7 @@ Button {
|
||||||
color: FluTheme.primaryColor
|
color: FluTheme.primaryColor
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
Behavior on height{
|
Behavior on height{
|
||||||
enabled: control.progress === 1
|
enabled: control.progress !== 0
|
||||||
SequentialAnimation {
|
SequentialAnimation {
|
||||||
PauseAnimation {
|
PauseAnimation {
|
||||||
duration: FluTheme.enableAnimation ? 167 : 0
|
duration: FluTheme.enableAnimation ? 167 : 0
|
||||||
|
|
|
@ -71,7 +71,7 @@ Button {
|
||||||
color: FluTheme.primaryColor
|
color: FluTheme.primaryColor
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
Behavior on height{
|
Behavior on height{
|
||||||
enabled: control.progress === 1
|
enabled: control.progress !== 0
|
||||||
SequentialAnimation {
|
SequentialAnimation {
|
||||||
PauseAnimation {
|
PauseAnimation {
|
||||||
duration: FluTheme.enableAnimation ? 167 : 0
|
duration: FluTheme.enableAnimation ? 167 : 0
|
||||||
|
|
Loading…
Reference in New Issue