Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
Yuhang Zhao 2022-03-22 10:50:47 +08:00
parent a2622616a2
commit f30d7a0f57
8 changed files with 54 additions and 25 deletions

View File

@ -0,0 +1 @@
#include <framelessquickwindow.h>

View File

@ -22,24 +22,4 @@
* SOFTWARE. * SOFTWARE.
*/ */
import QtQuick 2.0 #pragma once
import QtQuick.Window 2.0
import org.wangwenx190.FramelessHelper 1.0
Window {
property alias windowTopBorder: windowTopBorder
id: window
Component.onCompleted: FramelessHelper.addWindow(window)
Rectangle {
id: windowTopBorder
anchors {
top: parent.top
left: parent.left
right: parent.right
}
height: ((window.visibility === Window.Windowed) && FramelessUtils.frameBorderVisible) ? 1 : 0
color: window.active ? FramelessUtils.frameBorderActiveColor : FramelessUtils.frameBorderInactiveColor
}
}

View File

@ -1,7 +1,5 @@
<RCC> <RCC>
<qresource prefix="/org.wangwenx190.FramelessHelper"> <qresource prefix="/org.wangwenx190.FramelessHelper">
<file>images/LICENSE</file>
<file>images/LICENSE-CODE</file>
<file>images/dark/chrome-close.svg</file> <file>images/dark/chrome-close.svg</file>
<file>images/dark/chrome-maximize.svg</file> <file>images/dark/chrome-maximize.svg</file>
<file>images/dark/chrome-minimize.svg</file> <file>images/dark/chrome-minimize.svg</file>

View File

@ -9,12 +9,14 @@ set(SOURCES
${INCLUDE_PREFIX}/framelesshelperimageprovider.h ${INCLUDE_PREFIX}/framelesshelperimageprovider.h
${INCLUDE_PREFIX}/framelessquickeventfilter.h ${INCLUDE_PREFIX}/framelessquickeventfilter.h
${INCLUDE_PREFIX}/framelesshelper_quick.h ${INCLUDE_PREFIX}/framelesshelper_quick.h
${INCLUDE_PREFIX}/framelessquickwindow.h
framelesshelperquick.qrc framelesshelperquick.qrc
framelesshelper_quick.cpp framelesshelper_quick.cpp
framelessquickhelper.cpp framelessquickhelper.cpp
framelessquickutils.cpp framelessquickutils.cpp
framelesshelperimageprovider.cpp framelesshelperimageprovider.cpp
framelessquickeventfilter.cpp framelessquickeventfilter.cpp
framelessquickwindow.cpp
) )
if(WIN32 AND NOT FRAMELESSHELPER_BUILD_STATIC) if(WIN32 AND NOT FRAMELESSHELPER_BUILD_STATIC)

View File

@ -69,7 +69,6 @@ void FramelessHelper::Quick::registerTypes(QQmlEngine *engine)
qmlRegisterType(getQmlFileUrl(QStringLiteral("MaximizeButton")), FRAMELESSHELPER_QUICK_URI, 1, 0, "MaximizeButton"); qmlRegisterType(getQmlFileUrl(QStringLiteral("MaximizeButton")), FRAMELESSHELPER_QUICK_URI, 1, 0, "MaximizeButton");
qmlRegisterType(getQmlFileUrl(QStringLiteral("CloseButton")), FRAMELESSHELPER_QUICK_URI, 1, 0, "CloseButton"); qmlRegisterType(getQmlFileUrl(QStringLiteral("CloseButton")), FRAMELESSHELPER_QUICK_URI, 1, 0, "CloseButton");
qmlRegisterType(getQmlFileUrl(QStringLiteral("StandardTitleBar")), FRAMELESSHELPER_QUICK_URI, 1, 0, "StandardTitleBar"); qmlRegisterType(getQmlFileUrl(QStringLiteral("StandardTitleBar")), FRAMELESSHELPER_QUICK_URI, 1, 0, "StandardTitleBar");
qmlRegisterType(getQmlFileUrl(QStringLiteral("FramelessWindow")), FRAMELESSHELPER_QUICK_URI, 1, 0, "FramelessWindow");
} }
FRAMELESSHELPER_END_NAMESPACE FRAMELESSHELPER_END_NAMESPACE

View File

@ -1,7 +1,6 @@
<RCC> <RCC>
<qresource prefix="/org.wangwenx190.FramelessHelper"> <qresource prefix="/org.wangwenx190.FramelessHelper">
<file>qml/CloseButton.qml</file> <file>qml/CloseButton.qml</file>
<file>qml/FramelessWindow.qml</file>
<file>qml/MaximizeButton.qml</file> <file>qml/MaximizeButton.qml</file>
<file>qml/MinimizeButton.qml</file> <file>qml/MinimizeButton.qml</file>
<file>qml/StandardTitleBar.qml</file> <file>qml/StandardTitleBar.qml</file>

View File

@ -0,0 +1,25 @@
/*
* MIT License
*
* Copyright (C) 2022 by wangwenx190 (Yuhang Zhao)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include "framelessquickwindow.h"

View File

@ -0,0 +1,25 @@
/*
* MIT License
*
* Copyright (C) 2022 by wangwenx190 (Yuhang Zhao)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include "../../include/FramelessHelper/Quick/framelessquickwindow.h"