Compare commits
No commits in common. "3239e6f12cb116fc7d023e0cd596a7881b518769" and "0b7358af41e83cf2101ce993a1fc4ebbbaa61e2a" have entirely different histories.
3239e6f12c
...
0b7358af41
|
@ -179,18 +179,3 @@ qint64 FluTools::currentTimestamp(){
|
|||
QIcon FluTools::windowIcon(){
|
||||
return QGuiApplication::windowIcon();
|
||||
}
|
||||
|
||||
int FluTools::cursorScreenIndex(){
|
||||
int screenIndex = 0;
|
||||
int screenCount = qApp->screens().count();
|
||||
if (screenCount > 1) {
|
||||
QPoint pos = QCursor::pos();
|
||||
for (int i = 0; i < screenCount; ++i) {
|
||||
if (qApp->screens().at(i)->geometry().contains(pos)) {
|
||||
screenIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return screenIndex;
|
||||
}
|
||||
|
|
|
@ -50,7 +50,6 @@ public:
|
|||
Q_INVOKABLE qint64 currentTimestamp();
|
||||
Q_INVOKABLE QPoint cursorPos();
|
||||
Q_INVOKABLE QIcon windowIcon();
|
||||
Q_INVOKABLE int cursorScreenIndex();
|
||||
};
|
||||
|
||||
#endif // FLUTOOLS_H
|
||||
|
|
|
@ -53,15 +53,19 @@ Window {
|
|||
signal initArgument(var argument)
|
||||
signal firstVisible()
|
||||
id:window
|
||||
maximumWidth: fixSize ? width : 16777215
|
||||
maximumHeight: fixSize ? height : 16777215
|
||||
minimumWidth: fixSize ? width : 0
|
||||
minimumHeight: fixSize ? height : 0
|
||||
color:"transparent"
|
||||
Component.onCompleted: {
|
||||
moveWindowToDesktopCenter()
|
||||
useSystemAppBar = FluApp.useSystemAppBar
|
||||
if(!useSystemAppBar){
|
||||
loader_frameless.sourceComponent = com_frameless
|
||||
}
|
||||
lifecycle.onCompleted(window)
|
||||
initArgument(argument)
|
||||
moveWindowToDesktopCenter()
|
||||
if(window.autoMaximize){
|
||||
window.showMaximized()
|
||||
}else{
|
||||
|
@ -282,12 +286,7 @@ Window {
|
|||
return lifecycle.createRegister(window,path)
|
||||
}
|
||||
function moveWindowToDesktopCenter(){
|
||||
screen = Qt.application.screens[FluTools.cursorScreenIndex()]
|
||||
window.setGeometry((Screen.width-window.width)/2+Screen.virtualX,(Screen.height-window.height)/2+Screen.virtualY,window.width,window.height)
|
||||
maximumWidth = fixSize ? width : 16777215
|
||||
maximumHeight = fixSize ? height : 16777215
|
||||
minimumWidth = fixSize ? width : 0
|
||||
minimumHeight = fixSize ? height : 0
|
||||
}
|
||||
function onResult(data){
|
||||
if(_pageRegister){
|
||||
|
|
|
@ -52,15 +52,19 @@ Window {
|
|||
signal initArgument(var argument)
|
||||
signal firstVisible()
|
||||
id:window
|
||||
maximumWidth: fixSize ? width : 16777215
|
||||
maximumHeight: fixSize ? height : 16777215
|
||||
minimumWidth: fixSize ? width : 0
|
||||
minimumHeight: fixSize ? height : 0
|
||||
color:"transparent"
|
||||
Component.onCompleted: {
|
||||
moveWindowToDesktopCenter()
|
||||
useSystemAppBar = FluApp.useSystemAppBar
|
||||
if(!useSystemAppBar){
|
||||
loader_frameless.sourceComponent = com_frameless
|
||||
}
|
||||
lifecycle.onCompleted(window)
|
||||
initArgument(argument)
|
||||
moveWindowToDesktopCenter()
|
||||
if(window.autoMaximize){
|
||||
window.showMaximized()
|
||||
}else{
|
||||
|
@ -281,12 +285,7 @@ Window {
|
|||
return lifecycle.createRegister(window,path)
|
||||
}
|
||||
function moveWindowToDesktopCenter(){
|
||||
screen = Qt.application.screens[FluTools.cursorScreenIndex()]
|
||||
window.setGeometry((Screen.width-window.width)/2+Screen.virtualX,(Screen.height-window.height)/2+Screen.virtualY,window.width,window.height)
|
||||
maximumWidth = fixSize ? width : 16777215
|
||||
maximumHeight = fixSize ? height : 16777215
|
||||
minimumWidth = fixSize ? width : 0
|
||||
minimumHeight = fixSize ? height : 0
|
||||
}
|
||||
function onResult(data){
|
||||
if(_pageRegister){
|
||||
|
|
Loading…
Reference in New Issue