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);
}
window->setFlags((window->flags()) | Qt::CustomizeWindowHint | Qt::WindowMinimizeButtonHint | Qt::WindowCloseButtonHint);
if(resizeable()){
window->setFlag(Qt::WindowMaximizeButtonHint);
}
_nativeEvent =new FramelessEventFilter(this);
qApp->installNativeEventFilter(_nativeEvent);
HWND hwnd = reinterpret_cast<HWND>(window->winId());
@ -346,7 +343,9 @@ void FluFramelessHelper::componentComplete(){
#endif
int w = _realWidth.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->setMinimumSize(QSize(w,h));
}

View File

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

View File

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