Commit 19e2d752 authored by Leander Schulten's avatar Leander Schulten

UI: Add Support for dimmed or blurred backgrounds in user defined intensity....

UI: Add Support for dimmed or blurred backgrounds in user defined intensity. Add ModalPopupBackground and CenteredPopup and replace Popups through this components. Fix wrong colors in the LEDWindows, LoginView background, Popup content text and ModuleProgramView. Add UI for changing the background of a Popup. Close #66
parent 7115dfdc
Pipeline #194814 passed with stage
in 4 minutes and 46 seconds
......@@ -241,7 +241,8 @@ int main(int argc, char *argv[]) {
qmlRegisterType<CodeEditorHelper>("custom.licht",1,0,"CodeEditorHelper");
qmlRegisterType<ProgramBlockEditor>("custom.licht",1,0,"ProgramBlockEditor");
qmlRegisterType<GUI::AudioEventDataView>("custom.licht", 1, 0, "AudioEventDataView");
qmlRegisterType<SortedModelVectorView>("custom.licht",1,0,"SortedModelVectorView");
qmlRegisterType<SortedModelVectorView>("custom.licht", 1, 0, "SortedModelVectorView");
qmlRegisterType<Settings>("custom.licht", 1, 0, "PopupBackground");
qRegisterMetaType<DMXChannelFilter::Operation>("Operation");
qmlRegisterUncreatableType<UserManagment>("custom.licht",1,0,"Permission",QStringLiteral("Singletone in c++"));
qmlRegisterUncreatableMetaObject(Updater::staticMetaObject,"custom.licht",1,0,"UpdaterState",QStringLiteral("Enum in c++"));
......
......@@ -82,5 +82,7 @@
<file>qml/components/ColorSlider.qml</file>
<file>qml/AudioEventsView.qml</file>
<file>qml/ModifyThemePane.qml</file>
<file>qml/components/CenteredPopup.qml</file>
<file>qml/components/ModalPopupBackground.qml</file>
</qresource>
</RCC>
......@@ -4,6 +4,7 @@ import QtQuick.Layouts 1.12
import QtGraphicalEffects 1.0
import custom.licht 1.0
import "../HelpSystem"
import "../components"
ControlPanel{
......@@ -155,10 +156,7 @@ ControlPanel{
onClicked: selectProgramDialog.createProgramBlock()
}
Dialog{
modal: true
x: (parent.width - width) / 2
y: (parent.height - height) / 2
CenteredPopup{
id:selectProgramDialog
property int select: ControlView.Select.Program
width:300
......
......@@ -242,12 +242,9 @@ ModelView{
}
}
Popup{
modal: true
CenteredPopup{
id:dialog
width:300
x: (parent.width - width) / 2
y: (parent.height - height) / 2
contentItem: ColumnLayout{
spacing: 10
ComboBox{
......@@ -308,5 +305,5 @@ ModelView{
}
}
} // contentItem: ColumnLayout
} // Popup
} // CenteredPopup
}
......@@ -153,12 +153,9 @@ ModelView{
text: "Hold N and click to create a new TimePoint. You can select a TimePoint to change its values. A selected TimePoint can be deleted with d. You can drag a TimePoint. Hold x while scrolling to change the zooming."
}
Popup{
modal: true
CenteredPopup{
id: dialog
width: 300
x: (parent.width - width) / 2
y: (parent.height - height) / 2
contentItem: ColumnLayout{
spacing: 10
ComboBox{
......@@ -206,5 +203,5 @@ ModelView{
} // Button
} // RowLayout
} // contentItem: ColumnLayout
} // Popup
} // CenteredPopup
}
......@@ -170,12 +170,9 @@ ModelView{
}
Popup{
modal: true
CenteredPopup{
id: dialog
width: 300
x: (parent.width - width) / 2
y: (parent.height - height) / 2
contentItem: ColumnLayout{
spacing: 10
......@@ -242,6 +239,6 @@ ModelView{
}
}
} // contentItem: ColumnLayout
} // Popup
} // CenteredPopup
}
......@@ -51,7 +51,7 @@ Item{
clip:true
width: parent.width
Component.onCompleted: {
background.color = Qt.binding(function(){ return UserManagment.currentUser === modelData ? Qt.rgba(0,0,1,.7) : "transparent"; });
background.color = Qt.binding(function(){ return UserManagment.currentUser === modelData ? Qt.rgba(0,0,1,.7) : Material.background; });
}
Behavior on height {
NumberAnimation{
......@@ -171,12 +171,9 @@ Item{
easing.type: Easing.Linear
}
Popup{
modal: true
CenteredPopup{
id:dialog
width:300
x: (parent.width - width) / 2
y: (parent.height - height) / 2
property var user;
onVisibleChanged: {
if(visible)
......@@ -214,12 +211,9 @@ Item{
}
}
}
Popup{
modal: true
CenteredPopup{
id:addUserDialog
width:300
x: (parent.width - width) / 2
y: (parent.height - height) / 2
onVisibleChanged:{
if(visible){
username.text = "";;
......
......@@ -12,6 +12,7 @@ Popup {
y: 15
width: parent.width - 30
height: parent.height - 30
Overlay.modal: ModalPopupBackground{}
function show(newUser){
user = newUser;
visible = true;
......
This diff is collapsed.
......@@ -219,6 +219,7 @@ Item{
color: "lightgrey"
Layout.fillHeight: true
width: 1
visible: programEditor.showProperties
}
ColumnLayout{
Layout.fillHeight: true
......@@ -385,10 +386,7 @@ Item{
}
}
Popup{
x: (parent.width - width) / 2
y: (parent.height - height) / 2
//modality: Qt.WindowModal
CenteredPopup{
id:addEntry
//title: "Choose entry"
width:300
......@@ -527,9 +525,7 @@ Item{
width: 500
}
Popup{
x: (parent.width - width) / 2
y: (parent.height - height) / 2
CenteredPopup{
id: popup_addConnectionAsk
property string outputName
property string inputName
......
......@@ -598,6 +598,7 @@ Item{
id: informationDialog
modal: true
standardButtons: Dialog.Ok
Overlay.modal: ModalPopupBackground{}
width: 600
margins: 50
leftPadding: header.leftPadding
......@@ -618,6 +619,7 @@ Item{
font.bold: true
onContentWidthChanged: console.log("contentWidth", contentWidth)
id: dialogText
color: Material.foreground
}
}
}
......@@ -627,6 +629,7 @@ Item{
modal: true
closePolicy: Popup.CloseOnEscape
Overlay.modal: ModalPopupBackground{}
width: 300
margins: 50
padding: 10
......
......@@ -3,12 +3,11 @@ import QtQuick.Controls 2.5
import QtQuick.Layouts 1.12
import QtQuick.Controls.Material 2.3
Popup{
CenteredPopup{
property alias label: label
property alias text: label.text
property alias textFont: label.font
signal yesClicked();
modal: true
id: popup
ColumnLayout{
Label{
......@@ -40,9 +39,5 @@ Popup{
}
}
}
onAboutToShow: {
x = (parent.width - implicitWidth)/2;
y = (parent.height - implicitHeight)/2;
}
onOpened: {forceActiveFocus();deleteButton.focus = true}
}
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Window 2.12
Popup{
modal: true
Overlay.modal: ModalPopupBackground{}
// if we use center in, a developer dont has the ability to change the positon of the Popup
// anchors.centerIn: Overlay.overlay
parent: Overlay.overlay
x: (parent.width - width) / 2
y: (parent.height - height) / 2
}
import QtQuick 2.12
import QtGraphicalEffects 1.0
import QtQuick.Window 2.12
import custom.licht 1.0
Rectangle{
color: Qt.rgba(0,0,0,[.2, .506, .75][Settings.popupBackgroundEffectIntensity])
FastBlur {
source: Window.window ? Window.window.contentItem : null
radius: [16,32,64][Settings.popupBackgroundEffectIntensity]
anchors.fill: parent
visible: Settings.popupBackgroundEffect === PopupBackground.Blur
}
Behavior on opacity { NumberAnimation { duration: 150 } }
}
......@@ -65,6 +65,11 @@ ApplicationWindow {
}
ToolTip.text: getText(updater.state, updater.progress)
Rectangle{
anchors.fill: parent
color: Material.background
}
VerticalTabBar{
id: tabBar
......@@ -264,7 +269,11 @@ ApplicationWindow {
}
LedWindow{
color: window.Material.background
color: Material.background
Material.background: Settings.backgroundColor
Material.foreground: Settings.foregroundColor
Material.accent: Settings.accentColor
Material.theme: Settings.theme
id: ledWindow
property int insertAtIndex
function moveToWindow(index){
......@@ -294,10 +303,11 @@ ApplicationWindow {
modal: true
title: "Error"
standardButtons: Dialog.Ok
Overlay.modal: ModalPopupBackground{}
width: 600
y: 50
x: (root.width-width)/2;
contentItem: Text{
contentItem: Label{
text: ErrorNotifier.errorMessage
wrapMode: "WrapAtWordBoundaryOrAnywhere"
}
......
......@@ -191,6 +191,8 @@ public:
emit accentColorChanged();
emit accentMaterialChanged();
emit accentShadeChanged();
emit popupBackgroundEffectChanged();
emit popupBackgroundEffectIntensityChanged();
}
}
int getTheme() { return value(QStringLiteral("theme")).toInt(); }
......@@ -204,6 +206,14 @@ public:
ThemeColorProperty(QColor, const QColor &, accentColor, QColor(0xE9, 0x1E, 0x63), QColor(0xF4, 0x8F, 0xB1))
ThemeColorProperty(int, int, accentMaterial, 1, 1)
ThemeColorProperty(int, int, accentShade, -1, -1)
public:
enum PopupBackgroundEffect { Dim, Blur };
Q_ENUM(PopupBackgroundEffect)
enum PopupBackgroundEffectIntensity { Weak, Normal, Strong };
Q_ENUM(PopupBackgroundEffectIntensity)
ThemeColorProperty(PopupBackgroundEffect, PopupBackgroundEffect, popupBackgroundEffect, Dim, Blur)
ThemeColorProperty(PopupBackgroundEffectIntensity, PopupBackgroundEffectIntensity, popupBackgroundEffectIntensity, Normal, Normal)
signals:
void jsonSettingsFilePathChanged();
void driverFilePathChanged();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment