Compare commits
2 Commits
eb276e7179
...
4f2fcd8865
Author | SHA1 | Date |
---|---|---|
|
4f2fcd8865 | |
|
e4413419b8 |
|
@ -314,6 +314,9 @@ 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());
|
||||
|
@ -343,9 +346,7 @@ void FluFramelessHelper::componentComplete(){
|
|||
#endif
|
||||
int w = _realWidth.read().toInt();
|
||||
int h = _realHeight.read().toInt()+_appBarHeight.read().toInt();
|
||||
if(resizeable()){
|
||||
window->setFlag(Qt::WindowMaximizeButtonHint);
|
||||
}else{
|
||||
if(!resizeable()){
|
||||
window->setMaximumSize(QSize(w,h));
|
||||
window->setMinimumSize(QSize(w,h));
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ Window {
|
|||
property bool useSystemAppBar
|
||||
property color resizeBorderColor: {
|
||||
if(window.active){
|
||||
return _accentColor
|
||||
return FluTheme.dark ? "#333333" : "#6E6E6E"
|
||||
}
|
||||
return FluTheme.dark ? "#3D3D3E" : "#A7A7A7"
|
||||
}
|
||||
|
@ -61,7 +61,6 @@ 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
|
||||
|
@ -204,18 +203,22 @@ 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
|
||||
|
@ -262,27 +265,22 @@ Window {
|
|||
FluWindowLifecycle{
|
||||
id:lifecycle
|
||||
}
|
||||
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
|
||||
}
|
||||
}
|
||||
// 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
|
||||
// }
|
||||
// }
|
||||
}
|
||||
function destoryOnClose(){
|
||||
lifecycle.onDestoryOnClose()
|
||||
|
|
|
@ -42,7 +42,7 @@ Window {
|
|||
property bool useSystemAppBar
|
||||
property color resizeBorderColor: {
|
||||
if(window.active){
|
||||
return _accentColor
|
||||
return FluTheme.dark ? "#333333" : "#6E6E6E"
|
||||
}
|
||||
return FluTheme.dark ? "#3D3D3E" : "#A7A7A7"
|
||||
}
|
||||
|
@ -60,7 +60,6 @@ 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,6 +202,14 @@ Window {
|
|||
}
|
||||
}
|
||||
}
|
||||
Component{
|
||||
id:com_border
|
||||
Rectangle{
|
||||
color:"transparent"
|
||||
border.width: window.resizeBorderWidth
|
||||
border.color: window.resizeBorderColor
|
||||
}
|
||||
}
|
||||
FluLoader{
|
||||
id:loader_frameless_helper
|
||||
}
|
||||
|
@ -257,27 +264,22 @@ Window {
|
|||
FluWindowLifecycle{
|
||||
id:lifecycle
|
||||
}
|
||||
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
|
||||
}
|
||||
}
|
||||
// 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
|
||||
// }
|
||||
// }
|
||||
}
|
||||
function destoryOnClose(){
|
||||
lifecycle.onDestoryOnClose()
|
||||
|
|
Loading…
Reference in New Issue