mirror of
https://github.com/Serial-Studio/Serial-Studio.git
synced 2025-01-15 05:22:53 +08:00
Fix widget external windows
This commit is contained in:
parent
c6050dd39e
commit
3b1069352f
@ -64,20 +64,49 @@ Item {
|
||||
id: externalWindow
|
||||
minimumWidth: 640
|
||||
minimumHeight: 480
|
||||
titlebarBorderEnabled: false
|
||||
title: externalLoader.widgetTitle
|
||||
titlebarText: Cpp_ThemeManager.text
|
||||
titlebarColor: Cpp_ThemeManager.widgetWindowBackground
|
||||
backgroundColor: Cpp_ThemeManager.widgetWindowBackground
|
||||
|
||||
WidgetLoader {
|
||||
id: externalLoader
|
||||
Rectangle {
|
||||
clip: true
|
||||
anchors.fill: parent
|
||||
isExternalWindow: true
|
||||
widgetIndex: root.widgetIndex
|
||||
widgetVisible: externalWindow.visible
|
||||
radius: externalWindow.radius
|
||||
anchors.margins: externalWindow.shadowMargin
|
||||
anchors.topMargin: externalWindow.titlebar.height
|
||||
color: Cpp_ThemeManager.widgetWindowBackground
|
||||
anchors.topMargin: externalWindow.titlebar.height + externalWindow.shadowMargin
|
||||
|
||||
Item {
|
||||
anchors.fill: parent
|
||||
|
||||
DragHandler {
|
||||
grabPermissions: TapHandler.CanTakeOverFromAnything
|
||||
onActiveChanged: {
|
||||
if (active)
|
||||
externalWindow.startSystemMove()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
height: externalWindow.radius
|
||||
color: Cpp_ThemeManager.widgetWindowBackground
|
||||
anchors {
|
||||
top: parent.top
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
}
|
||||
}
|
||||
|
||||
WidgetLoader {
|
||||
id: externalLoader
|
||||
anchors.fill: parent
|
||||
isExternalWindow: true
|
||||
widgetIndex: root.widgetIndex
|
||||
widgetVisible: externalWindow.visible
|
||||
anchors.margins: externalWindow.radius
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
hoverEnabled: true
|
||||
|
@ -90,7 +90,6 @@ Window {
|
||||
property alias closeEnabled: border.closeEnabled
|
||||
property alias minimizeEnabled: border.minimizeEnabled
|
||||
property alias maximizeEnabled: border.maximizeEnabled
|
||||
property alias titlebarBorderEnabled: border.titlebarBorderEnabled
|
||||
|
||||
//
|
||||
// Shadow implementation
|
||||
|
@ -42,12 +42,11 @@ Rectangle {
|
||||
// Window controls
|
||||
//
|
||||
property Window window
|
||||
property bool displayIcon: true
|
||||
property bool fullScreen: false
|
||||
property bool closeEnabled: true
|
||||
property bool minimizeEnabled: true
|
||||
property bool maximizeEnabled: true
|
||||
property bool displayIcon: true
|
||||
property bool titlebarBorderEnabled: true
|
||||
property color textColor: palette.text
|
||||
readonly property bool showMacControls: Cpp_IsMac
|
||||
|
||||
@ -95,21 +94,6 @@ Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Bottom titlebar border
|
||||
//
|
||||
Rectangle {
|
||||
height: 1
|
||||
visible: root.titlebarBorderEnabled
|
||||
color: Qt.darker(parent.color, 1.5)
|
||||
|
||||
anchors {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Window drag handler
|
||||
//
|
||||
|
@ -32,11 +32,32 @@ Rectangle {
|
||||
//
|
||||
// Background & border
|
||||
//
|
||||
border.width: 1
|
||||
border.color: Cpp_ThemeManager.toolbarGradient1
|
||||
gradient: Gradient {
|
||||
GradientStop { position: 0; color: Cpp_ThemeManager.toolbarGradient1 }
|
||||
GradientStop { position: 1; color: Cpp_ThemeManager.toolbarGradient2 }
|
||||
Rectangle {
|
||||
id: bg
|
||||
anchors.fill: parent
|
||||
|
||||
gradient: Gradient {
|
||||
GradientStop { position: 0; color: Cpp_ThemeManager.toolbarGradient1 }
|
||||
GradientStop { position: 1; color: Cpp_ThemeManager.toolbarGradient2 }
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
border.width: 1
|
||||
anchors.fill: parent
|
||||
color: "transparent"
|
||||
border.color: Qt.darker(Cpp_ThemeManager.toolbarGradient2, 1.5)
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
height: 1
|
||||
color: Qt.darker(Cpp_ThemeManager.toolbarGradient1, 1.5)
|
||||
|
||||
anchors {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -86,10 +86,23 @@ Control {
|
||||
}
|
||||
|
||||
//
|
||||
// Background gradient
|
||||
// Background gradient + border
|
||||
//
|
||||
Rectangle {
|
||||
id: bg
|
||||
anchors.fill: parent
|
||||
|
||||
gradient: Gradient {
|
||||
GradientStop { position: 0; color: Cpp_ThemeManager.toolbarGradient1 }
|
||||
GradientStop { position: 1; color: Cpp_ThemeManager.toolbarGradient2 }
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
border.width: 1
|
||||
anchors.fill: parent
|
||||
color: "transparent"
|
||||
border.color: Qt.darker(Cpp_ThemeManager.toolbarGradient2, 1.5)
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
height: 1
|
||||
@ -101,17 +114,6 @@ Control {
|
||||
bottom: parent.bottom
|
||||
}
|
||||
}
|
||||
|
||||
gradient: Gradient {
|
||||
GradientStop { position: 0; color: Cpp_ThemeManager.toolbarGradient1 }
|
||||
GradientStop { position: 1; color: Cpp_ThemeManager.toolbarGradient2 }
|
||||
}
|
||||
|
||||
anchors {
|
||||
fill: parent
|
||||
leftMargin: -border.width * 10
|
||||
rightMargin: -border.width * 10
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -51,10 +51,9 @@ FramelessWindow.CustomWindow {
|
||||
//
|
||||
// Titlebar options
|
||||
//
|
||||
displayIcon: false
|
||||
minimizeEnabled: false
|
||||
maximizeEnabled: false
|
||||
displayIcon: false
|
||||
titlebarBorderEnabled: false
|
||||
titlebarText: Cpp_ThemeManager.text
|
||||
titlebarColor: Cpp_ThemeManager.dialogBackground
|
||||
backgroundColor: Cpp_ThemeManager.dialogBackground
|
||||
|
@ -33,13 +33,12 @@ FramelessWindow.CustomWindow {
|
||||
//
|
||||
// Window options
|
||||
//
|
||||
title: qsTr("Acknowledgements")
|
||||
displayIcon: false
|
||||
width: minimumWidth
|
||||
height: minimumHeight
|
||||
minimizeEnabled: false
|
||||
maximizeEnabled: false
|
||||
displayIcon: false
|
||||
titlebarBorderEnabled: false
|
||||
title: qsTr("Acknowledgements")
|
||||
titlebarText: Cpp_ThemeManager.text
|
||||
x: (Screen.desktopAvailableWidth - width) / 2
|
||||
y: (Screen.desktopAvailableHeight - height) / 2
|
||||
|
@ -33,13 +33,12 @@ FramelessWindow.CustomWindow {
|
||||
//
|
||||
// Window options
|
||||
//
|
||||
title: qsTr("CSV Player")
|
||||
displayIcon: false
|
||||
width: minimumWidth
|
||||
height: minimumHeight
|
||||
minimizeEnabled: false
|
||||
maximizeEnabled: false
|
||||
displayIcon: false
|
||||
titlebarBorderEnabled: false
|
||||
title: qsTr("CSV Player")
|
||||
titlebarText: Cpp_ThemeManager.text
|
||||
x: (Screen.desktopAvailableWidth - width) / 2
|
||||
y: (Screen.desktopAvailableHeight - height) / 2
|
||||
|
@ -34,13 +34,12 @@ FramelessWindow.CustomWindow {
|
||||
//
|
||||
// Window options
|
||||
//
|
||||
displayIcon: false
|
||||
title: qsTr("Donate")
|
||||
width: minimumWidth
|
||||
height: minimumHeight
|
||||
minimizeEnabled: false
|
||||
maximizeEnabled: false
|
||||
displayIcon: false
|
||||
titlebarBorderEnabled: false
|
||||
titlebarText: Cpp_ThemeManager.text
|
||||
x: (Screen.desktopAvailableWidth - width) / 2
|
||||
y: (Screen.desktopAvailableHeight - height) / 2
|
||||
|
@ -40,7 +40,7 @@ FramelessWindow.CustomWindow {
|
||||
minimumWidth: 910
|
||||
minimumHeight: 720
|
||||
displayIcon: false
|
||||
borderColor: Cpp_ThemeManager.toolbarGradient1
|
||||
borderColor: Qt.darker(Cpp_ThemeManager.toolbarGradient2, 1.5)
|
||||
title: qsTr("JSON Editor - %1").arg(Cpp_JSON_Editor.jsonFileName)
|
||||
|
||||
//
|
||||
|
@ -37,7 +37,7 @@ import "../PlatformDependent" as PlatformDependent
|
||||
FramelessWindow.CustomWindow {
|
||||
id: root
|
||||
onClosed: Qt.quit()
|
||||
borderColor: Cpp_ThemeManager.toolbarGradient1
|
||||
borderColor: Qt.darker(Cpp_ThemeManager.toolbarGradient2, 1.5)
|
||||
|
||||
//
|
||||
// Global properties
|
||||
|
Loading…
x
Reference in New Issue
Block a user