Compare commits

..

No commits in common. "4f2fcd8865a1f38f2b57fe39d6901855b2535a0e" and "eb276e717968cb71f4c1144b90f4b44e620b3c9b" have entirely different histories.

3 changed files with 53 additions and 54 deletions

View File

@ -314,9 +314,6 @@ void FluFramelessHelper::componentComplete(){
_appBar.value<QObject*>()->setProperty("systemMoveEnable",false); _appBar.value<QObject*>()->setProperty("systemMoveEnable",false);
} }
window->setFlags((window->flags()) | Qt::CustomizeWindowHint | Qt::WindowMinimizeButtonHint | Qt::WindowCloseButtonHint); window->setFlags((window->flags()) | Qt::CustomizeWindowHint | Qt::WindowMinimizeButtonHint | Qt::WindowCloseButtonHint);
if(resizeable()){
window->setFlag(Qt::WindowMaximizeButtonHint);
}
_nativeEvent =new FramelessEventFilter(this); _nativeEvent =new FramelessEventFilter(this);
qApp->installNativeEventFilter(_nativeEvent); qApp->installNativeEventFilter(_nativeEvent);
HWND hwnd = reinterpret_cast<HWND>(window->winId()); HWND hwnd = reinterpret_cast<HWND>(window->winId());
@ -346,7 +343,9 @@ void FluFramelessHelper::componentComplete(){
#endif #endif
int w = _realWidth.read().toInt(); int w = _realWidth.read().toInt();
int h = _realHeight.read().toInt()+_appBarHeight.read().toInt(); int h = _realHeight.read().toInt()+_appBarHeight.read().toInt();
if(!resizeable()){ if(resizeable()){
window->setFlag(Qt::WindowMaximizeButtonHint);
}else{
window->setMaximumSize(QSize(w,h)); window->setMaximumSize(QSize(w,h));
window->setMinimumSize(QSize(w,h)); window->setMinimumSize(QSize(w,h));
} }

View File

@ -43,7 +43,7 @@ Window {
property bool useSystemAppBar property bool useSystemAppBar
property color resizeBorderColor: { property color resizeBorderColor: {
if(window.active){ if(window.active){
return FluTheme.dark ? "#333333" : "#6E6E6E" return _accentColor
} }
return FluTheme.dark ? "#3D3D3E" : "#A7A7A7" return FluTheme.dark ? "#3D3D3E" : "#A7A7A7"
} }
@ -61,6 +61,7 @@ Window {
signal firstVisible() signal firstVisible()
property point _offsetXY : Qt.point(0,0) property point _offsetXY : Qt.point(0,0)
property var _originalPos property var _originalPos
property color _accentColor : FluTheme.dark ? "#333333" : "#6E6E6E"
property int _realHeight property int _realHeight
property int _realWidth property int _realWidth
property int _appBarHeight: appBar.height property int _appBarHeight: appBar.height
@ -203,22 +204,18 @@ Window {
} }
} }
} }
Component{
id:com_border
Rectangle{
color:"transparent"
border.width: window.resizeBorderWidth
border.color: window.resizeBorderColor
}
}
FluLoader{ FluLoader{
id:loader_frameless_helper id:loader_frameless_helper
} }
Item{ Item{
id:layout_container id:layout_container
property bool isMaximum : window.visibility == Window.Maximized
anchors{ anchors{
fill:parent fill:parent
topMargin: _offsetXY.y topMargin: _offsetXY.y
bottomMargin: isMaximum ? 0 : _offsetXY.y
leftMargin: isMaximum ? 0 :_offsetXY.x
rightMargin: isMaximum ? 0 : _offsetXY.x
} }
onWidthChanged: { onWidthChanged: {
window.appBar.width = width window.appBar.width = width
@ -265,22 +262,27 @@ Window {
FluWindowLifecycle{ FluWindowLifecycle{
id:lifecycle id:lifecycle
} }
// FluLoader{ Rectangle{
// id:loader_border anchors.fill: parent
// anchors.fill: parent color:"transparent"
// sourceComponent: { border.width: window.resizeBorderWidth
// if(window.useSystemAppBar){ border.color: window.resizeBorderColor
// return undefined visible: {
// } if(window.useSystemAppBar || FluTools.isWindows10OrGreater()){
// if(FluTools.isWindows10OrGreater()){ return false
// return undefined }
// } if(FluTools.isMacos()){
// if(window.visibility == Window.Maximized || window.visibility == Window.FullScreen){ if(window.visibility == Window.FullScreen){
// return undefined return false
// } }
// return com_border }else{
// } if(window.visibility == Window.Maximized || window.visibility == Window.FullScreen){
// } return false
}
}
return true
}
}
} }
function destoryOnClose(){ function destoryOnClose(){
lifecycle.onDestoryOnClose() lifecycle.onDestoryOnClose()

View File

@ -42,7 +42,7 @@ Window {
property bool useSystemAppBar property bool useSystemAppBar
property color resizeBorderColor: { property color resizeBorderColor: {
if(window.active){ if(window.active){
return FluTheme.dark ? "#333333" : "#6E6E6E" return _accentColor
} }
return FluTheme.dark ? "#3D3D3E" : "#A7A7A7" return FluTheme.dark ? "#3D3D3E" : "#A7A7A7"
} }
@ -60,6 +60,7 @@ Window {
signal firstVisible() signal firstVisible()
property point _offsetXY : Qt.point(0,0) property point _offsetXY : Qt.point(0,0)
property var _originalPos property var _originalPos
property color _accentColor : FluTheme.dark ? "#333333" : "#6E6E6E"
property int _realHeight property int _realHeight
property int _realWidth property int _realWidth
property int _appBarHeight: appBar.height property int _appBarHeight: appBar.height
@ -202,14 +203,6 @@ Window {
} }
} }
} }
Component{
id:com_border
Rectangle{
color:"transparent"
border.width: window.resizeBorderWidth
border.color: window.resizeBorderColor
}
}
FluLoader{ FluLoader{
id:loader_frameless_helper id:loader_frameless_helper
} }
@ -264,22 +257,27 @@ Window {
FluWindowLifecycle{ FluWindowLifecycle{
id:lifecycle id:lifecycle
} }
// FluLoader{ Rectangle{
// id:loader_border anchors.fill: parent
// anchors.fill: parent color:"transparent"
// sourceComponent: { border.width: window.resizeBorderWidth
// if(window.useSystemAppBar){ border.color: window.resizeBorderColor
// return undefined visible: {
// } if(window.useSystemAppBar || FluTools.isWindows10OrGreater()){
// if(FluTools.isWindows10OrGreater()){ return false
// return undefined }
// } if(FluTools.isMacos()){
// if(window.visibility == Window.Maximized || window.visibility == Window.FullScreen){ if(window.visibility == Window.FullScreen){
// return undefined return false
// } }
// return com_border }else{
// } if(window.visibility == Window.Maximized || window.visibility == Window.FullScreen){
// } return false
}
}
return true
}
}
} }
function destoryOnClose(){ function destoryOnClose(){
lifecycle.onDestoryOnClose() lifecycle.onDestoryOnClose()