From d957eba586689997d0ea6d87e7439b9371c53c1c Mon Sep 17 00:00:00 2001 From: Emeric Date: Mon, 22 Apr 2024 12:25:41 +0200 Subject: [PATCH] UI work --- qml/Application.qml | 22 +- .../controls/ProgressBarThemed.qml | 28 +- qml/ScreenSettings.qml | 21 +- qml/components/ComboBoxFolder.qml | 47 ++- qml/components/ItemMediaDirectory.qml | 20 +- qml/components_generic/ActionMenuItem.qml | 100 ------ .../ActionMenuSeparator.qml | 19 -- qml/components_generic/ActionMenu_bottom.qml | 98 ------ .../ActionMenu_floating.qml | 87 ----- qml/components_generic/AndroidButton.qml | 91 ------ qml/components_generic/AndroidButtonIcon.qml | 137 -------- qml/components_generic/AndroidTextField.qml | 94 ------ qml/components_generic/ButtonCompactable.qml | 200 ------------ qml/components_generic/ButtonImage.qml | 88 ----- qml/components_generic/ButtonText.qml | 64 ---- qml/components_generic/ButtonWireframe.qml | 125 ------- .../ButtonWireframeIcon.qml | 157 --------- .../ButtonWireframeIconCentered.qml | 153 --------- qml/components_generic/CsdLinux.qml | 105 ------ qml/components_generic/CsdMac.qml | 84 ----- qml/components_generic/CsdWindows.qml | 108 ------ qml/components_generic/DataBarCompact.qml | 240 -------------- qml/components_generic/DataBarSolid.qml | 308 ------------------ qml/components_generic/DatePicker5.qml | 249 -------------- qml/components_generic/DatePicker6.qml | 266 --------------- qml/components_generic/DesktopHeaderItem.qml | 107 ------ qml/components_generic/DesktopSidebarItem.qml | 146 --------- qml/components_generic/DrawerButton.qml | 125 ------- qml/components_generic/DrawerItem.qml | 87 ----- qml/components_generic/FpsMonitor.qml | 79 ----- qml/components_generic/FrameBox.qml | 36 -- qml/components_generic/IconSvg.qml | 36 -- qml/components_generic/ItemBadge.qml | 77 ----- qml/components_generic/ItemTag.qml | 34 -- qml/components_generic/ItemTagButton.qml | 74 ----- qml/components_generic/ListItem.qml | 78 ----- qml/components_generic/ListItemClickable.qml | 102 ------ qml/components_generic/ListSeparator.qml | 10 - .../ListSeparatorPadded.qml | 17 - qml/components_generic/ListTitle.qml | 66 ---- qml/components_generic/MiddleSliderArrow.qml | 91 ------ .../MiddleSliderValueSolid.qml | 92 ------ .../MobileMenuItem_horizontal.qml | 68 ---- .../MobileMenuItem_vertical.qml | 85 ----- qml/components_generic/ProgressArc.qml | 107 ------ qml/components_generic/ProgressCircle.qml | 145 --------- qml/components_generic/RangeSliderArrow.qml | 116 ------- qml/components_generic/RangeSliderValue.qml | 113 ------- .../RangeSliderValueSolid.qml | 129 -------- qml/components_generic/RoundButtonIcon.qml | 132 -------- qml/components_generic/RoundButtonText.qml | 103 ------ qml/components_generic/SectionTitle.qml | 62 ---- qml/components_generic/SelectorMenu.qml | 56 ---- qml/components_generic/SelectorMenuItem.qml | 78 ----- qml/components_generic/SimpleShadow5.qml | 33 -- qml/components_generic/SimpleShadow6.qml | 34 -- qml/components_generic/SliderArrow.qml | 91 ------ qml/components_generic/SliderValueSolid.qml | 91 ------ qml/components_generic/SwipeArea.qml | 55 ---- .../TextField_FileDialog6.qml | 139 -------- .../TextField_FolderDialog6.qml | 134 -------- qml/components_generic/ToolTipFlat.qml | 112 ------- qml/components_themed/ButtonIconThemed.qml | 82 ----- qml/components_themed/ButtonThemed.qml | 50 --- qml/components_themed/CheckBoxThemed.qml | 68 ---- qml/components_themed/ComboBoxThemed.qml | 124 ------- qml/components_themed/DialThemed.qml | 49 --- qml/components_themed/DrawerThemed.qml | 56 ---- qml/components_themed/FrameThemed.qml | 31 -- qml/components_themed/GroupBoxThemed.qml | 52 --- qml/components_themed/ItemDelegateThemed.qml | 80 ----- qml/components_themed/MiddleSliderThemed.qml | 76 ----- qml/components_themed/PageIndicatorThemed.qml | 50 --- qml/components_themed/PaneThemed.qml | 20 -- qml/components_themed/ProgressBarThemed.qml | 54 --- qml/components_themed/RadioButtonThemed.qml | 63 ---- qml/components_themed/RangeSliderThemed.qml | 111 ------- qml/components_themed/RippleThemed.qml | 3 - .../RoundButtonIconThemed.qml | 47 --- qml/components_themed/RoundButtonThemed.qml | 46 --- qml/components_themed/ScrollBarThemed.qml | 61 ---- qml/components_themed/SelectorMenuThemed.qml | 57 ---- .../SelectorMenuThemedItem.qml | 79 ----- qml/components_themed/SliderThemed.qml | 76 ----- .../SpinBoxThemed_desktop.qml | 225 ------------- .../SpinBoxThemed_mobile.qml | 190 ----------- .../SwitchThemed_desktop.qml | 77 ----- qml/components_themed/SwitchThemed_mobile.qml | 72 ---- qml/components_themed/TextAreaThemed.qml | 74 ----- qml/components_themed/TextEditThemed.qml | 18 - qml/components_themed/TextFieldThemed.qml | 74 ----- qml/components_themed/ToolTipThemed.qml | 57 ---- qml/components_themed/TumblerThemed.qml | 73 ----- qml/popups/PopupDate.qml | 9 +- qml/popups/PopupEncoding.qml | 75 ++++- qml/popups/PopupExit.qml | 110 ++++--- qml/popups/PopupMediaDirectory.qml | 128 +++++--- qml/popups/PopupMerge.qml | 8 +- qml/popups/PopupMove.qml | 42 ++- qml/popups/PopupOffload.qml | 3 +- qml/popups/PopupTelemetry.qml | 8 +- 101 files changed, 317 insertions(+), 8312 deletions(-) delete mode 100644 qml/components_generic/ActionMenuItem.qml delete mode 100644 qml/components_generic/ActionMenuSeparator.qml delete mode 100644 qml/components_generic/ActionMenu_bottom.qml delete mode 100644 qml/components_generic/ActionMenu_floating.qml delete mode 100644 qml/components_generic/AndroidButton.qml delete mode 100644 qml/components_generic/AndroidButtonIcon.qml delete mode 100644 qml/components_generic/AndroidTextField.qml delete mode 100644 qml/components_generic/ButtonCompactable.qml delete mode 100644 qml/components_generic/ButtonImage.qml delete mode 100644 qml/components_generic/ButtonText.qml delete mode 100644 qml/components_generic/ButtonWireframe.qml delete mode 100644 qml/components_generic/ButtonWireframeIcon.qml delete mode 100644 qml/components_generic/ButtonWireframeIconCentered.qml delete mode 100644 qml/components_generic/CsdLinux.qml delete mode 100644 qml/components_generic/CsdMac.qml delete mode 100644 qml/components_generic/CsdWindows.qml delete mode 100644 qml/components_generic/DataBarCompact.qml delete mode 100644 qml/components_generic/DataBarSolid.qml delete mode 100644 qml/components_generic/DatePicker5.qml delete mode 100644 qml/components_generic/DatePicker6.qml delete mode 100644 qml/components_generic/DesktopHeaderItem.qml delete mode 100644 qml/components_generic/DesktopSidebarItem.qml delete mode 100644 qml/components_generic/DrawerButton.qml delete mode 100644 qml/components_generic/DrawerItem.qml delete mode 100644 qml/components_generic/FpsMonitor.qml delete mode 100644 qml/components_generic/FrameBox.qml delete mode 100644 qml/components_generic/IconSvg.qml delete mode 100644 qml/components_generic/ItemBadge.qml delete mode 100644 qml/components_generic/ItemTag.qml delete mode 100644 qml/components_generic/ItemTagButton.qml delete mode 100644 qml/components_generic/ListItem.qml delete mode 100644 qml/components_generic/ListItemClickable.qml delete mode 100644 qml/components_generic/ListSeparator.qml delete mode 100644 qml/components_generic/ListSeparatorPadded.qml delete mode 100644 qml/components_generic/ListTitle.qml delete mode 100644 qml/components_generic/MiddleSliderArrow.qml delete mode 100644 qml/components_generic/MiddleSliderValueSolid.qml delete mode 100644 qml/components_generic/MobileMenuItem_horizontal.qml delete mode 100644 qml/components_generic/MobileMenuItem_vertical.qml delete mode 100644 qml/components_generic/ProgressArc.qml delete mode 100644 qml/components_generic/ProgressCircle.qml delete mode 100644 qml/components_generic/RangeSliderArrow.qml delete mode 100644 qml/components_generic/RangeSliderValue.qml delete mode 100644 qml/components_generic/RangeSliderValueSolid.qml delete mode 100644 qml/components_generic/RoundButtonIcon.qml delete mode 100644 qml/components_generic/RoundButtonText.qml delete mode 100644 qml/components_generic/SectionTitle.qml delete mode 100644 qml/components_generic/SelectorMenu.qml delete mode 100644 qml/components_generic/SelectorMenuItem.qml delete mode 100644 qml/components_generic/SimpleShadow5.qml delete mode 100644 qml/components_generic/SimpleShadow6.qml delete mode 100644 qml/components_generic/SliderArrow.qml delete mode 100644 qml/components_generic/SliderValueSolid.qml delete mode 100644 qml/components_generic/SwipeArea.qml delete mode 100644 qml/components_generic/TextField_FileDialog6.qml delete mode 100644 qml/components_generic/TextField_FolderDialog6.qml delete mode 100644 qml/components_generic/ToolTipFlat.qml delete mode 100644 qml/components_themed/ButtonIconThemed.qml delete mode 100644 qml/components_themed/ButtonThemed.qml delete mode 100644 qml/components_themed/CheckBoxThemed.qml delete mode 100644 qml/components_themed/ComboBoxThemed.qml delete mode 100644 qml/components_themed/DialThemed.qml delete mode 100644 qml/components_themed/DrawerThemed.qml delete mode 100644 qml/components_themed/FrameThemed.qml delete mode 100644 qml/components_themed/GroupBoxThemed.qml delete mode 100644 qml/components_themed/ItemDelegateThemed.qml delete mode 100644 qml/components_themed/MiddleSliderThemed.qml delete mode 100644 qml/components_themed/PageIndicatorThemed.qml delete mode 100644 qml/components_themed/PaneThemed.qml delete mode 100644 qml/components_themed/ProgressBarThemed.qml delete mode 100644 qml/components_themed/RadioButtonThemed.qml delete mode 100644 qml/components_themed/RangeSliderThemed.qml delete mode 100644 qml/components_themed/RippleThemed.qml delete mode 100644 qml/components_themed/RoundButtonIconThemed.qml delete mode 100644 qml/components_themed/RoundButtonThemed.qml delete mode 100644 qml/components_themed/ScrollBarThemed.qml delete mode 100644 qml/components_themed/SelectorMenuThemed.qml delete mode 100644 qml/components_themed/SelectorMenuThemedItem.qml delete mode 100644 qml/components_themed/SliderThemed.qml delete mode 100644 qml/components_themed/SpinBoxThemed_desktop.qml delete mode 100644 qml/components_themed/SpinBoxThemed_mobile.qml delete mode 100644 qml/components_themed/SwitchThemed_desktop.qml delete mode 100644 qml/components_themed/SwitchThemed_mobile.qml delete mode 100644 qml/components_themed/TextAreaThemed.qml delete mode 100644 qml/components_themed/TextEditThemed.qml delete mode 100644 qml/components_themed/TextFieldThemed.qml delete mode 100644 qml/components_themed/ToolTipThemed.qml delete mode 100644 qml/components_themed/TumblerThemed.qml diff --git a/qml/Application.qml b/qml/Application.qml index 43ca0dc8..21ec5b47 100644 --- a/qml/Application.qml +++ b/qml/Application.qml @@ -22,7 +22,6 @@ import QtQuick import QtQuick.Controls import QtQuick.Window -import Qt5Compat.GraphicalEffects import ThemeEngine @@ -104,7 +103,7 @@ ApplicationWindow { onActivated: backAction() } Shortcut { - sequence: StandardKey.Forward + sequences: [StandardKey.Forward] onActivated: forwardAction() }/* Shortcut { @@ -275,7 +274,7 @@ ApplicationWindow { } ] } - +/* layer.enabled: (settingsManager.appThemeCSD && Qt.platform.os !== "windows") layer.effect: OpacityMask { maskSource: Rectangle { @@ -313,6 +312,7 @@ ApplicationWindow { } } } +*/ } } @@ -363,14 +363,24 @@ ApplicationWindow { // Exit //////////////////////////////////////////////////////////////////// + Loader { + id: popupExit_loader + + active: false + asynchronous: false + sourceComponent: PopupExit { + id: popupExit + parent: appWindow.contentItem + } + } + onClosing: { // If a job is running, ask user to confirm exit if (jobManager.workingJobCount > 0) { close.accepted = false - var popupComponent = Qt.createComponent("qrc:/qml/popupExit.qml") - var popupExit = popupComponent.createObject(appWindow, { "parent": appWindow }) - popupExit.open() + popupExit_loader.active = true + popupExit_loader.item.open() } } } diff --git a/qml/ComponentLibrary/controls/ProgressBarThemed.qml b/qml/ComponentLibrary/controls/ProgressBarThemed.qml index 4215d017..b495d3b0 100644 --- a/qml/ComponentLibrary/controls/ProgressBarThemed.qml +++ b/qml/ComponentLibrary/controls/ProgressBarThemed.qml @@ -22,8 +22,6 @@ T.ProgressBar { implicitWidth: 200 implicitHeight: 12 y: (control.height - height) / 2 - - radius: (Theme.componentRadius / 2) color: control.colorBackground } @@ -35,20 +33,20 @@ T.ProgressBar { height: control.height color: control.colorForeground } + } - layer.enabled: true - layer.effect: MultiEffect { - maskEnabled: true - maskInverted: false - maskThresholdMin: 0.5 - maskSpreadAtMin: 1.0 - maskSpreadAtMax: 0.0 - maskSource: ShaderEffectSource { - sourceItem: Rectangle { - width: control.width - height: control.height - radius: Theme.componentRadius - } + layer.enabled: true + layer.effect: MultiEffect { + maskEnabled: true + maskInverted: false + maskThresholdMin: 0.5 + maskSpreadAtMin: 1.0 + maskSpreadAtMax: 0.0 + maskSource: ShaderEffectSource { + sourceItem: Rectangle { + width: control.width + height: control.height + radius: Theme.componentRadius } } } diff --git a/qml/ScreenSettings.qml b/qml/ScreenSettings.qml index 64cd8b37..fd2ef81d 100755 --- a/qml/ScreenSettings.qml +++ b/qml/ScreenSettings.qml @@ -140,7 +140,6 @@ Loader { ComboBoxThemed { id: comboBoxAppTheme width: 256 - height: 36 anchors.verticalCenter: parent.verticalCenter model: ListModel { @@ -373,8 +372,7 @@ Loader { height: 40 spacing: 32 - CheckBoxThemed { - id: checkIgnoreJunk + CheckBoxThemed { // checkIgnoreJunk width: 350 anchors.verticalCenter: parent.verticalCenter @@ -384,8 +382,7 @@ Loader { onClicked: settingsManager.ignoreJunk = checked } - CheckBoxThemed { - id: checkIgnoreAudio + CheckBoxThemed { // checkIgnoreAudio width: 350 anchors.verticalCenter: parent.verticalCenter @@ -400,8 +397,7 @@ Loader { height: 40 spacing: 32 - CheckBoxThemed { - id: checkAutoDelete + CheckBoxThemed { // checkAutoDelete width: 350 anchors.verticalCenter: parent.verticalCenter @@ -411,8 +407,7 @@ Loader { onClicked: settingsManager.autoDelete = checked } - CheckBoxThemed { - id: checkAutoMerge + CheckBoxThemed { // checkAutoMerge width: 350 anchors.verticalCenter: parent.verticalCenter @@ -422,8 +417,7 @@ Loader { onClicked: settingsManager.autoMerge = checked } - CheckBoxThemed { - id: checkAutoTelemetry + CheckBoxThemed { // checkAutoTelemetry width: 350 anchors.verticalCenter: parent.verticalCenter @@ -438,8 +432,7 @@ Loader { height: 40 spacing: 32 - CheckBoxThemed { - id: checkMoveToTrash + CheckBoxThemed { // checkMoveToTrash width: 450 anchors.verticalCenter: parent.verticalCenter @@ -553,7 +546,6 @@ Loader { ComboBoxThemed { id: comboBoxContentHierarchy width: 256 - height: 36 anchors.verticalCenter: parent.verticalCenter model: ListModel { @@ -610,7 +602,6 @@ Loader { } ButtonSolid { - height: 36 anchors.horizontalCenter: parent.horizontalCenter text: qsTr("Add a new one") diff --git a/qml/components/ComboBoxFolder.qml b/qml/components/ComboBoxFolder.qml index 085ebdf8..36f514e0 100644 --- a/qml/components/ComboBoxFolder.qml +++ b/qml/components/ComboBoxFolder.qml @@ -1,40 +1,54 @@ -import QtQuick 2.15 -import QtQuick.Controls 2.15 +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T -import ThemeEngine 1.0 +import ThemeEngine -ComboBox { +T.ComboBox { id: control - implicitWidth: 200 - implicitHeight: Theme.componentHeight - font.pixelSize: Theme.componentFontSize + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) + + leftPadding: 16 + rightPadding: 16 property string folders: "" //////// background: Rectangle { + implicitWidth: 200 + implicitHeight: Theme.componentHeight + radius: Theme.componentRadius + opacity: control.enabled ? 1 : 0.66 color: control.down ? Theme.colorComponentDown : Theme.colorComponent - border.width: Theme.componentBorderWidth + border.width: 2 border.color: Theme.colorComponentBorder } //////// contentItem: Text { - leftPadding: 12 - rightPadding: 8 - clip: true + //leftPadding: 12 + //rightPadding: 8 + //clip: true text: control.displayText textFormat: Text.PlainText + font: control.font - color: Theme.colorComponentContent elide: Text.ElideRight verticalAlignment: Text.AlignVCenter + opacity: control.enabled ? 1 : 0.66 + color: Theme.colorComponentContent + Text { x: parent.leftPadding + parent.contentWidth anchors.verticalCenter: parent.verticalCenter @@ -77,7 +91,7 @@ ComboBox { //////// - delegate: ItemDelegate { + delegate: T.ItemDelegate { width: control.width - 2 height: control.height highlighted: (control.highlightedIndex === index) @@ -92,7 +106,10 @@ ComboBox { } contentItem: Text { - text: modelData + leftPadding: control.leftPadding + text: control.textRole + ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) + : modelData color: highlighted ? "black" : Theme.colorSubText font.pixelSize: Theme.componentFontSize elide: Text.ElideRight @@ -105,7 +122,7 @@ ComboBox { popup: Popup { y: control.height - 1 width: control.width - implicitHeight: contentItem.implicitHeight + 2 + implicitHeight: (contentItem.implicitHeight) ? contentItem.implicitHeight + 2 : 0 padding: 1 contentItem: ListView { diff --git a/qml/components/ItemMediaDirectory.qml b/qml/components/ItemMediaDirectory.qml index 0f8ac186..d638bb5b 100644 --- a/qml/components/ItemMediaDirectory.qml +++ b/qml/components/ItemMediaDirectory.qml @@ -8,6 +8,7 @@ import "qrc:/js/UtilsPath.js" as UtilsPath Item { id: itemMediaDirectory + implicitWidth: 800 implicitHeight: 48 @@ -17,7 +18,7 @@ Item { FolderInputArea { id: textField_path - width: (itemMediaDirectory.width < 720) ? 640 : 720 + width: (itemMediaDirectory.width / 2) anchors.left: parent.left anchors.verticalCenter: parent.verticalCenter @@ -151,7 +152,6 @@ Item { ProgressBarThemed { id: progressBar width: parent.width - height: 8 value: directory.storageLevel } @@ -253,9 +253,19 @@ Item { sourceSize: 24 onClicked: { - var popupComponent = Qt.createComponent("qrc:/qml/PopupMediaDirectory.qml") - var popupMediaDirectory = popupComponent.createObject(appWindow, { "parent": appWindow }); - popupMediaDirectory.open() + popupMediaDirectory_loader.active = true + popupMediaDirectory_loader.item.open() + } + + Loader { + id: popupMediaDirectory_loader + + active: false + asynchronous: false + sourceComponent: PopupMediaDirectory { + id: popupMediaDirectory + parent: appWindow.contentItem + } } } diff --git a/qml/components_generic/ActionMenuItem.qml b/qml/components_generic/ActionMenuItem.qml deleted file mode 100644 index 9449c91b..00000000 --- a/qml/components_generic/ActionMenuItem.qml +++ /dev/null @@ -1,100 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Layouts 1.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -//import QtGraphicalEffects 1.15 // Qt5 -import Qt5Compat.GraphicalEffects // Qt6 - -import ThemeEngine 1.0 - -T.Button { - id: control - - anchors.left: parent.left - anchors.leftMargin: Theme.componentBorderWidth - anchors.right: parent.right - anchors.rightMargin: Theme.componentBorderWidth - - leftInset: Theme.componentMargin/2 - rightInset: Theme.componentMargin/2 - rightPadding: Theme.componentMargin - leftPadding: Theme.componentMargin - - height: 36 - - focusPolicy: Qt.NoFocus - - // settings - property int index - property url source - property int sourceSize: 20 - property int layoutDirection: Qt.RightToLeft - - //////////////// - - background: Item { - implicitHeight: 36 - - Rectangle { - anchors.fill: parent - radius: Theme.componentRadius - - color: Theme.colorComponent - //Behavior on color { ColorAnimation { duration: 133 } } - - opacity: control.hovered ? 1 : 0 - //Behavior on opacity { OpacityAnimator { duration: 233 } } - } - - RippleThemed { - anchors.fill: parent - clip: visible - pressed: control.down - active: enabled && control.down - color: Qt.rgba(Theme.colorForeground.r, Theme.colorForeground.g, Theme.colorForeground.b, 0.66) - } - - layer.enabled: true - layer.effect: OpacityMask { - maskSource: Rectangle { - x: background.x - y: background.y - width: background.width - height: background.height - radius: Theme.componentRadius - } - } - } - - //////////////// - - contentItem: RowLayout { - spacing: Theme.componentMargin/2 - layoutDirection: control.layoutDirection - - IconSvg { - Layout.preferredWidth: control.sourceSize - Layout.preferredHeight: control.sourceSize - - source: control.source - color: Theme.colorIcon - } - - Text { - Layout.fillWidth: true - Layout.preferredHeight: control.sourceSize - - text: control.text - textFormat: Text.PlainText - font.bold: false - font.pixelSize: Theme.componentFontSize - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - elide: Text.ElideRight - color: Theme.colorText - } - } - - //////////////// -} diff --git a/qml/components_generic/ActionMenuSeparator.qml b/qml/components_generic/ActionMenuSeparator.qml deleted file mode 100644 index 1aebd5db..00000000 --- a/qml/components_generic/ActionMenuSeparator.qml +++ /dev/null @@ -1,19 +0,0 @@ -import QtQuick 2.15 - -import ThemeEngine 1.0 - -Item { // action menu separator - anchors.left: parent.left - anchors.leftMargin: Theme.componentMargin - 4 - anchors.right: parent.right - anchors.rightMargin: Theme.componentMargin - 4 - height: Theme.componentMargin - 4 + 1 - - Rectangle { - anchors.left: parent.left - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - height: 1 - color: Theme.colorSeparator - } -} diff --git a/qml/components_generic/ActionMenu_bottom.qml b/qml/components_generic/ActionMenu_bottom.qml deleted file mode 100644 index 529a042f..00000000 --- a/qml/components_generic/ActionMenu_bottom.qml +++ /dev/null @@ -1,98 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T -import Qt.labs.qmlmodels 1.0 - -import ThemeEngine 1.0 - -T.Popup { - id: actionMenu - - width: parent.width - height: contentColumn.height - - padding: 0 - margins: 0 - - modal: true - dim: true - focus: isMobile - closePolicy: T.Popup.CloseOnEscape | T.Popup.CloseOnPressOutside - parent: Overlay.overlay - - property var model: null - - property int layoutDirection: Qt.LeftToRight - - signal menuSelected(var index) - - //////////////////////////////////////////////////////////////////////////// - - y: appWindow.height - - property int realHeight: 0 - Component.onCompleted: realHeight = actionMenu.height + screenPaddingNavbar + screenPaddingBottom - - enter: Transition { - NumberAnimation { duration: 233; property: "height"; from: 0; to: realHeight } - } - exit: Transition { - NumberAnimation { duration: 233; property: "height"; from: realHeight; to: 0 } - } - - //////////////////////////////////////////////////////////////////////////// - - background: Rectangle { - color: Theme.colorComponentBackground - Rectangle { - width: parent.width - height: Theme.componentBorderWidth - color: Theme.colorSeparator - } - } - - //////////////////////////////////////////////////////////////////////////// - - contentItem: Item { - Column { - id: contentColumn - width: parent.width - - topPadding: 12 - bottomPadding: 8 - spacing: 4 - - DelegateChooser { - id: chooser - role: "t" - DelegateChoice { - roleValue: "sep" - ActionMenuSeparator { - width: actionMenu.width - } - } - DelegateChoice { - roleValue: "itm" - ActionMenuItem { - width: actionMenu.width - index: idx - text: txt - source: src - layoutDirection: actionMenu.layoutDirection - onClicked: { - actionMenu.menuSelected(idx) - actionMenu.close() - } - } - } - } - - Repeater { - model: actionMenu.model - delegate: chooser - } - } - } - - //////////////////////////////////////////////////////////////////////////// -} diff --git a/qml/components_generic/ActionMenu_floating.qml b/qml/components_generic/ActionMenu_floating.qml deleted file mode 100644 index a05bc4f5..00000000 --- a/qml/components_generic/ActionMenu_floating.qml +++ /dev/null @@ -1,87 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T -import Qt.labs.qmlmodels 1.0 - -import ThemeEngine 1.0 - -T.Popup { - id: actionMenu - - width: 200 - height: contentColumn.height - - padding: 0 - margins: 0 - - modal: true - dim: false - focus: isMobile - closePolicy: T.Popup.CloseOnEscape | T.Popup.CloseOnPressOutside - //parent: Overlay.overlay - - property var model: null - - property int layoutDirection: Qt.LeftToRight - - signal menuSelected(var index) - - //////////////////////////////////////////////////////////////////////////// - - enter: Transition { NumberAnimation { property: "opacity"; from: 0.0; to: 1.0; duration: 133; } } - exit: Transition { NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; duration: 133; } } - - //////////////////////////////////////////////////////////////////////////// - - background: Rectangle { - color: Theme.colorComponentBackground - radius: Theme.componentRadius - border.color: Theme.colorSeparator - border.width: Theme.componentBorderWidth - } - - //////////////////////////////////////////////////////////////////////////// - - contentItem: Item { - Column { - id: contentColumn - width: parent.width - - topPadding: 10 - bottomPadding: 10 - spacing: 4 - - DelegateChooser { - id: chooser - role: "t" - DelegateChoice { - roleValue: "sep" - ActionMenuSeparator { - width: actionMenu.width - } - } - DelegateChoice { - roleValue: "itm" - ActionMenuItem { - width: actionMenu.width - index: idx - text: txt - source: src - layoutDirection: actionMenu.layoutDirection - onClicked: { - actionMenu.menuSelected(idx) - actionMenu.close() - } - } - } - } - - Repeater { - model: actionMenu.model - delegate: chooser - } - } - } - - //////////////////////////////////////////////////////////////////////////// -} diff --git a/qml/components_generic/AndroidButton.qml b/qml/components_generic/AndroidButton.qml deleted file mode 100644 index f0ee3a53..00000000 --- a/qml/components_generic/AndroidButton.qml +++ /dev/null @@ -1,91 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -//import QtGraphicalEffects 1.15 // Qt5 -import Qt5Compat.GraphicalEffects // Qt6 - -import ThemeEngine 1.0 -import "qrc:/js/UtilsNumber.js" as UtilsNumber - -T.Button { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - leftPadding: 12 - rightPadding: 12 - - focusPolicy: Qt.NoFocus - - // colors - property string primaryColor: Theme.colorPrimary - - //////////////// - - MouseArea { - id: mouseArea - anchors.fill: control - - hoverEnabled: false - propagateComposedEvents: false - - onClicked: control.clicked() - } - - //////////////// - - background: Item { - implicitWidth: 80 - implicitHeight: 48 - - Rectangle { // mouseBackground - width: mouseArea.pressed ? control.width*2 : 0 - height: width - radius: width - - x: mouseArea.mouseX + 4 - (width / 2) - y: mouseArea.mouseY + 4 - (width / 2) - - color: control.primaryColor - opacity: mouseArea.pressed ? 0.1 : 0 - Behavior on opacity { NumberAnimation { duration: 333 } } - Behavior on width { NumberAnimation { duration: 333 } } - } - - layer.enabled: true - layer.effect: OpacityMask { - maskSource: Rectangle { - x: background.x - y: background.y - width: background.width - height: background.height - radius: 8 - } - } - } - - //////////////// - - contentItem: Text { - text: control.text - textFormat: Text.PlainText - - font.bold: false - font.pixelSize: Theme.componentFontSize - font.capitalization: Font.AllUppercase - - elide: Text.ElideMiddle - //wrapMode: Text.WordWrap - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - - color: control.primaryColor - opacity: enabled ? 1.0 : 0.33 - } - - //////////////// -} diff --git a/qml/components_generic/AndroidButtonIcon.qml b/qml/components_generic/AndroidButtonIcon.qml deleted file mode 100644 index 9e693bfc..00000000 --- a/qml/components_generic/AndroidButtonIcon.qml +++ /dev/null @@ -1,137 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T -import QtQuick.Layouts 1.15 - -//import QtGraphicalEffects 1.15 // Qt5 -import Qt5Compat.GraphicalEffects // Qt6 - -import ThemeEngine 1.0 -import "qrc:/js/UtilsNumber.js" as UtilsNumber - -T.Button { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - leftPadding: 12 - rightPadding: 12 - spacing: 12 - - focusPolicy: Qt.NoFocus - - // settings - property url source - property int sourceSize: 26 - property int layoutDirection: Qt.LeftToRight - - // colors - property string primaryColor: Theme.colorPrimary - - //////////////// - - MouseArea { - id: mouseArea - anchors.fill: control - - hoverEnabled: false - propagateComposedEvents: false - - onClicked: control.clicked() - } - - //////////////// - - background: Item { - implicitWidth: 80 - implicitHeight: 48 - - //////// - - Rectangle { - id: shadowarea - anchors.fill: parent - border.color: "#eee" - radius: 8 - border.width: 1 - color: "white" - } - DropShadow { - anchors.fill: shadowarea - cached: true - horizontalOffset: 0 - verticalOffset: 0 - radius: 4.0 - //samples: 8 - color: "#20000000" - source: shadowarea - } - - //////// - - Rectangle { // mouseBackground - width: mouseArea.pressed ? control.width*2 : 0 - height: width - radius: width - - x: mouseArea.mouseX + 4 - (width / 2) - y: mouseArea.mouseY + 4 - (width / 2) - - color: "#222" - opacity: mouseArea.pressed ? 0.1 : 0 - Behavior on opacity { NumberAnimation { duration: 333 } } - Behavior on width { NumberAnimation { duration: 333 } } - } - - layer.enabled: true - layer.effect: OpacityMask { - maskSource: Rectangle { - x: background.x - y: background.y - width: background.width - height: background.height - radius: 8 - } - } - } - - //////////////// - - contentItem: RowLayout { - spacing: control.spacing - layoutDirection: control.layoutDirection - - IconSvg { // contentImage - Layout.preferredWidth: control.sourceSize - Layout.preferredHeight: control.sourceSize - - width: control.sourceSize - height: control.sourceSize - - source: control.source - color: control.primaryColor - opacity: enabled ? (control.down ? 0.8 : 1.0) : 0.33 - } - Text { // contentText - Layout.fillWidth: true - - text: control.text - textFormat: Text.PlainText - font.bold: true - font.pixelSize: Theme.componentFontSize - - elide: Text.ElideMiddle - //wrapMode: Text.WordWrap - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - - color: control.primaryColor - opacity: enabled ? (control.down ? 0.8 : 1.0) : 0.33 - } - } - - //////////////// -} diff --git a/qml/components_generic/AndroidTextField.qml b/qml/components_generic/AndroidTextField.qml deleted file mode 100644 index 0ae05d3a..00000000 --- a/qml/components_generic/AndroidTextField.qml +++ /dev/null @@ -1,94 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 - -T.TextField { - id: control - - implicitWidth: implicitBackgroundWidth + leftInset + rightInset - || Math.max(contentWidth, placeholder.implicitWidth) + leftPadding + rightPadding - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding, - placeholder.implicitHeight + topPadding + bottomPadding) - - padding: 12 - leftPadding: padding + 4 - - opacity: 1 - color: colorText - font.pixelSize: Theme.componentFontSize - verticalAlignment: Text.AlignVCenter - - placeholderText: "" - placeholderTextColor: colorPlaceholderText - - selectByMouse: false - selectedTextColor: colorSelectedText - selectionColor: colorSelection - - onEditingFinished: focus = false - Keys.onBackPressed: focus = false - - // settings - property string title: "" - - // colors - property string colorText: Theme.colorComponentContent - property string colorPlaceholderText: Theme.colorSubText - property string colorBorder: Theme.colorSubText - property string colorBackground: Theme.colorBackground - property string colorSelection: Theme.colorPrimary - property string colorSelectedText: "white" - - //////////////// - - PlaceholderText { - id: placeholder - x: control.leftPadding - y: control.topPadding - width: control.width - (control.leftPadding + control.rightPadding) - height: control.height - (control.topPadding + control.bottomPadding) - - text: control.placeholderText - font: control.font - color: control.placeholderTextColor - verticalAlignment: control.verticalAlignment - visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) - elide: Text.ElideRight - renderType: control.renderType - } - - //////////////// - - background: Rectangle { - implicitWidth: 256 - implicitHeight: 48 - - radius: 8 - color: control.colorBackground - border.width: 1 - border.color: control.activeFocus ? control.colorSelection : control.colorBorder - - Text { // textTitle - x: 16 - y: (-height / 2) - - text: control.title - textFormat: Text.PlainText - color: control.activeFocus ? control.colorSelection : control.colorBorder - font: control.font - - Rectangle { // textTitleBackground - anchors.fill: parent - anchors.margins: -6 - z: -1 - visible: control.title - color: control.colorBackground - } - } - } - - //////////////// -} diff --git a/qml/components_generic/ButtonCompactable.qml b/qml/components_generic/ButtonCompactable.qml deleted file mode 100644 index 07595965..00000000 --- a/qml/components_generic/ButtonCompactable.qml +++ /dev/null @@ -1,200 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Layouts 1.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -//import QtGraphicalEffects 1.15 // Qt5 -import Qt5Compat.GraphicalEffects // Qt6 - -import ThemeEngine 1.0 -import "qrc:/js/UtilsNumber.js" as UtilsNumber - -T.Button { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - leftPadding: compactInternal ? 0 : 12 - rightPadding: compactInternal ? 0 : 12 + (control.source.toString().length && control.text ? 2 : 0) - spacing: 6 - - width: compactInternal ? height : implicitWidth - height: compactInternal ? height : implicitHeight - Behavior on width { NumberAnimation { duration: 133 } } - - font.pixelSize: Theme.componentFontSize - font.bold: false - - focusPolicy: Qt.NoFocus - - // settings - property bool compact: false - property bool compactInternal: compact || !control.text - property url source - property int sourceSize: UtilsNumber.alignTo(height * 0.666, 2) - property int layoutDirection: Qt.LeftToRight - - // colors - property string textColor: Theme.colorText - property string iconColor: Theme.colorIcon - property string backgroundColor: Theme.colorComponent - - // animation - property string animation // available: rotate, fade, both - property bool animationRunning: false - property bool hoverAnimation: isDesktop - - // tooltip - property string tooltipText - property string tooltipPosition: "bottom" - - //////////////// - - MouseArea { - id: mouseArea - anchors.fill: parent - - enabled: control.hoverAnimation - hoverEnabled: control.hoverAnimation - - onClicked: control.clicked() - onPressAndHold: control.pressAndHold() - - onPressed: { - control.down = true - mouseBackground.width = (control.width * 2) - } - onReleased: { - control.down = false - //mouseBackground.width = 0 // disabled, we let the click expand the ripple - } - onEntered: { - mouseBackground.width = 72 - } - onExited: { - control.down = false - mouseBackground.width = 0 - } - onCanceled: { - control.down = false - mouseBackground.width = 0 - } - } - - //////////////// - - background: Rectangle { - implicitWidth: Theme.componentHeight - implicitHeight: Theme.componentHeight - - radius: control.compactInternal ? Theme.componentHeight : Theme.componentRadius - color: control.backgroundColor - - //opacity: ( mouseArea.containsMouse) ? 1 : 0 - Behavior on opacity { NumberAnimation { duration: 333 } } - - Rectangle { - id: mouseBackground - width: 0; height: width; radius: width; - x: mouseArea.mouseX - (width / 2) - y: mouseArea.mouseY - (width / 2) - - //visible: !control.compact - color: "white" - opacity: mouseArea.containsMouse ? 0.16 : 0 - Behavior on opacity { NumberAnimation { duration: 333 } } - Behavior on width { NumberAnimation { duration: 200 } } - } - - layer.enabled: true - layer.effect: OpacityMask { - maskSource: Rectangle { - x: background.x - y: background.y - width: background.width - height: background.height - radius: background.radius - } - } - } - - //////////////// - - contentItem: RowLayout { - spacing: control.spacing - layoutDirection: control.layoutDirection - - IconSvg { - width: control.sourceSize - height: control.sourceSize - - visible: control.source.toString().length - Layout.maximumWidth: control.sourceSize - Layout.maximumHeight: control.sourceSize - Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter - - source: control.source - color: control.iconColor - - opacity: enabled ? 1.0 : 0.4 - Behavior on opacity { NumberAnimation { duration: 333 } } - - SequentialAnimation on opacity { - running: (control.animationRunning && - (control.animation === "fade" || control.animation === "both")) - alwaysRunToEnd: true - loops: Animation.Infinite - - PropertyAnimation { to: 0.5; duration: 666; } - PropertyAnimation { to: 1; duration: 666; } - } - NumberAnimation on rotation { - running: (control.animationRunning && - (control.animation === "rotate" || control.animation === "both")) - alwaysRunToEnd: true - loops: Animation.Infinite - - duration: 1500 - from: 0 - to: 360 - easing.type: Easing.Linear - } - } - - Text { - text: control.text - textFormat: Text.PlainText - - visible: !control.compactInternal - Layout.fillWidth: true - Layout.alignment: Qt.AlignVCenter - - font: control.font - elide: Text.ElideRight - - color: control.iconColor - opacity: enabled ? 1.0 : 0.4 - Behavior on opacity { NumberAnimation { duration: 333 } } - } - } - - //////////////// - - Loader { - anchors.fill: control - active: control.tooltipText && control.compactInternal - - sourceComponent: ToolTipFlat { - visible: mouseArea.containsMouse - text: control.tooltipText - textColor: control.textColor - tooltipPosition: control.tooltipPosition - backgroundColor: control.backgroundColor - } - } - - //////////////// -} diff --git a/qml/components_generic/ButtonImage.qml b/qml/components_generic/ButtonImage.qml deleted file mode 100644 index c9e3b3ab..00000000 --- a/qml/components_generic/ButtonImage.qml +++ /dev/null @@ -1,88 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -//import QtGraphicalEffects 1.15 // Qt5 -import Qt5Compat.GraphicalEffects // Qt6 - -import ThemeEngine 1.0 - -T.Button { - id: control - - implicitWidth: Theme.componentHeight - implicitHeight: Theme.componentHeight - - focusPolicy: Qt.NoFocus - - // image - property url source - property int sourceSize: 32 - - // settings - property string hoverMode: "off" // available: off, circle, glow - property string highlightMode: "off" // available: off - - // colors - property string highlightColor: Theme.colorPrimary - - //////////////// - - background: Item { - implicitWidth: Theme.componentHeight - implicitHeight: Theme.componentHeight - - Glow { - anchors.centerIn: parent - width: Math.round(control.sourceSize * (control.pressed ? 0.9 : 1)) - height: Math.round(control.sourceSize * (control.pressed ? 0.9 : 1)) - - visible: (control.hoverMode === "glow") - - source: contentImage - color: control.highlightColor - radius: 12 - cached: true - //samples: 16 - transparentBorder: true - - opacity: control.hovered ? 1 : 0 - Behavior on opacity { OpacityAnimator { duration: 333 } } - } - - Rectangle { - anchors.centerIn: parent - width: Math.round(control.sourceSize * (control.pressed ? 0.9 : 1)) - height: Math.round(control.sourceSize * (control.pressed ? 0.9 : 1)) - - //visible: (control.hoverMode === "circle") - - radius: control.width - color: control.highlightColor - - opacity: control.hovered ? 0.33 : 0 - Behavior on opacity { OpacityAnimator { duration: 333 } } - } - } - - //////////////// - - contentItem: Item { - Image { - id: contentImage - anchors.centerIn: parent - - width: Math.round(control.sourceSize * (control.pressed ? 0.9 : 1)) - height: Math.round(control.sourceSize * (control.pressed ? 0.9 : 1)) - - source: control.source - sourceSize: Qt.size(control.sourceSize, control.sourceSize) - fillMode: Image.PreserveAspectFit - - opacity: enabled ? 1.0 : 0.4 - Behavior on opacity { OpacityAnimator { duration: 333 } } - } - } - - //////////////// -} diff --git a/qml/components_generic/ButtonText.qml b/qml/components_generic/ButtonText.qml deleted file mode 100644 index 9162762f..00000000 --- a/qml/components_generic/ButtonText.qml +++ /dev/null @@ -1,64 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 - -T.Button { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - leftPadding: 12 - rightPadding: 12 - - font.pixelSize: Theme.componentFontSize - font.bold: true - - flat: true - focusPolicy: Qt.NoFocus - - // colors - property string colorHighlighted: Theme.colorPrimary - property string colorHovered: Theme.colorHeader - - //////////////// - - background: Rectangle { - implicitWidth: 80 - implicitHeight: Theme.componentHeight - - radius: 2 - opacity: { - if (!control.enabled) return 0.4 - if (control.hovered && !control.highlighted) return 0.3 - return 1 - } - color: { - if (control.highlighted) return control.colorHighlighted - if (control.hovered) return control.colorHovered - return "transparent" - } - } - - //////////////// - - contentItem: Text { - text: control.text - textFormat: Text.PlainText - - font: control.font - elide: Text.ElideMiddle - //wrapMode: Text.WordWrap - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - - opacity: control.enabled ? 1 : 0.66 - color: control.highlighted ? "white" : Theme.colorText - } - - //////////////// -} diff --git a/qml/components_generic/ButtonWireframe.qml b/qml/components_generic/ButtonWireframe.qml deleted file mode 100644 index 6d69a37c..00000000 --- a/qml/components_generic/ButtonWireframe.qml +++ /dev/null @@ -1,125 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -//import QtGraphicalEffects 1.15 // Qt5 -import Qt5Compat.GraphicalEffects // Qt6 - -import ThemeEngine 1.0 - -T.Button { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - leftPadding: 12 - rightPadding: 12 - - font.pixelSize: Theme.componentFontSize - font.bold: false - - focusPolicy: Qt.NoFocus - - // colors - property bool fullColor: false - property string fulltextColor: "white" - property string primaryColor: Theme.colorPrimary - property string secondaryColor: Theme.colorComponentBackground - - // animation - property bool hoverAnimation: isDesktop - - //////////////// - - MouseArea { - id: mousearea - anchors.fill: control - - enabled: control.hoverAnimation - hoverEnabled: control.hoverAnimation - - onClicked: control.clicked() - onPressAndHold: control.pressAndHold() - - onPressed: { - control.down = true - mouseBackground.width = (control.width * 2) - } - onReleased: { - control.down = false - //mouseBackground.width = 0 // disabled, we let the click expand the ripple - } - onEntered: { - mouseBackground.width = 72 - } - onExited: { - control.down = false - mouseBackground.width = 0 - } - onCanceled: { - control.down = false - mouseBackground.width = 0 - } - } - - //////////////// - - background: Rectangle { - implicitWidth: 80 - implicitHeight: Theme.componentHeight - - radius: Theme.componentRadius - opacity: enabled ? (control.down && !control.hoverAnimation ? 0.8 : 1.0) : 0.4 - color: control.fullColor ? control.primaryColor : control.secondaryColor - border.width: Theme.componentBorderWidth - border.color: control.fullColor ? Qt.darker(color, 1.03) : Theme.colorComponentBorder - - Item { - anchors.fill: parent - - Rectangle { // mouseBackground - id: mouseBackground - width: 0; height: width; radius: width; - x: mousearea.mouseX - (width / 2) - y: mousearea.mouseY - (width / 2) - - visible: control.hoverAnimation - color: "white" - opacity: mousearea.containsMouse ? 0.16 : 0 - Behavior on opacity { NumberAnimation { duration: 333 } } - Behavior on width { NumberAnimation { duration: 200 } } - } - - layer.enabled: control.hoverAnimation - layer.effect: OpacityMask { - maskSource: Rectangle { - x: background.x - y: background.y - width: background.width - height: background.height - radius: background.radius - } - } - } - } - - //////////////// - - contentItem: Text { - text: control.text - textFormat: Text.PlainText - - font: control.font - elide: Text.ElideMiddle - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - - opacity: enabled ? (control.down && !control.hoverAnimation ? 0.8 : 1.0) : 0.66 - color: control.fullColor ? control.fulltextColor : control.primaryColor - } - - //////////////// -} diff --git a/qml/components_generic/ButtonWireframeIcon.qml b/qml/components_generic/ButtonWireframeIcon.qml deleted file mode 100644 index 52b24d9e..00000000 --- a/qml/components_generic/ButtonWireframeIcon.qml +++ /dev/null @@ -1,157 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T -import QtQuick.Layouts 1.15 - -//import QtGraphicalEffects 1.15 // Qt5 -import Qt5Compat.GraphicalEffects // Qt6 - -import ThemeEngine 1.0 -import "qrc:/js/UtilsNumber.js" as UtilsNumber - -T.Button { - id: control - - implicitWidth: implicitContentWidth + leftPadding + rightPadding - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - leftPadding: 12 - rightPadding: 12 + (control.source.toString().length && control.text ? 2 : 0) - spacing: 6 - - font.pixelSize: Theme.componentFontSize - font.bold: false - - focusPolicy: Qt.NoFocus - - // settings - property url source - property int sourceSize: UtilsNumber.alignTo(height * 0.666, 2) - property int layoutDirection: Qt.LeftToRight - - // colors - property bool fullColor: false - property string fulltextColor: "white" - property string primaryColor: Theme.colorPrimary - property string secondaryColor: Theme.colorComponentBackground - - // animation - property bool hoverAnimation: isDesktop - - //////////////// - - MouseArea { - id: mousearea - anchors.fill: parent - - enabled: control.hoverAnimation - hoverEnabled: control.hoverAnimation - - onClicked: control.clicked() - onPressAndHold: control.pressAndHold() - - onPressed: { - control.down = true - mouseBackground.width = (control.width * 2) - } - onReleased: { - control.down = false - //mouseBackground.width = 0 // disabled, we let the click expand the ripple - } - - onEntered: { - mouseBackground.width = 72 - } - onExited: { - control.down = false - mouseBackground.width = 0 - } - onCanceled: { - control.down = false - mouseBackground.width = 0 - } - } - - //////////////// - - background: Rectangle { - implicitWidth: 80 - implicitHeight: Theme.componentHeight - - radius: Theme.componentRadius - opacity: enabled ? (control.down && !control.hoverAnimation ? 0.8 : 1.0) : 0.4 - color: control.fullColor ? control.primaryColor : control.secondaryColor - - border.width: Theme.componentBorderWidth - border.color: control.fullColor ? Qt.darker(color, 1.03) : Theme.colorComponentBorder - - Item { - anchors.fill: parent - - Rectangle { // mouseBackground - id: mouseBackground - width: 0; height: width; radius: width; - x: mousearea.mouseX - (width / 2) - y: mousearea.mouseY - (width / 2) - - visible: control.hoverAnimation - color: "white" - opacity: mousearea.containsMouse ? 0.16 : 0 - Behavior on opacity { NumberAnimation { duration: 333 } } - Behavior on width { NumberAnimation { duration: 200 } } - } - - layer.enabled: control.hoverAnimation - layer.effect: OpacityMask { - maskSource: Rectangle { - x: background.x - y: background.y - width: background.width - height: background.height - radius: background.radius - } - } - } - } - - //////////////// - - contentItem: RowLayout { - spacing: control.spacing - layoutDirection: control.layoutDirection - - IconSvg { - width: control.sourceSize - height: control.sourceSize - - visible: control.source.toString().length - Layout.maximumWidth: control.sourceSize - Layout.maximumHeight: control.sourceSize - Layout.alignment: Qt.AlignVCenter - - source: control.source - color: control.fullColor ? control.fulltextColor : control.primaryColor - opacity: enabled ? (control.down && !control.hoverAnimation ? 0.8 : 1.0) : 0.66 - } - - Text { - text: control.text - textFormat: Text.PlainText - - visible: control.text - Layout.fillWidth: true - Layout.alignment: Qt.AlignVCenter - - font: control.font - elide: Text.ElideMiddle - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - - color: control.fullColor ? control.fulltextColor : control.primaryColor - opacity: enabled ? (control.down && !control.hoverAnimation ? 0.8 : 1.0) : 0.66 - } - } - - //////////////// -} diff --git a/qml/components_generic/ButtonWireframeIconCentered.qml b/qml/components_generic/ButtonWireframeIconCentered.qml deleted file mode 100644 index f4fa8562..00000000 --- a/qml/components_generic/ButtonWireframeIconCentered.qml +++ /dev/null @@ -1,153 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T -import QtQuick.Layouts 1.15 - -//import QtGraphicalEffects 1.15 // Qt5 -import Qt5Compat.GraphicalEffects // Qt6 - -import ThemeEngine 1.0 -import "qrc:/js/UtilsNumber.js" as UtilsNumber - -T.Button { - id: control - - implicitWidth: implicitContentWidth + leftPadding + rightPadding - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - leftPadding: 12 - rightPadding: 12 + (control.source.toString().length && control.text ? 2 : 0) - spacing: 6 - - font.pixelSize: Theme.componentFontSize - font.bold: false - - focusPolicy: Qt.NoFocus - - // settings - property url source - property int sourceSize: UtilsNumber.alignTo(height * 0.666, 2) - property int layoutDirection: Qt.LeftToRight - - // colors - property bool fullColor: false - property string fulltextColor: "white" - property string primaryColor: Theme.colorPrimary - property string secondaryColor: Theme.colorComponentBackground - - // animation - property bool hoverAnimation: isDesktop - - //////////////// - - MouseArea { - id: mousearea - anchors.fill: parent - enabled: control.hoverAnimation - - hoverEnabled: control.hoverAnimation - - onClicked: control.clicked() - onPressAndHold: control.pressAndHold() - - onPressed: { - control.down = true - mouseBackground.width = (control.width * 2) - } - onReleased: { - control.down = false - //mouseBackground.width = 0 // disabled, we let the click expand the ripple - } - - onEntered: { - mouseBackground.width = 72 - } - onExited: { - control.down = false - mouseBackground.width = 0 - } - onCanceled: { - control.down = false - mouseBackground.width = 0 - } - } - - //////////////// - - background: Rectangle { - implicitWidth: 80 - implicitHeight: Theme.componentHeight - - radius: Theme.componentRadius - opacity: enabled ? (control.down && !control.hoverAnimation ? 0.8 : 1.0) : 0.4 - color: control.fullColor ? control.primaryColor : control.secondaryColor - - border.width: Theme.componentBorderWidth - border.color: control.fullColor ? Qt.darker(color, 1.03) : Theme.colorComponentBorder - - Item { - anchors.fill: parent - - Rectangle { // mouseBackground - id: mouseBackground - width: 0; height: width; radius: width; - x: mousearea.mouseX - (width / 2) - y: mousearea.mouseY - (width / 2) - - visible: control.hoverAnimation - color: "white" - opacity: mousearea.containsMouse ? 0.16 : 0 - Behavior on opacity { NumberAnimation { duration: 333 } } - Behavior on width { NumberAnimation { duration: 200 } } - } - - layer.enabled: control.hoverAnimation - layer.effect: OpacityMask { - maskSource: Rectangle { - x: background.x - y: background.y - width: background.width - height: background.height - radius: background.radius - } - } - } - } - - //////////////// - - contentItem: Item { - Row { - anchors.centerIn: parent - spacing: control.spacing - layoutDirection: control.layoutDirection - - IconSvg { - anchors.verticalCenter: parent.verticalCenter - visible: control.source.toString().length - - source: control.source - width: control.sourceSize - height: control.sourceSize - - opacity: enabled ? (control.down && !control.hoverAnimation ? 0.8 : 1.0) : 0.66 - color: control.fullColor ? control.fulltextColor : control.primaryColor - } - - Text { - anchors.verticalCenter: parent.verticalCenter - visible: control.text - - text: control.text - textFormat: Text.PlainText - font: control.font - - opacity: enabled ? (control.down && !control.hoverAnimation ? 0.8 : 1.0) : 0.66 - color: control.fullColor ? control.fulltextColor : control.primaryColor - } - } - } - - //////////////// -} diff --git a/qml/components_generic/CsdLinux.qml b/qml/components_generic/CsdLinux.qml deleted file mode 100644 index ada67747..00000000 --- a/qml/components_generic/CsdLinux.qml +++ /dev/null @@ -1,105 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Window 2.15 - -import ThemeEngine 1.0 - -Loader { - anchors.top: parent.top - anchors.topMargin: 6 - anchors.right: parent.right - anchors.rightMargin: 6 - - width: active ? 94 : 0 - height: active ? 26 : 0 - - active: (settingsManager.appThemeCSD && Qt.platform.os !== "windows" && Qt.platform.os !== "osx") - asynchronous: true - - sourceComponent: Row { - id: csdLinux - spacing: 8 - - //////// - - Rectangle { // button minimize - width: 26; height: 26; radius: 26; - color: mouseAreaMin.containsMouse ? "#66aaaaaa" : "#33aaaaaa" - Behavior on color { ColorAnimation { duration: 233; easing.type: Easing.InOutCirc; } } - - Rectangle { - width: 10; height: 2; - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - anchors.verticalCenterOffset: 4 - color: mouseAreaMin.containsMouse ? Theme.colorHighContrast : Theme.colorIcon - } - - MouseArea { - id: mouseAreaMin - anchors.fill: parent - - hoverEnabled: true - onClicked: appWindow.showMinimized() - } - } - - //////// - - Rectangle { // button maximize - width: 26; height: 26; radius: 26; - color: mouseAreaMax.containsMouse ? "#66aaaaaa" : "#33aaaaaa" - Behavior on color { ColorAnimation { duration: 233; easing.type: Easing.InOutCirc; } } - - Rectangle { - width: 10; height: 10; - anchors.centerIn: parent - color: "transparent" - border.width: 2 - border.color: mouseAreaMax.containsMouse ? Theme.colorHighContrast : Theme.colorIcon - } - - MouseArea { - id: mouseAreaMax - anchors.fill: parent - - hoverEnabled: true - onClicked: { - if (appWindow.visibility === ApplicationWindow.Maximized) - appWindow.showNormal() - else - appWindow.showMaximized() - } - } - } - - //////// - - Rectangle { // button close - width: 26; height: 26; radius: 26; - color: mouseAreaClose.containsMouse ? "red" : "#33aaaaaa" - Behavior on color { ColorAnimation { duration: 233; easing.type: Easing.InOutCirc; } } - - Rectangle { - width: 13; height: 2; radius: 2; - anchors.centerIn: parent - rotation: 45 - color: mouseAreaClose.containsMouse ? "white" : Theme.colorIcon - } - Rectangle { - width: 13; height: 2; radius: 2; - anchors.centerIn: parent - rotation: -45 - color: mouseAreaClose.containsMouse ? "white" : Theme.colorIcon - } - - MouseArea { - id: mouseAreaClose - anchors.fill: parent - - hoverEnabled: true - onClicked: appWindow.close() - } - } - } -} diff --git a/qml/components_generic/CsdMac.qml b/qml/components_generic/CsdMac.qml deleted file mode 100644 index ce3a1967..00000000 --- a/qml/components_generic/CsdMac.qml +++ /dev/null @@ -1,84 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Window 2.15 - -import ThemeEngine 1.0 - -Loader { - width: active ? 48 : 0 - height: active ? 24 : 0 - - active: (settingsManager.appThemeCSD && Qt.platform.os === "osx") - asynchronous: true - - sourceComponent: Item { - id: csdMac - implicitWidth: 48 - implicitHeight: 24 - - //////// - - MouseArea { - id: mouseArea - anchors.fill: buttonsRow - - hoverEnabled: visible - } - - //////// - - Row { - id: buttonsRow - anchors.centerIn: parent - spacing: 8 - - Rectangle { - width: 12; height: 12; radius: 12; - color: "#FE5F57" - border.color: "#E24037" - - IconSvg { - width: 10; height: 10; - anchors.centerIn: parent - source: "qrc:/assets/icons_material/baseline-close-24px.svg" - opacity: mouseArea.containsMouse ? 0.6 : 0 - //Behavior on opacity { OpacityAnimator { duration: 133 } } - } - MouseArea { - anchors.fill: parent - onClicked: appWindow.close() - } - } - Rectangle { - width: 12; height: 12; radius: 12; - color: "#FEBC2F" - border.color: "#E19D17" - Rectangle { - width: 8; height: 1; - anchors.centerIn: parent - color: "grey" - opacity: mouseArea.containsMouse ? 0.8 : 0 - //Behavior on opacity { OpacityAnimator { duration: 133 } } - } - MouseArea { - anchors.fill: parent - onClicked: appWindow.showMinimized() - } - } - Rectangle { - width: 12; height: 12; radius: 12; - color: "#28C940" - border.color: "#10A923" - MouseArea { - anchors.fill: parent - onClicked: { - if (appWindow.visibility === ApplicationWindow.Maximized) - appWindow.showNormal() - else - appWindow.showMaximized() - } - } - } - } - } -} diff --git a/qml/components_generic/CsdWindows.qml b/qml/components_generic/CsdWindows.qml deleted file mode 100644 index dc32fd3c..00000000 --- a/qml/components_generic/CsdWindows.qml +++ /dev/null @@ -1,108 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Window 2.15 - -import ThemeEngine 1.0 - -Loader { - anchors.top: parent.top - anchors.topMargin: 0 - anchors.right: parent.right - anchors.rightMargin: 0 - - width: active ? 138 : 0 - height: active ? 28 : 0 - - active: (settingsManager.appThemeCSD && Qt.platform.os === "windows") - asynchronous: true - - sourceComponent: Row { - id: csdWindows - spacing: 0 - - //////// - - Rectangle { // button minimize - width: 46; height: 28; - color: mouseAreaMin.containsMouse ? "#33aaaaaa" : "transparent" - - Rectangle { - width: 10; height: 1; - anchors.centerIn: parent - color: mouseAreaMin.containsMouse ? Theme.colorHighContrast : Theme.colorIcon - } - - MouseArea { - id: mouseAreaMin - anchors.fill: parent - - hoverEnabled: true - onClicked: appWindow.showMinimized() - } - } - - //////// - - Rectangle { // button maximize - width: 46; height: 28; - color: mouseAreaMax.containsMouse ? "#33aaaaaa" : "transparent" - - Rectangle { - width: 10; height: 10; - anchors.centerIn: parent - color: "transparent" - border.width: 1 - border.color: mouseAreaMax.containsMouse ? Theme.colorHighContrast : Theme.colorIcon - } - - MouseArea { - id: mouseAreaMax - anchors.fill: parent - - hoverEnabled: true - onClicked: { - if (appWindow.visibility === ApplicationWindow.Maximized) - appWindow.showNormal() - else - appWindow.showMaximized() - } - } - } - - //////// - - Rectangle { // button close - width: 46; height: 28; - color: mouseAreaClose.containsMouse ? "red" : "transparent" - - IconSvg { - width: 16; height: 16; - anchors.centerIn: parent - - source: "qrc:/assets/icons_material/baseline-close-24px.svg" - color: mouseAreaClose.containsMouse ? "white" : Theme.colorIcon - } -/* - Rectangle { - width: 12; height: 1; - anchors.centerIn: parent - rotation: 45 - color: mouseAreaClose.containsMouse ? "white" : Theme.colorIcon - } - Rectangle { - width: 12; height: 1; - anchors.centerIn: parent - rotation: -45 - color: mouseAreaClose.containsMouse ? "white" : Theme.colorIcon - } -*/ - MouseArea { - id: mouseAreaClose - anchors.fill: parent - - hoverEnabled: true - onClicked: appWindow.close() - } - } - } -} diff --git a/qml/components_generic/DataBarCompact.qml b/qml/components_generic/DataBarCompact.qml deleted file mode 100644 index fc2157c1..00000000 --- a/qml/components_generic/DataBarCompact.qml +++ /dev/null @@ -1,240 +0,0 @@ -import QtQuick 2.15 - -//import QtGraphicalEffects 1.15 // Qt5 -import Qt5Compat.GraphicalEffects // Qt6 - -import ThemeEngine 1.0 -import "qrc:/js/UtilsNumber.js" as UtilsNumber - -Item { - id: dataBarCompact - implicitWidth: 128 - implicitHeight: 32 - - property int hhh: 8 - property bool animated: true - - property real value: 0 - property real valueMin: 0 - property real valueMax: 100 - property real limitMin: -1 - property real limitMax: -1 - - property string prefix - property string suffix - property int floatprecision: 0 - property bool warning: false - - property string legend - property int legendWidth: item_legend.contentWidth - property int legendContentWidth: item_legend.contentWidth - - // colors - property string colorText: Theme.colorText - property string colorForeground: Theme.colorPrimary - property string colorBackground: Theme.colorForeground - - //////////////////////////////////////////////////////////////////////////// - - Row { - anchors.fill: parent - spacing: 12 - - //////////////// - - Text { - id: item_legend - width: legendWidth - anchors.verticalCenter: item_bg.verticalCenter - - visible: (legend.length) - - text: legend - textFormat: Text.PlainText - font.bold: true - font.pixelSize: Theme.fontSizeContentVerySmall - font.capitalization: Font.AllUppercase - color: Theme.colorSubText - horizontalAlignment: Text.AlignRight - } - - //////////////// - - Item { - id: item_bg - width: dataBarCompact.width - (item_legend.visible ? (item_legend.width + parent.spacing) : 0) - height: hhh - anchors.bottom: parent.bottom - - //////// - - Rectangle { - id: rect_bg - anchors.fill: parent - - radius: 4 - clip: isDesktop - color: dataBarCompact.colorBackground - - layer.enabled: !isDesktop - layer.effect: OpacityMask { - maskSource: Rectangle { - x: rect_bg.x - y: rect_bg.y - width: rect_bg.width - height: rect_bg.height - radius: rect_bg.radius - } - } - - Rectangle { - id: rect_data - width: { - var res = UtilsNumber.normalize(value, valueMin, valueMax) * rect_bg.width - - if (value <= valueMin || value >= valueMax) - res += 0 - else - res += 1.5*radius // +radius, so the indicator arrow point to the real value, not the rounded end of the data bar - - if (res > rect_bg.width) - res = rect_bg.width - - return res - } - anchors.top: parent.top - anchors.left: parent.left - anchors.bottom: parent.bottom - - radius: 3 - color: dataBarCompact.colorForeground - - Behavior on width { NumberAnimation { duration: animated ? 333 : 0 } } - } - - Rectangle { - id: item_limit_low - width: 2 - anchors.top: parent.top - anchors.bottom: parent.bottom - - visible: (limitMin > 0 && limitMin > valueMin && limitMin < valueMax) - x: UtilsNumber.normalize(limitMin, valueMin, valueMax) * rect_bg.width - color: (limitMin < value) ? Theme.colorLowContrast : Theme.colorHighContrast - opacity: (limitMin < value) ? 0.66 : 0.33 - - Behavior on x { NumberAnimation { duration: animated ? 333 : 0 } } - Behavior on color { ColorAnimation { duration: animated ? 333 : 0 } } - Behavior on opacity { OpacityAnimator { duration: animated ? 333 : 0 } } - } - Rectangle { - id: item_limit_high - width: 2 - anchors.top: parent.top - anchors.bottom: parent.bottom - - visible: (limitMax > 0 && limitMax > valueMin && limitMax < valueMax) - x: UtilsNumber.normalize(limitMax, valueMin, valueMax) * rect_bg.width - color: (limitMax < value) ? Theme.colorLowContrast : Theme.colorHighContrast - opacity: (limitMax < value) ? 0.66 : 0.33 - - Behavior on x { NumberAnimation { duration: animated ? 333 : 0 } } - Behavior on color { ColorAnimation { duration: animated ? 333 : 0 } } - Behavior on opacity { OpacityAnimator { duration: animated ? 333 : 0 } } - } - } - - //////// - - Text { - id: textIndicator - height: 15 - y: -22 - x: { - if (rect_data.width < ((textIndicator.width / 2) + 8)) { // left - return 4 - } else if ((rect_bg.width - rect_data.width) < (textIndicator.width / 2)) { // right - return rect_bg.width - textIndicator.width - 4 - } - return rect_data.width - (textIndicator.width / 2) - 4 - } - - text: { - if (value < -20) - return " ? "; - else { - if (value % 1 === 0) - return prefix + value + suffix - else - return prefix + value.toFixed(floatprecision) + suffix - } - } - textFormat: Text.PlainText - color: "white" - font.bold: true - font.pixelSize: Theme.fontSizeContentVerySmall - horizontalAlignment: Text.AlignHCenter - - Rectangle { - height: 18 - anchors.left: parent.left - anchors.leftMargin: -4 - anchors.right: parent.right - anchors.rightMargin: -4 - anchors.verticalCenter: parent.verticalCenter - - z: -1 - radius: 1 - color: dataBarCompact.colorForeground - - Rectangle { - id: item_indicator_triangle - width: 6 - height: 6 - anchors.top: parent.bottom - anchors.topMargin: -3 - anchors.horizontalCenter: parent.horizontalCenter - anchors.horizontalCenterOffset: { - if (rect_data.width < ((textIndicator.width / 2) + 8)) { // left - if (rect_data.width > 12) { - return (rect_data.width - ((textIndicator.width / 2) + 8)) - } else { - return -((textIndicator.width / 2) - 4) - } - } else if ((rect_bg.width - rect_data.width) < (textIndicator.width / 2)) { // right - return -((rect_bg.width - rect_data.width) - (textIndicator.width / 2)) - 4 - } - return 0 - } - - radius: 1 - rotation: 45 - color: dataBarCompact.colorForeground - } - } - } - - //////// - - IconSvg { - id: warningIndicator - width: 15 - height: 15 - anchors.verticalCenter: textIndicator.verticalCenter - anchors.leftMargin: 8 - anchors.left: textIndicator.right - - color: Theme.colorRed - opacity: (warning && value > -20 && value < limitMin) ? 1 : 0 - Behavior on opacity { OpacityAnimator { duration: animated ? 333 : 0 } } - source: "qrc:/assets/icons_material/baseline-warning-24px.svg" - } - - //////// - } - - //////////////// - } - - //////////////////////////////////////////////////////////////////////////// -} diff --git a/qml/components_generic/DataBarSolid.qml b/qml/components_generic/DataBarSolid.qml deleted file mode 100644 index ec460824..00000000 --- a/qml/components_generic/DataBarSolid.qml +++ /dev/null @@ -1,308 +0,0 @@ -import QtQuick 2.15 - -//import QtGraphicalEffects 1.15 // Qt5 -import Qt5Compat.GraphicalEffects // Qt6 - -import ThemeEngine 1.0 -import "qrc:/js/UtilsNumber.js" as UtilsNumber - -Item { - id: dataBarSolid - implicitWidth: 128 - implicitHeight: 16 - - property int hhh: 16 - property bool animated: true - - property real value: 0 - property real valueMin: 0 - property real valueMax: 100 - property real limitMin: -1 - property real limitMax: -1 - - property string prefix - property string suffix - property int floatprecision: 0 - property bool warning: false - - property string legend - property int legendWidth: item_legend.contentWidth - property int legendContentWidth: item_legend.contentWidth - - // colors - property string colorForeground: Theme.colorPrimary - property string colorBackground: Theme.colorForeground - - //////////////////////////////////////////////////////////////////////////// - - Row { - anchors.fill: parent - spacing: 12 - - //////////////// - - Text { - id: item_legend - width: legendWidth - anchors.verticalCenter: parent.verticalCenter - - visible: (legend.length) - - text: legend - textFormat: Text.PlainText - font.pixelSize: Theme.fontSizeContentVerySmall - font.bold: true - font.capitalization: Font.AllUppercase - color: Theme.colorSubText - horizontalAlignment: Text.AlignRight - } - - //////////////// - - Item { - id: item_bg - width: dataBarSolid.width - (item_legend.visible ? (item_legend.width + parent.spacing) : 0) - height: hhh - anchors.verticalCenter: parent.verticalCenter - - clip: true - - Rectangle { - id: rect_bg - anchors.fill: parent - - radius: hhh - color: dataBarSolid.colorBackground - - layer.enabled: !isDesktop - layer.effect: OpacityMask { - maskSource: Rectangle { - x: rect_bg.x - y: rect_bg.y - width: rect_bg.width - height: rect_bg.height - radius: rect_bg.radius - } - } - - Rectangle { - id: item_data - width: { - var res = UtilsNumber.normalize(value, valueMin, valueMax) * item_bg.width - if (res > item_bg.width) res = item_bg.width - return res - } - anchors.top: parent.top - anchors.bottom: parent.bottom - anchors.left: parent.left - - radius: hhh - color: dataBarSolid.colorForeground - - Behavior on width { NumberAnimation { duration: animated ? 333 : 0 } } - } - } - - //////// - - Rectangle { - id: item_limit_low - width: 2 - anchors.top: parent.top - anchors.bottom: parent.bottom - - visible: (limitMin > 0 && limitMin > valueMin && limitMin < valueMax) && - (x < indicator.x || x > indicator.x+indicator.width) && - (x+width < indicator.x || x+width > indicator.x+indicator.width) - x: UtilsNumber.normalize(limitMin, valueMin, valueMax) * item_bg.width - color: (limitMin <= value) ? Theme.colorLowContrast : Theme.colorHighContrast - opacity: (limitMin <= value) ? 0.75 : 0.25 - - Behavior on x { NumberAnimation { duration: animated ? 333 : 0 } } - Behavior on color { ColorAnimation { duration: animated ? 333 : 0 } } - Behavior on opacity { OpacityAnimator { duration: animated ? 333 : 0 } } - } - Text { - anchors.right: item_limit_low.left - anchors.rightMargin: 4 - anchors.verticalCenter: parent.verticalCenter - anchors.verticalCenterOffset: 0 - - visible: (limitMin > 0 && limitMin > valueMin && limitMin < valueMax) && - (width < item_limit_low.x) && - (x < indicator.x || x > indicator.x+indicator.width) && - (x+width < indicator.x || x+width > indicator.x+indicator.width) - - //: Short for minimum - text: qsTr("min") - textFormat: Text.PlainText - - font.pixelSize: Theme.fontSizeContentVerySmall - color: (limitMin <= value) ? Theme.colorLowContrast : Theme.colorHighContrast - opacity: (limitMin <= value) ? 0.75 : 0.25 - Behavior on color { ColorAnimation { duration: animated ? 333 : 0 } } - Behavior on opacity { OpacityAnimator { duration: animated ? 333 : 0 } } - } - Rectangle { - anchors.horizontalCenter: item_limit_low.horizontalCenter - anchors.verticalCenter: item_limit_low.bottom - //width: 6; height: 6; radius: 1; rotation: 45; // little triangle - width: 6; height: 3; // little bar - z: 2 - - visible: (limitMin > 0 && limitMin > valueMin && limitMin < valueMax) && - (!(x-2 < indicator.x || x+2 > indicator.x+indicator.width) || - !(x+width-2 < indicator.x || x+width+2 > indicator.x+indicator.width)) - - color: (limitMin < value) ? Theme.colorLowContrast : Theme.colorHighContrast - opacity: (limitMin < value) ? 0.75 : 0.25 - Behavior on color { ColorAnimation { duration: animated ? 333 : 0 } } - Behavior on opacity { OpacityAnimator { duration: animated ? 333 : 0 } } - } - - //////// - - Rectangle { - id: item_limit_high - width: 2 - anchors.top: parent.top - anchors.bottom: parent.bottom - - visible: (limitMax > 0 && limitMax > valueMin && limitMax < valueMax) && - (x < indicator.x || x > indicator.x+indicator.width) && - (x+width < indicator.x || x+width > indicator.x+indicator.width) - - x: UtilsNumber.normalize(limitMax, valueMin, valueMax) * item_bg.width - color: (limitMax < value) ? Theme.colorLowContrast : Theme.colorHighContrast - opacity: (limitMax < value) ? 0.75 : 0.25 - - Behavior on x { NumberAnimation { duration: animated ? 333 : 0 } } - Behavior on color { ColorAnimation { duration: animated ? 333 : 0 } } - Behavior on opacity { OpacityAnimator { duration: animated ? 333 : 0 } } - } - Text { - anchors.left: item_limit_high.right - anchors.leftMargin: 4 - anchors.verticalCenter: parent.verticalCenter - anchors.verticalCenterOffset: 0 - - visible: (limitMax > 0 && limitMax > valueMin && limitMax < valueMax) && - (x < indicator.x || x > indicator.x+indicator.width) && - (x+width < indicator.x || x+width > indicator.x+indicator.width) - - //: Short for maximum - text: qsTr("max") - textFormat: Text.PlainText - - font.pixelSize: Theme.fontSizeContentVerySmall - color: (limitMax < value) ? Theme.colorLowContrast : Theme.colorHighContrast - opacity: (limitMax < value) ? 0.75 : 0.25 - Behavior on color { ColorAnimation { duration: animated ? 333 : 0 } } - Behavior on opacity { OpacityAnimator { duration: animated ? 333 : 0 } } - } - Rectangle { - anchors.horizontalCenter: item_limit_high.horizontalCenter - anchors.verticalCenter: item_limit_high.bottom - //width: 6; height: 6; radius: 1; rotation: 45; // little triangle - width: 6; height: 3; // little bar - z: 2 - - visible: (limitMax > 0 && limitMax > valueMin && limitMax < valueMax) && - (!(x-2 < indicator.x || x+2 > indicator.x+indicator.width) || - !(x+width-2 < indicator.x || x+width+2 > indicator.x+indicator.width)) - - color: (limitMax < value) ? Theme.colorLowContrast : Theme.colorHighContrast - opacity: (limitMax < value) ? 0.75 : 0.25 - Behavior on color { ColorAnimation { duration: animated ? 333 : 0 } } - Behavior on opacity { OpacityAnimator { duration: animated ? 333 : 0 } } - } - - //////// - - Rectangle { - id: indicator - anchors.verticalCenter: parent.verticalCenter - - width: textIndicator.width + 12 - height: hhh - radius: (value <= 0 || item_data.width > indicator.width) ? hhh : 0 - color: { - if (value <= 0) - return "transparent" - else if (item_data.width > indicator.width) - return dataBarSolid.colorForeground - else - return dataBarSolid.colorBackground - } - - x: { - if (item_data.width > indicator.width) - return item_data.width - indicator.width - else - return item_data.width - } - - Text { - id: textIndicator - height: hhh - anchors.centerIn: parent - - color: (item_data.width > indicator.width) ? "white" : Theme.colorSubText - - text: { - if (value < -20) - return " ? "; - else { - if (value % 1 === 0) - return prefix + value + suffix - else - return prefix + value.toFixed(floatprecision) + suffix - } - } - textFormat: Text.PlainText - font.bold: true - font.pixelSize: isDesktop ? 12 : 13 - fontSizeMode: Text.Fit - minimumPixelSize: 10 - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } - - IconSvg { - id: warningIndicator - width: hhh - 2 - height: hhh - 2 - anchors.verticalCenter: parent.verticalCenter - anchors.leftMargin: 4 - anchors.left: { - if (item_data.width > indicator.width) - return parent.right - else - return textIndicator.right - } - - color: Theme.colorRed - opacity: (warning && value > -20 && value < limitMin) ? 1 : 0 - Behavior on opacity { OpacityAnimator { duration: animated ? 333 : 0 } } - source: "qrc:/assets/icons_material/baseline-warning-24px.svg" - - Rectangle { - width: hhh - height: hhh - anchors.verticalCenter: parent.verticalCenter - anchors.horizontalCenter: parent.horizontalCenter - z: -1 - color: dataBarSolid.colorBackground - visible: (parent.opacity === 1) - } - } - } - - //////// - } - - //////////////// - } - - //////////////////////////////////////////////////////////////////////////// -} diff --git a/qml/components_generic/DatePicker5.qml b/qml/components_generic/DatePicker5.qml deleted file mode 100644 index 2c9c0ab1..00000000 --- a/qml/components_generic/DatePicker5.qml +++ /dev/null @@ -1,249 +0,0 @@ -import QtQuick 2.15 - -import Qt.labs.calendar 1.0 - -import ThemeEngine 1.0 - -Item { - id: datePicker - implicitWidth: 320 - implicitHeight: 480 - - //////////////////////////////////////////////////////////////////////////// - - //property var locale: Qt.locale() - - property var today: new Date() - property bool isToday: false - - property var minDate: null - property var maxDate: null - - property date initialDate - property date currentDate - - signal updateDate(var newdate) - - function openDate(date) { - //console.log("openDate(" + date + ")") - minDate = null - maxDate = null - - initialDate = date - currentDate = date - - today = new Date() - grid.month = date.getMonth() - - printDate() - } - - function openDate_limits(datetime, min, max) { - openDate(datetime) - - minDate = min - maxDate = max - } - - function printDate() { - var thismonth = new Date(grid.year, grid.month) - bigMonth.text = thismonth.toLocaleString(locale, "MMMM") - - isToday = (today.toLocaleString(locale, "dd MMMM yyyy") === currentDate.toLocaleString(locale, "dd MMMM yyyy")) - } - - Component.onCompleted: { - openDate(new Date()) - } - - //////////////////////////////////////////////////////////////////////////// - - Rectangle { - id: background - anchors.fill: parent - - clip: false - radius: Theme.componentRadius*2 - color: Theme.colorBackground - border.width: Theme.componentBorderWidth - border.color: Theme.colorSeparator - - //////// - - Rectangle { - id: motw - anchors.left: parent.left - anchors.right: parent.right - - z: 3 - height: 48 - radius: Theme.componentRadius*2 - color: Theme.colorSeparator - - Rectangle { - anchors.left: parent.left - anchors.right: parent.right - anchors.bottom: parent.bottom - height: (parent.height / 2) - color: parent.color - } - - RoundButtonIcon { - width: 48; height: 48; - anchors.left: parent.left - anchors.verticalCenter: parent.verticalCenter - source: "qrc:/assets/icons_material/baseline-chevron_left-24px.svg" - - onClicked: { - if (grid.month > 0) { - grid.month-- - } else { - grid.month = 11 - grid.year-- - } - printDate() - } - } - Text { - id: bigMonth - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - text: currentDate.toLocaleString(locale, "MMMM") // "Octobre" - font.capitalization: Font.Capitalize - font.pixelSize: Theme.fontSizeContentBig - color: Theme.colorText - } - RoundButtonIcon { - anchors.right: parent.right - width: 48; height: 48; - anchors.verticalCenter: parent.verticalCenter - source: "qrc:/assets/icons_material/baseline-chevron_right-24px.svg" - - onClicked: { - if (grid.month < 11) { - grid.month++ - } else { - grid.month = 0 - grid.year++ - } - printDate() - } - } - } - - //////// - - Rectangle { - id: dow - anchors.top: motw.bottom - anchors.left: parent.left - anchors.leftMargin: Theme.componentBorderWidth - anchors.right: parent.right - anchors.rightMargin: Theme.componentBorderWidth - - z: 2 - height: 48 - color: Qt.lighter(Theme.colorSeparator, 1.1) - - DayOfWeekRow { - anchors.left: parent.left - anchors.leftMargin: 4 - anchors.right: parent.right - anchors.rightMargin: 4 - anchors.verticalCenter: parent.verticalCenter - - //locale: datePicker.locale - - delegate: Text { - anchors.bottom: parent.bottom - text: model.shortName.substring(0, 1).toUpperCase() - color: Theme.colorText - font.bold: true - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } - } - } - - //////// - - MonthGrid { - id: grid - anchors.top: dow.bottom - anchors.left: parent.left - anchors.leftMargin: 4 - anchors.right: parent.right - anchors.rightMargin: 4 - anchors.bottom: parent.bottom - - //locale: datePicker.locale - - delegate: Text { - width: ((grid.width - 8) / 7) - height: (grid.height / 6) - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - - opacity: (model.month === grid.month ? 1 : 0.2) - text: model.day - font: grid.font - //font.bold: model.isToday - color: selected ? "white" : Theme.colorSubText - - property bool selected: (model.day === currentDate.getDate() && - model.month === currentDate.getMonth() && - model.year === currentDate.getFullYear()) - - Rectangle { - z: -1 - anchors.centerIn: parent - width: Math.min(parent.width, parent.height) - height: width - radius: width - color: selected ? Theme.colorSecondary : "transparent" //Theme.colorBackground - border.color: Theme.colorSecondary - border.width: model.isToday ? Theme.componentBorderWidth : 0 - } - } - - onClicked: (date) => { - if (date.getMonth() === grid.month) { - // validate date (min / max) - if (minDate && maxDate) { - const diffMinTime = (minDate - date) - const diffMinDays = -Math.ceil(diffMinTime / (1000 * 60 * 60 * 24) - 1) - //console.log(diffMinDays + " diffMinDays") - const diffMaxTime = (minDate - date) - const diffMaxDays = -Math.ceil(diffMaxTime / (1000 * 60 * 60 * 24) - 1) - //console.log(diffMaxDays + " diffMaxDays") - - if (diffMinDays > -1 && diffMaxDays < 1) { - date.setHours(currentDate.getHours(), - currentDate.getMinutes(), - currentDate.getSeconds()) - currentDate = date - updateDate(currentDate) - } - } else { - const diffTime = (today - date) - const diffDays = -Math.ceil(diffTime / (1000 * 60 * 60 * 24) - 1) - //console.log(diffDays + " days") - - // validate date (-15 / today) - if (diffDays > -15 && diffDays < 1) { - date.setHours(currentDate.getHours(), - currentDate.getMinutes(), - currentDate.getSeconds()) - currentDate = date - updateDate(currentDate) - } - } - - printDate() - } - } - } - - //////// - } -} diff --git a/qml/components_generic/DatePicker6.qml b/qml/components_generic/DatePicker6.qml deleted file mode 100644 index 84a10f72..00000000 --- a/qml/components_generic/DatePicker6.qml +++ /dev/null @@ -1,266 +0,0 @@ -import QtQuick -import QtQuick.Layouts -import QtQuick.Controls - -import ThemeEngine - -Item { - id: datePicker - implicitWidth: 320 - implicitHeight: 480 - - //////////////////////////////////////////////////////////////////////////// - - //property var locale: Qt.locale() - - property date today: new Date() - property date initialDate - property date selectedDate - - property bool isSelectedDateToday: false - - property var minDate: null - property var maxDate: null - - //////////////////////////////////////////////////////////////////////////// - - signal updateDate(var newdate) - - function openDate(date) { - //console.log("openDate(" + date + ")") - - today = new Date() - initialDate = date - selectedDate = date - grid.year = date.getFullYear() - grid.month = date.getMonth() - - minDate = null - maxDate = null - - printDate() - } - - function openDate_limits(datetime, min, max) { - openDate(datetime) - - minDate = min - maxDate = max - } - - function printDate() { - var thismonth = new Date(grid.year, grid.month) - bigMonth.text = thismonth.toLocaleString(locale, "MMMM") - - if (thismonth.getFullYear() !== today.getFullYear()) - bigMonth.text += " " + thismonth.toLocaleString(locale, "yyyy") - - isSelectedDateToday = (today.toLocaleString(locale, "dd MMMM yyyy") === selectedDate.toLocaleString(locale, "dd MMMM yyyy")) - } - - //////////////////////////////////////////////////////////////////////////// - - Rectangle { - id: background - anchors.fill: parent - - clip: false - radius: Theme.componentRadius*2 - color: Theme.colorBackground - border.width: Theme.componentBorderWidth - border.color: Theme.colorSeparator - - //////// - - Rectangle { - id: motw - anchors.left: parent.left - anchors.right: parent.right - - z: 3 - height: 48 - radius: Theme.componentRadius*2 - color: Theme.colorSeparator - - Rectangle { - anchors.left: parent.left - anchors.right: parent.right - anchors.bottom: parent.bottom - height: (parent.height / 2) - color: parent.color - } - - RoundButtonIcon { - width: 48; height: 48; - anchors.left: parent.left - anchors.verticalCenter: parent.verticalCenter - source: "qrc:/assets/icons_material/baseline-chevron_left-24px.svg" - - onClicked: { - if (grid.month > 0) { - grid.month-- - } else { - grid.month = 11 - grid.year-- - } - printDate() - } - } - Text { - id: bigMonth - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - text: selectedDate.toLocaleString(locale, "MMMM") // "Octobre" - textFormat: Text.PlainText - font.capitalization: Font.Capitalize - font.pixelSize: Theme.fontSizeContentBig - color: Theme.colorText - } - RoundButtonIcon { - anchors.right: parent.right - width: 48; height: 48; - anchors.verticalCenter: parent.verticalCenter - source: "qrc:/assets/icons_material/baseline-chevron_right-24px.svg" - - onClicked: { - if (grid.month < 11) { - grid.month++ - } else { - grid.month = 0 - grid.year++ - } - printDate() - } - } - } - - //////// - - Rectangle { - id: dow - anchors.top: motw.bottom - anchors.left: parent.left - anchors.leftMargin: Theme.componentBorderWidth - anchors.right: parent.right - anchors.rightMargin: Theme.componentBorderWidth - - z: 2 - height: 48 - color: Qt.lighter(Theme.colorSeparator, 1.1) - - DayOfWeekRow { - anchors.left: parent.left - anchors.leftMargin: 4 - anchors.right: parent.right - anchors.rightMargin: 4 - anchors.verticalCenter: parent.verticalCenter - - Layout.fillWidth: true - //locale: datePicker.locale - - delegate: Text { - anchors.bottom: parent.bottom - text: model.shortName.substring(0, 1).toUpperCase() - textFormat: Text.PlainText - font.pixelSize: Theme.componentFontSize - font.bold: true - color: Theme.colorText - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } - } - } - - //////// - - MonthGrid { - id: grid - anchors.top: dow.bottom - anchors.left: parent.left - anchors.leftMargin: 4 - anchors.right: parent.right - anchors.rightMargin: 4 - anchors.bottom: parent.bottom - - Layout.fillWidth: true - //locale: datePicker.locale - - delegate: Text { - width: ((grid.width - 8) / 7) - height: (grid.height / 6) - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - - property bool isWeekend: (model.date.getDay() >= 5) - - property bool isToday: (model.day === datePicker.today.getDate() && - model.month === datePicker.today.getMonth() && - model.year === datePicker.today.getFullYear()) - - property bool isSelected: (model.day === selectedDate.getDate() && - model.month === selectedDate.getMonth() && - model.year === selectedDate.getFullYear()) - - text: model.day - textFormat: Text.PlainText - - font.pixelSize: Theme.componentFontSize - font.bold: isToday - color: isSelected ? "white" : (isWeekend ? Theme.colorSubText : Theme.colorText) - opacity: (model.month === grid.month ? 1 : 0.2) - - Rectangle { - z: -1 - anchors.centerIn: parent - width: Math.min(parent.width, parent.height) - height: width - radius: width - color: isSelected ? Theme.colorSecondary : "transparent" - border.color: Theme.colorSecondary - border.width: isToday ? Theme.componentBorderWidth : 0 - } - } - - onClicked: (date) => { - if (date.getMonth() === grid.month) { - // validate date (min / max) - if (minDate && maxDate) { - const diffMinTime = (minDate - date) - const diffMinDays = -Math.ceil(diffMinTime / (1000 * 60 * 60 * 24) - 1) - //console.log(diffMinDays + " diffMinDays") - const diffMaxTime = (minDate - date) - const diffMaxDays = -Math.ceil(diffMaxTime / (1000 * 60 * 60 * 24) - 1) - //console.log(diffMaxDays + " diffMaxDays") - - if (diffMinDays > -1 && diffMaxDays < 1) { - date.setHours(selectedDate.getHours(), - selectedDate.getMinutes(), - selectedDate.getSeconds()) - selectedDate = date - updateDate(selectedDate) - } - } else { - const diffTime = (today - date) - const diffDays = -Math.ceil(diffTime / (1000 * 60 * 60 * 24) - 1) - //console.log(diffDays + " days") - - // validate date (-21 / today) - if (diffDays > -21 && diffDays < 1) { - date.setHours(selectedDate.getHours(), - selectedDate.getMinutes(), - selectedDate.getSeconds()) - selectedDate = date - updateDate(selectedDate) - } - } - - printDate() - } - } - } - - //////// - } - - //////////////////////////////////////////////////////////////////////////// -} diff --git a/qml/components_generic/DesktopHeaderItem.qml b/qml/components_generic/DesktopHeaderItem.qml deleted file mode 100644 index 494a696d..00000000 --- a/qml/components_generic/DesktopHeaderItem.qml +++ /dev/null @@ -1,107 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Layouts 1.15 - -import ThemeEngine 1.0 - -Item { - id: control - implicitWidth: 64 - implicitHeight: 64 - - width: Math.max(parent.height, content.width + 32) - height: parent.height // height drive the size of this element - - // actions - signal clicked() - signal pressed() - signal pressAndHold() - - // states - property bool selected: false - - // settings - property url source - property int sourceSize: 32 - property string text - property string highlightMode: "background" // available: background, indicator, content - - // colors - property string colorContent: Theme.colorHeaderContent - property string colorHighlight: Theme.colorHeaderHighlight - - //////////////////////////////////////////////////////////////////////////// - - MouseArea { - anchors.fill: parent - hoverEnabled: true - - onClicked: control.clicked() - onPressed: control.pressed() - onPressAndHold: control.pressAndHold() - - Rectangle { // bgRect - anchors.fill: parent - - visible: (control.selected && control.highlightMode === "background") - color: control.colorHighlight - } - - Rectangle { // bgFocus - anchors.fill: parent - - visible: (highlightMode === "background") - color: control.colorHighlight - opacity: parent.containsMouse ? 0.5 : 0 - Behavior on opacity { OpacityAnimator { duration: 333 } } - } - - Rectangle { // indicator - anchors.left: parent.left - anchors.right: parent.right - anchors.bottom: parent.bottom - - height: 4 - visible: (control.selected && highlightMode === "indicator") - color: Theme.colorPrimary - } - } - - //////////////////////////////////////////////////////////////////////////// - - RowLayout { - id: content - anchors.centerIn: parent - spacing: 8 - - IconSvg { - id: contentImage - width: control.sourceSize - height: control.sourceSize - - Layout.maximumWidth: control.sourceSize - Layout.maximumHeight: control.sourceSize - - visible: source.toString().length - - source: control.source - color: (!control.selected && control.highlightMode === "content") ? control.colorHighlight : control.colorContent - opacity: control.enabled ? 1.0 : 0.33 - } - - Text { - id: contentText - height: parent.height - - visible: text - - text: control.text - textFormat: Text.PlainText - color: (!control.selected && control.highlightMode === "content") ? control.colorHighlight : control.colorContent - font.pixelSize: Theme.componentFontSize - font.bold: true - verticalAlignment: Text.AlignVCenter - } - } - - //////////////////////////////////////////////////////////////////////////// -} diff --git a/qml/components_generic/DesktopSidebarItem.qml b/qml/components_generic/DesktopSidebarItem.qml deleted file mode 100644 index b4acdf94..00000000 --- a/qml/components_generic/DesktopSidebarItem.qml +++ /dev/null @@ -1,146 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Layouts 1.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 -import "qrc:/js/UtilsNumber.js" as UtilsNumber - -T.Button { - id: control - - implicitWidth: 64 - implicitHeight: 64 - - focusPolicy: Qt.NoFocus - - width: parent.width // width drive the size of this element - height: Math.max(parent.width, content.height + 24) - - property url source - property int sourceSize: 40 - - property string highlightMode: "background" // available: background, indicator, circle, content - - // colors - property string colorContent: Theme.colorSidebarContent - property string colorHighlight: Theme.colorSidebarHighlight - - // indicator - property bool indicatorVisible: false - property bool indicatorAnimated: false - property color indicatorColor: "white" - property url indicatorSource: "" - - //////////////////////////////////////////////////////////////////////////// - - background: Rectangle { - implicitWidth: 64 - implicitHeight: 64 - - width: (control.highlightMode === "circle") ? height : parent.width - height: parent.height - radius: (control.highlightMode === "circle") ? width : 0 - - visible: (control.highlightMode === "background" || - control.highlightMode === "indicator" || - control.highlightMode === "circle") - color: control.colorHighlight - opacity: { - if (control.highlighted) return 1 - if (control.hovered) return 0.5 - return 0 - } - Behavior on opacity { OpacityAnimator { duration: 233 } } - - Rectangle { - id: backgroundIndicator - anchors.top: parent.top - anchors.left: parent.left - anchors.bottom: parent.bottom - - width: 6 - visible: (control.highlighted && control.highlightMode === "indicator") - color: Theme.colorPrimary - } - } - - //////////////////////////////////////////////////////////////////////////// - - ColumnLayout { - id: content - anchors.left: parent.left - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - spacing: -4 - - IconSvg { - id: contentImage - width: control.sourceSize - height: control.sourceSize - - Layout.alignment: Qt.AlignHCenter - Layout.minimumWidth: control.sourceSize - Layout.minimumHeight: control.sourceSize - Layout.maximumWidth: control.sourceSize - Layout.maximumHeight: control.sourceSize - - visible: source.toString().length - - source: control.source - color: (!control.highlighted && control.highlightMode === "content") ? control.colorHighlight : control.colorContent - opacity: control.enabled ? 1.0 : 0.33 - - Item { - id: contentIndicator - width: 24; height: 24; - anchors.right: parent.right - anchors.rightMargin: -4 - anchors.bottom: parent.bottom - - opacity: (control.indicatorVisible || control.indicatorAnimated) ? 1 : 0 - Behavior on opacity { OpacityAnimator { duration: 500 } } - - Rectangle { - width: 24; height: 24; radius: 12; - opacity: 0.66 - color: Theme.colorHighContrast - } - - IconSvg { - width: 20; height: 20; - anchors.centerIn: parent - source: control.indicatorSource - color: Theme.colorLowContrast - - NumberAnimation on rotation { - running: control.indicatorAnimated - loops: Animation.Infinite - alwaysRunToEnd: true - duration: 1000 - from: 0 - to: 360 - } - } - } - } - - Text { - id: contentText - width: parent.width - - visible: control.text - text: control.text - textFormat: Text.PlainText - color: (!control.highlighted && control.highlightMode === "content") ? control.colorHighlight : control.colorContent - font.pixelSize: Theme.fontSizeContentVerySmall - font.bold: true - - Layout.alignment: Qt.AlignHCenter - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } - } - - //////////////////////////////////////////////////////////////////////////// -} diff --git a/qml/components_generic/DrawerButton.qml b/qml/components_generic/DrawerButton.qml deleted file mode 100644 index 08ea2205..00000000 --- a/qml/components_generic/DrawerButton.qml +++ /dev/null @@ -1,125 +0,0 @@ -import QtQuick -import QtQuick.Layouts -import QtQuick.Templates as T -import QtQuick.Controls.impl -import QtQuick.Controls.Material -import QtQuick.Controls.Material.impl - -//import QtGraphicalEffects 1.15 // Qt5 -import Qt5Compat.GraphicalEffects // Qt6 - -import ThemeEngine - -T.ItemDelegate { - id: control - - implicitWidth: parent.width - implicitHeight: Theme.componentHeightL - - padding: Theme.componentMargin - spacing: Theme.componentMargin - verticalPadding: 0 - - property string iconSource - property string iconColor: Theme.colorIcon - property int iconSize: 24 - - property bool iconAnimated: false - property string iconAnimation // fade or rotate - - property string textColor: Theme.colorText - property int textSize: 13 - - //////////////// - - background: Item { - implicitHeight: Theme.componentHeightL - - Item { - anchors.fill: parent - anchors.margins: 4 - anchors.leftMargin: 8 - anchors.rightMargin: 8 - - RippleThemed { - width: parent.width - height: parent.height - - pressed: control.pressed - active: enabled && (control.down || control.visualFocus || control.hovered) - color: Qt.rgba(Theme.colorForeground.r, Theme.colorForeground.g, Theme.colorForeground.b, 0.5) - } - - layer.enabled: true - layer.effect: OpacityMask { - maskSource: Rectangle { - x: background.x - y: background.y - width: background.width - height: background.height - radius: Theme.componentRadius - } - } - } - - } - - //////////////// - - contentItem: RowLayout { - anchors.left: parent.left - anchors.leftMargin: screenPaddingLeft + Theme.componentMargin - anchors.right: parent.right - anchors.rightMargin: screenPaddingRight + Theme.componentMargin / 2 - - opacity: control.enabled ? 1 : 0.4 - - Item { - Layout.preferredWidth: Theme.componentHeightL - screenPaddingLeft - Theme.componentMargin - Layout.preferredHeight: Theme.componentHeightL - Layout.alignment: Qt.AlignTop - - IconSvg { - anchors.left: parent.left - anchors.leftMargin: (32 - control.iconSize) / 2 - anchors.verticalCenter: parent.verticalCenter - anchors.verticalCenterOffset: (control.height !== Theme.componentHeightL) ? -(Theme.componentMargin / 2) : 0 - - width: control.iconSize - height: control.iconSize - color: control.iconColor - source: control.iconSource - - NumberAnimation on rotation { // rotate animation // icon only - duration: 2000 - from: 0 - to: 360 - loops: Animation.Infinite - running: (control.iconAnimated && control.iconAnimation === "rotate") - alwaysRunToEnd: true - } - SequentialAnimation on opacity { // fade animation // icon only - loops: Animation.Infinite - running: (control.iconAnimated && control.iconAnimation === "fade") - alwaysRunToEnd: true - - PropertyAnimation { to: 0.33; duration: 750; } - PropertyAnimation { to: 1; duration: 750; } - } - } - } - - Text { - Layout.fillWidth: true - Layout.alignment: Qt.AlignVCenter - - text: control.text - color: control.textColor - wrapMode: Text.WordWrap - font.bold: true - font.pixelSize: control.textSize - } - } - - //////////////// -} diff --git a/qml/components_generic/DrawerItem.qml b/qml/components_generic/DrawerItem.qml deleted file mode 100644 index c659e714..00000000 --- a/qml/components_generic/DrawerItem.qml +++ /dev/null @@ -1,87 +0,0 @@ -import QtQuick -import QtQuick.Layouts -import QtQuick.Templates as T -import QtQuick.Controls.impl -import QtQuick.Controls.Material -import QtQuick.Controls.Material.impl - -import ThemeEngine - -T.ItemDelegate { - id: control - - implicitWidth: parent.width - implicitHeight: Theme.componentHeightL - - padding: Theme.componentMargin - spacing: Theme.componentMargin - verticalPadding: 0 - - property string iconSource - property string iconColor: Theme.colorIcon - property int iconSize: 24 - - property string textColor: Theme.colorText - property int textSize: 13 - - //////////////// - - background: Rectangle { - implicitHeight: Theme.componentHeightL - - color: control.highlighted ? Theme.colorForeground : Theme.colorBackground - - RippleThemed { - width: parent.width - height: parent.height - - clip: visible - anchor: control - pressed: control.pressed - active: enabled && (control.down || control.visualFocus || control.hovered) - color: Qt.rgba(Theme.colorForeground.r, Theme.colorForeground.g, Theme.colorForeground.b, 0.1) - } - } - - //////////////// - - contentItem: RowLayout { - anchors.left: parent.left - anchors.leftMargin: screenPaddingLeft + Theme.componentMargin - anchors.right: parent.right - anchors.rightMargin: screenPaddingRight + Theme.componentMargin / 2 - - opacity: control.enabled ? 1 : 0.4 - - Item { - Layout.preferredWidth: Theme.componentHeightL - screenPaddingLeft - Theme.componentMargin - Layout.preferredHeight: Theme.componentHeightL - Layout.alignment: Qt.AlignTop - - IconSvg { - anchors.left: parent.left - anchors.leftMargin: (32 - control.iconSize) / 2 - anchors.verticalCenter: parent.verticalCenter - anchors.verticalCenterOffset: (control.height !== Theme.componentHeightL) ? -(Theme.componentMargin / 2) : 0 - - width: control.iconSize - height: control.iconSize - color: control.iconColor - source: control.iconSource - } - } - - Text { - Layout.fillWidth: true - Layout.alignment: Qt.AlignVCenter - - text: control.text - color: control.textColor - wrapMode: Text.WordWrap - font.bold: true - font.pixelSize: control.textSize - } - } - - //////////////// -} diff --git a/qml/components_generic/FpsMonitor.qml b/qml/components_generic/FpsMonitor.qml deleted file mode 100644 index 4615ac33..00000000 --- a/qml/components_generic/FpsMonitor.qml +++ /dev/null @@ -1,79 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Window 2.15 - -Item { - id: control - height: 24 - z: 100 - - property int frameCounter: 0 - property int frameCounterAvg: 0 - property int counter: 0 - property int fps: 0 - property int fpsAvg: 0 - - Rectangle { - anchors.fill: rowrow - color: "black" - opacity: 0.8 - } - - Row { - id: rowrow - anchors.verticalCenter: parent.verticalCenter - - IconSvg { - anchors.verticalCenter: parent.verticalCenter - width: 24 - height: 24 - color: "white" - source: "qrc:/assets/icons_material/baseline-autorenew-24px.svg" - - NumberAnimation on rotation { - from: 0 - to: 360 - duration: 1000 - loops: Animation.Infinite - } - onRotationChanged: frameCounter++ - } - - Text { - anchors.verticalCenter: parent.verticalCenter - color: "#c0c0c0" - font.pixelSize: 18 - text: "Ø " + control.fpsAvg + " | " + control.fps + " fps" - textFormat: Text.PlainText - } - - Loader { - anchors.verticalCenter: parent.verticalCenter - asynchronous: true - active: (typeof utilsFps !== "undefined" && utilsFps) - - sourceComponent: Text { - color: "#c0c0c0" - font.pixelSize: 18 - text: " | " + utilsFps.fps + " fps" - textFormat: Text.PlainText - } - } - } - - Timer { - interval: 2000 - repeat: true - running: true - onTriggered: { - frameCounterAvg += frameCounter - control.fps = frameCounter / 2 - counter++ - frameCounter = 0 - if (counter >= 3) { - control.fpsAvg = frameCounterAvg / (2*counter) - frameCounterAvg = 0 - counter = 0 - } - } - } -} diff --git a/qml/components_generic/FrameBox.qml b/qml/components_generic/FrameBox.qml deleted file mode 100644 index 0c5d3867..00000000 --- a/qml/components_generic/FrameBox.qml +++ /dev/null @@ -1,36 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 - -T.Frame { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding) - - padding: 12 - leftPadding: padding + 8 - - background: Rectangle { - implicitWidth: 512 - implicitHeight: 128 - radius: 4 - color: Theme.colorBox - border.width: 2 - border.color: Theme.colorBoxBorder - - Rectangle { - anchors.top: parent.top - anchors.left: parent.left - anchors.bottom: parent.bottom - - width: 8 - radius: 2 - color: Theme.colorPrimary - } - } -} diff --git a/qml/components_generic/IconSvg.qml b/qml/components_generic/IconSvg.qml deleted file mode 100644 index 387db360..00000000 --- a/qml/components_generic/IconSvg.qml +++ /dev/null @@ -1,36 +0,0 @@ -import QtQuick 2.15 - -//import QtGraphicalEffects 1.15 // Qt5 -import Qt5Compat.GraphicalEffects // Qt6 - -Item { - implicitWidth: 32 - implicitHeight: 32 - - property alias source: sourceImg.source - property alias color: overlayImg.color - property alias fillMode: sourceImg.fillMode - property alias asynchronous: sourceImg.asynchronous - //property alias smooth: sourceImg.smooth - - Image { - id: sourceImg - anchors.fill: parent - - visible: parent.color ? false : true - sourceSize: Qt.size(width, height) - fillMode: Image.PreserveAspectFit - asynchronous: false - smooth: false - } - - ColorOverlay { - id: overlayImg - anchors.fill: parent - - visible: parent.color ? true : false - source: sourceImg - color: parent.color - cached: true - } -} diff --git a/qml/components_generic/ItemBadge.qml b/qml/components_generic/ItemBadge.qml deleted file mode 100644 index 876c6420..00000000 --- a/qml/components_generic/ItemBadge.qml +++ /dev/null @@ -1,77 +0,0 @@ -import QtQuick 2.15 - -import ThemeEngine 1.0 - -Item { - id: control - width: leftText.contentWidth + rightText.contentWidth + 24 - height: 22 - - property string legend: "legend" - property string text: "text" - - signal clicked() - - Rectangle { - id: leftRect - anchors.top: parent.top - anchors.topMargin: 0 - anchors.left: parent.left - anchors.leftMargin: 0 - anchors.right: leftText.right - anchors.rightMargin: -6 - anchors.bottom: parent.bottom - anchors.bottomMargin: 0 - - color: "#555555" - } - - Rectangle { - id: rightRect - anchors.top: parent.top - anchors.topMargin: 0 - anchors.left: leftRect.right - anchors.leftMargin: 0 - anchors.right: parent.right - anchors.rightMargin: 0 - anchors.bottom: parent.bottom - anchors.bottomMargin: 0 - - color: "#97ca00" - } - - Text { - id: leftText - anchors.left: parent.left - anchors.leftMargin: 6 - anchors.verticalCenter: parent.verticalCenter - - color: "white" - text: control.legend - textFormat: Text.PlainText - horizontalAlignment: Text.AlignHCenter - font.pixelSize: Theme.fontSizeContentVerySmall - } - - Text { - id: rightText - anchors.left: rightRect.left - anchors.leftMargin: 6 - anchors.right: rightRect.right - anchors.rightMargin: 6 - anchors.verticalCenter: parent.verticalCenter - - color: "white" - text: control.text - textFormat: Text.PlainText - horizontalAlignment: Text.AlignHCenter - font.pixelSize: Theme.fontSizeContentVerySmall - font.bold: true - } - - MouseArea { - id: mouseArea - anchors.fill: parent - onClicked: control.clicked() - } -} diff --git a/qml/components_generic/ItemTag.qml b/qml/components_generic/ItemTag.qml deleted file mode 100644 index 65c282bc..00000000 --- a/qml/components_generic/ItemTag.qml +++ /dev/null @@ -1,34 +0,0 @@ -import QtQuick 2.15 - -import ThemeEngine 1.0 - -Rectangle { - id: control - implicitWidth: 80 - implicitHeight: 28 - - width: contentText.contentWidth + 24 - - radius: Theme.componentRadius - color: Theme.colorForeground - - // settings - property string text: "TAG" - property string textColor: Theme.colorText - property int textSize: Theme.componentFontSize - property int textCapitalization: Font.Normal - property bool textBold: false - - Text { - id: contentText - anchors.centerIn: parent - - text: control.text - textFormat: Text.PlainText - - color: control.textColor - font.bold: control.textBold - font.pixelSize: control.textSize - font.capitalization: control.textCapitalization - } -} diff --git a/qml/components_generic/ItemTagButton.qml b/qml/components_generic/ItemTagButton.qml deleted file mode 100644 index 4cdb9903..00000000 --- a/qml/components_generic/ItemTagButton.qml +++ /dev/null @@ -1,74 +0,0 @@ -import QtQuick 2.15 - -import ThemeEngine 1.0 - -Rectangle { - id: control - implicitWidth: 80 - implicitHeight: 28 - width: contentRow.width + 20 - - radius: Theme.componentRadius - color: backgroundColor - - property string text: "TAG" - property string textColor: "white" - property int textSize: Theme.componentFontSize - - property url source: "qrc:/assets/icons_material/baseline-add-24px.svg" - property string sourceColor: "white" - property int sourceSize: 20 - - property string backgroundColor: Theme.colorPrimary - - signal clicked() - - Row { - id: contentRow - anchors.centerIn: parent - height: control.height - - Text { - anchors.top: parent.top - anchors.bottom: parent.bottom - - text: control.text - textFormat: Text.PlainText - color: control.textColor - elide: Text.ElideMiddle - font.capitalization: Font.AllUppercase - font.pixelSize: Theme.componentFontSize - font.bold: true - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } - - Item { - anchors.top: parent.top - anchors.bottom: parent.bottom - width: 20 - - Rectangle { - anchors.top: parent.top - anchors.bottom: parent.bottom - anchors.right: parent.right - anchors.rightMargin: 6 - width: 2 - color: control.textColor - opacity: 0.5 - } - } - - IconSvg { - anchors.verticalCenter: parent.verticalCenter - source: control.source - width: control.sourceSize - color: control.sourceColor - } - } - - MouseArea { - anchors.fill: parent - onClicked: control.clicked() - } -} diff --git a/qml/components_generic/ListItem.qml b/qml/components_generic/ListItem.qml deleted file mode 100644 index e32b62ab..00000000 --- a/qml/components_generic/ListItem.qml +++ /dev/null @@ -1,78 +0,0 @@ -import QtQuick -import QtQuick.Layouts -import QtQuick.Templates as T -import QtQuick.Controls.impl - -import ThemeEngine - -T.Control { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight, - implicitContentHeight + topPadding + bottomPadding) - - padding: Theme.componentMargin - spacing: Theme.componentMargin - verticalPadding: 0 - - property string iconSource - property string iconColor: Theme.colorIcon - property int iconSize: 32 - - property string text - property string textColor: Theme.colorText - property int textSize: Theme.fontSizeContent - - //////////////// - - background: Rectangle { - implicitHeight: Theme.componentHeightXL - - color: Theme.colorBackground - } - - //////////////// - - contentItem: RowLayout { - anchors.left: parent.left - anchors.leftMargin: screenPaddingLeft + Theme.componentMargin - anchors.right: parent.right - anchors.rightMargin: screenPaddingRight + Theme.componentMargin - - opacity: control.enabled ? 1 : 0.4 - spacing: 0 - - Item { - Layout.preferredWidth: appHeader.headerPosition - parent.anchors.leftMargin - Layout.preferredHeight: Theme.componentHeightXL - Layout.alignment: Qt.AlignTop - - IconSvg { - anchors.left: parent.left - anchors.leftMargin: (32 - control.iconSize) / 2 - anchors.verticalCenter: parent.verticalCenter - //anchors.verticalCenterOffset: (control.height !== Theme.componentHeightXL) ? -(Theme.componentMargin / 2) : 0 - - width: control.iconSize - height: control.iconSize - color: control.iconColor - source: control.iconSource - } - } - - Text { - Layout.fillWidth: true - Layout.alignment: Qt.AlignVCenter - - text: control.text - color: control.textColor - wrapMode: Text.WordWrap - font.pixelSize: control.textSize - horizontalAlignment: Text.AlignJustify - } - } - - //////////////// -} diff --git a/qml/components_generic/ListItemClickable.qml b/qml/components_generic/ListItemClickable.qml deleted file mode 100644 index dd7e4832..00000000 --- a/qml/components_generic/ListItemClickable.qml +++ /dev/null @@ -1,102 +0,0 @@ -import QtQuick -import QtQuick.Layouts -import QtQuick.Templates as T -import QtQuick.Controls.impl -import QtQuick.Controls.Material -import QtQuick.Controls.Material.impl - -import ThemeEngine - -T.ItemDelegate { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight, - implicitContentHeight + topPadding + bottomPadding) - - padding: Theme.componentMargin - spacing: Theme.componentMargin - verticalPadding: 0 - - property string iconSource - property string iconColor: Theme.colorIcon - property int iconSize: 32 - - property string textColor: Theme.colorText - property int textSize: Theme.fontSizeContent - - property string indicatorSource - property string indicatorColor: Theme.colorIcon - property int indicatorSize: 20 - - //////////////// - - background: Rectangle { - implicitHeight: Theme.componentHeightXL - - color: control.highlighted ? Theme.colorForeground : Theme.colorBackground - - RippleThemed { - width: parent.width - height: parent.height - - clip: visible - anchor: control - pressed: control.pressed - active: enabled && (control.down || control.visualFocus || control.hovered) - color: Qt.rgba(Theme.colorForeground.r, Theme.colorForeground.g, Theme.colorForeground.b, 0.1) - } - } - - //////////////// - - contentItem: RowLayout { - anchors.left: parent.left - anchors.leftMargin: screenPaddingLeft + Theme.componentMargin - anchors.right: parent.right - anchors.rightMargin: screenPaddingRight + Theme.componentMargin - - opacity: control.enabled ? 1 : 0.4 - spacing: 0 - - Item { - Layout.preferredWidth: appHeader.headerPosition - parent.anchors.leftMargin - Layout.preferredHeight: Theme.componentHeightXL - Layout.alignment: Qt.AlignTop - - IconSvg { - anchors.left: parent.left - anchors.leftMargin: (32 - control.iconSize) / 2 - anchors.verticalCenter: parent.verticalCenter - //anchors.verticalCenterOffset: (control.height !== Theme.componentHeightXL) ? -(Theme.componentMargin / 2) : 0 - - width: control.iconSize - height: control.iconSize - color: control.iconColor - source: control.iconSource - } - } - - Text { - Layout.fillWidth: true - Layout.alignment: Qt.AlignVCenter - - text: control.text - color: control.textColor - linkColor: control.iconColor - wrapMode: Text.WordWrap - font.pixelSize: control.textSize - } - - IconSvg { - Layout.preferredWidth: control.indicatorSize - Layout.preferredHeight: control.indicatorSize - Layout.alignment: Qt.AlignVCenter - color: control.indicatorColor - source: control.indicatorSource - } - } - - //////////////// -} diff --git a/qml/components_generic/ListSeparator.qml b/qml/components_generic/ListSeparator.qml deleted file mode 100644 index ba294b5f..00000000 --- a/qml/components_generic/ListSeparator.qml +++ /dev/null @@ -1,10 +0,0 @@ -import QtQuick - -import ThemeEngine - -Rectangle { // separator - anchors.left: parent.left - anchors.right: parent.right - height: 1 - color: Theme.colorSeparator -} diff --git a/qml/components_generic/ListSeparatorPadded.qml b/qml/components_generic/ListSeparatorPadded.qml deleted file mode 100644 index 81c902f7..00000000 --- a/qml/components_generic/ListSeparatorPadded.qml +++ /dev/null @@ -1,17 +0,0 @@ -import QtQuick - -import ThemeEngine - -Item { // padded separator - anchors.left: parent.left - anchors.right: parent.right - height: Theme.componentMargin + 1 - - Rectangle { - anchors.left: parent.left - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - height: 1 - color: Theme.colorSeparator - } -} diff --git a/qml/components_generic/ListTitle.qml b/qml/components_generic/ListTitle.qml deleted file mode 100644 index e1f9170a..00000000 --- a/qml/components_generic/ListTitle.qml +++ /dev/null @@ -1,66 +0,0 @@ -import QtQuick - -import ThemeEngine 1.0 - -Rectangle { - id: control - - anchors.left: parent.left - anchors.leftMargin: singleColumn ? 0 : Theme.componentMargin - anchors.right: parent.right - anchors.rightMargin: singleColumn ? 0 : Theme.componentMargin - - height: Theme.componentHeightL - radius: singleColumn ? 0 : Theme.componentRadius - z: 2 - - color: backgroundColor - border.width: singleColumn ? 0 : Theme.componentBorderWidth - border.color: borderColor - - property string icon - property string iconColor: Theme.colorIcon - property int iconSize: 24 - - property string text: "title" - property string textColor: Theme.colorText - property int textSize: source ? Theme.fontSizeContentBig : - Theme.fontSizeContentVeryBig - - property string backgroundColor: Theme.colorForeground - property string borderColor: Theme.colorSeparator - - //////////////// - - IconSvg { - anchors.left: control.left - anchors.leftMargin: Theme.componentMarginL - anchors.verticalCenter: control.verticalCenter - - width: control.iconSize - height: control.iconSize - - source: control.icon - visible: control.icon - color: control.iconColor - } - - Text { - anchors.left: control.left - anchors.leftMargin: control.icon ? (singleColumn ? appHeader.headerPosition : Theme.componentMarginL*2 + iconSize) - : Theme.componentMarginL - anchors.right: control.right - anchors.rightMargin: Theme.componentMarginL - anchors.verticalCenter: control.verticalCenter - - text: control.text - textFormat: Text.PlainText - font.pixelSize: control.textSize - font.bold: false - color: control.textColor - wrapMode: Text.WordWrap - verticalAlignment: Text.AlignVCenter - } - - //////////////// -} diff --git a/qml/components_generic/MiddleSliderArrow.qml b/qml/components_generic/MiddleSliderArrow.qml deleted file mode 100644 index 2221d9d6..00000000 --- a/qml/components_generic/MiddleSliderArrow.qml +++ /dev/null @@ -1,91 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 - -T.Slider { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitHandleWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitHandleHeight + topPadding + bottomPadding) - - padding: 8 - topPadding: control.horizontal ? 22 : 8 - leftPadding: control.horizontal ? 8 : 22 - - value: 0.5 - snapMode: T.RangeSlider.SnapAlways - - // settings - property int ticksCount: ((to - from) / stepSize) - - // colors - property string colorBg: Theme.colorForeground - property string colorFg: Theme.colorPrimary - property string colorTxt: "white" - - //////////////// - - background: Rectangle { - x: control.leftPadding + (control.horizontal ? 0 : (control.availableWidth - width) / 2) - y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : 0) - implicitWidth: control.horizontal ? 200 : 4 - implicitHeight: control.horizontal ? 4 : 200 - width: control.horizontal ? control.availableWidth : implicitWidth - height: control.horizontal ? implicitHeight : control.availableHeight - - radius: 2 - color: control.colorBg - scale: control.horizontal && control.mirrored ? -1 : 1 - - clip: true - Repeater { - width: control.availableWidth - model: (control.ticksCount - 1) - Rectangle { - x: control.horizontal ? ((control.availableWidth / control.ticksCount) * (index+1)) : 0 - y: control.horizontal ? 0 : ((control.availableHeight / control.ticksCount) * (index+1)) - width: control.horizontal ? 2 : parent.height - height: control.horizontal ? parent.height : 2 - color: Theme.colorComponentBorder - } - } - - Rectangle { - x: control.horizontal ? ((handle.x < control.availableWidth / 2) ? handle.x : control.availableWidth / 2) : 0 - y: control.horizontal ? 0 : ((handle.y < control.availableHeight / 2) ? handle.y : control.availableHeight / 2) - width: control.horizontal ? Math.abs((background.width / 2) - handle.x) : 4 - height: control.horizontal ? 4 : Math.abs((background.height / 2) - handle.y) - - radius: 2 - color: control.colorFg - } - } - - //////////////// - - handle: Rectangle { - x: (control.horizontal ? control.leftPadding + Math.round(control.visualPosition * control.availableWidth) - (width / 2) : -2) - y: (control.horizontal ? 0 : control.topPadding + Math.round(control.visualPosition * control.availableHeight) - (height / 2)) - width: 16 - height: 12 - rotation: control.horizontal ? 0 : -90 - color: control.pressed ? Theme.colorSecondary : Theme.colorPrimary - - Rectangle { - width: 10 - height: 10 - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.bottom - - z: -1 - rotation: 45 - color: parent.color - } - } - - //////////////// -} diff --git a/qml/components_generic/MiddleSliderValueSolid.qml b/qml/components_generic/MiddleSliderValueSolid.qml deleted file mode 100644 index 6c3845fc..00000000 --- a/qml/components_generic/MiddleSliderValueSolid.qml +++ /dev/null @@ -1,92 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 -import "qrc:/js/UtilsNumber.js" as UtilsNumber - -T.Slider { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitHandleWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitHandleHeight + topPadding + bottomPadding) - - padding: 4 - - // settings - property int hhh: 18 - property string unit - property int tofixed: 0 - property bool kshort: false - - // colors - property string colorBg: Theme.colorForeground - property string colorFg: Theme.colorPrimary - property string colorTxt: "white" - - //////////////// - - background: Rectangle { - x: control.leftPadding + (control.horizontal ? 0 : (control.availableWidth - width) / 2) - y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : 0) - implicitWidth: control.horizontal ? 200 : hhh - implicitHeight: control.horizontal ? hhh : 200 - width: control.horizontal ? control.availableWidth : implicitWidth - height: control.horizontal ? implicitHeight : control.availableHeight - - radius: hhh - color: control.colorBg - scale: control.horizontal && control.mirrored ? -1 : 1 - - Rectangle { - x: control.horizontal ? ((control.visualPosition <= 0.5) ? handle.x : control.availableWidth / 2) : 0 - y: !control.horizontal ? ((control.visualPosition <= 0.5) ? handle.y : control.availableHeight / 2) : 0 - width: control.horizontal ? Math.abs((control.width / 2) - handle.x - ((control.visualPosition > 0.5) ? handle.width : 0)) : hhh - height: !control.horizontal ? Math.abs((control.height / 2) - handle.y - ((control.visualPosition > 0.5) ? handle.height : 0)) : hhh - - radius: hhh - color: control.colorFg - } - } - - //////////////// - - handle: Rectangle { - x: control.leftPadding + (control.horizontal ? control.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2) - y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : control.visualPosition * (control.availableHeight - height)) - implicitWidth: hhh - implicitHeight: hhh - - width: control.horizontal ? t1.contentWidth + 16 : hhh - height: hhh - radius: hhh - color: control.colorFg - border.color: control.colorFg - - Text { - id: t1 - width: hhh - height: hhh - anchors.centerIn: parent - - text: { - var vvalue = control.value - if (control.unit === "°" && settingsManager.tempUnit === "F") vvalue = UtilsNumber.tempCelsiusToFahrenheit(vvalue) - vvalue = vvalue.toFixed(0) - return ((control.kshort && control.value > 999) ? (vvalue / 1000) : vvalue) + control.unit - } - textFormat: Text.PlainText - font.bold: true - font.pixelSize: isDesktop ? 12 : 13 - fontSizeMode: Text.Fit - minimumPixelSize: 10 - color: control.colorTxt - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } - } - - //////////////// -} diff --git a/qml/components_generic/MobileMenuItem_horizontal.qml b/qml/components_generic/MobileMenuItem_horizontal.qml deleted file mode 100644 index fa194889..00000000 --- a/qml/components_generic/MobileMenuItem_horizontal.qml +++ /dev/null @@ -1,68 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Layouts 1.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 - -T.Button { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - leftPadding: 12 - rightPadding: 12 - - focusPolicy: Qt.NoFocus - - // icon - property url source - property int sourceSize: 24 - - // colors - property string colorContent: Theme.colorTabletmenuContent - property string colorHighlight: Theme.colorTabletmenuHighlight - - //////////////// - - background: Item {} - - //////////////// - - contentItem: RowLayout { - spacing: isPhone ? 6 : 12 - - IconSvg { // contentImage - width: control.sourceSize - height: control.sourceSize - Layout.maximumWidth: control.sourceSize - Layout.maximumHeight: control.sourceSize - - visible: source.toString().length - - source: control.source - opacity: control.enabled ? 1.0 : 0.33 - color: control.highlighted ? control.colorHighlight : control.colorContent - Behavior on color { ColorAnimation { duration: 133 } } - } - - Text { // contentText - height: control.height - Layout.alignment: Qt.AlignVCenter - - visible: text - - text: control.text - textFormat: Text.PlainText - font.pixelSize: Theme.componentFontSize - font.bold: true - color: control.highlighted ? control.colorHighlight : control.colorContent - Behavior on color { ColorAnimation { duration: 133 } } - } - } - - //////////////// -} diff --git a/qml/components_generic/MobileMenuItem_vertical.qml b/qml/components_generic/MobileMenuItem_vertical.qml deleted file mode 100644 index d3eeb7a3..00000000 --- a/qml/components_generic/MobileMenuItem_vertical.qml +++ /dev/null @@ -1,85 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Layouts 1.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 - -T.Button { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - leftPadding: 0 - rightPadding: 0 - - focusPolicy: Qt.NoFocus - - // icon - property url source - property int sourceSize: 26 - - // colors - property string colorContent: Theme.colorTabletmenuContent - property string colorHighlight: Theme.colorTabletmenuHighlight - - //////////////// - - background: Item { - implicitWidth: Theme.componentHeight - implicitHeight: Theme.componentHeight - } - - //////////////// - - contentItem: ColumnLayout { - spacing: -2 - - IconSvg { // contentImage - Layout.preferredWidth: control.sourceSize - Layout.preferredHeight: control.sourceSize - Layout.alignment: Qt.AlignHCenter - - visible: source.toString().length - - source: control.source - opacity: control.enabled ? 1.0 : 0.33 - color: control.highlighted ? control.colorHighlight : control.colorContent - Behavior on color { ColorAnimation { duration: 233 } } - - Rectangle { // backgroundIndicator - anchors.centerIn: parent - z: -1 - - width: 60 - height: 32 - radius: height - color: control.colorHighlight - - opacity: control.highlighted ? 0.2 : 0 - Behavior on opacity { OpacityAnimator { duration: 233 } } - } - } - - Text { // contentText - Layout.preferredWidth: control.width - Layout.alignment: Qt.AlignHCenter - - visible: text - - text: control.text - textFormat: Text.PlainText - horizontalAlignment: Text.AlignHCenter - font.pixelSize: Theme.fontSizeContentVerySmall - font.bold: true - - color: control.highlighted ? control.colorHighlight : control.colorContent - Behavior on color { ColorAnimation { duration: 233 } } - } - } - - //////////////// -} diff --git a/qml/components_generic/ProgressArc.qml b/qml/components_generic/ProgressArc.qml deleted file mode 100644 index 11ccf649..00000000 --- a/qml/components_generic/ProgressArc.qml +++ /dev/null @@ -1,107 +0,0 @@ -import QtQuick 2.15 - -import ThemeEngine 1.0 - -// Based on the ProgressCircle component from ByteBau (Jörn Buchholz) @bytebau.com - -Item { - id: control - width: 256 - height: width - - property real from: 0 - property real to: 1 - property real value: 0.5 - - property real arcOffset: 0 // rotation (0 means starts at bottom center) - property real arcSpan: 270 // arc span (in degree) - property real arcWidth: 16 // width of the arc (in pixel) - property real arcOpacity: 1 - property string arcColor: Theme.colorPrimary - property string arcCap: "butt" // butt, round or square - - property bool background: true // draw a background arc (full arc span) - property real backgroundOpacity: 1 - property string backgroundColor: Theme.colorForeground - - property alias animation: animationArcValue.enabled - property int animationDuration: 333 - - // private - property real arcBegin: ((360 - arcSpan) / 2) - property real arcEnd: (360 - arcBegin) - property real arcValue: mapNumber(value, from, to, arcBegin, arcEnd) - - function mapNumber(n, srcMin, srcMax, dstMin, dstMax) { - if (n < srcMin) n = srcMin - if (n > srcMax) n = srcMax - return (dstMin + ((n - srcMin) * (dstMax - dstMin)) / (srcMax - srcMin)) - } - - //////////////////////////////////////////////////////////////////////////// - - //onFromChanged: canvas.requestPaint() - //onToChanged: canvas.requestPaint() - //onValueChanged: canvas.requestPaint() - onArcValueChanged: canvas.requestPaint() - - onArcSpanChanged: canvas.requestPaint() - onArcWidthChanged: canvas.requestPaint() - onArcColorChanged: canvas.requestPaint() - onArcOpacityChanged: canvas.requestPaint() - - onBackgroundChanged: canvas.requestPaint() - onBackgroundColorChanged: canvas.requestPaint() - onBackgroundOpacityChanged: canvas.requestPaint() - - Connections { - target: ThemeEngine - function onCurrentThemeChanged() { canvas.requestPaint() } - } - - Behavior on arcValue { - id: animationArcValue - enabled: true - NumberAnimation { - duration: control.animationDuration - easing.type: Easing.InOutCubic - } - } - - //////////////////////////////////////////////////////////////////////////// - - Canvas { - id: canvas - anchors.fill: parent - - onPaint: { - var ctx = getContext("2d") - var x = (width / 2) - var y = (width / 2) - var start = Math.PI * ((control.arcBegin + control.arcOffset + 90) / 180) - var end = Math.PI * ((control.arcEnd + control.arcOffset + 90) / 180) - var end_value = Math.PI * ((control.arcValue + control.arcOffset + 90) / 180) - - ctx.reset() - ctx.lineCap = control.arcCap - - // draw - if (control.background) { - ctx.beginPath() - ctx.globalAlpha = control.backgroundOpacity - ctx.arc(x, y, (width / 2) - (control.arcWidth / 2), start, end, false) - ctx.lineWidth = control.arcWidth - ctx.strokeStyle = control.backgroundColor - ctx.stroke() - } - ctx.beginPath() - ctx.globalAlpha = control.arcOpacity - ctx.arc(x, y, (width / 2) - (control.arcWidth / 2), start, end_value, false) - ctx.lineWidth = control.arcWidth - ctx.strokeStyle = control.arcColor - ctx.stroke() - } - } - - //////////////////////////////////////////////////////////////////////////// -} diff --git a/qml/components_generic/ProgressCircle.qml b/qml/components_generic/ProgressCircle.qml deleted file mode 100644 index 9177b081..00000000 --- a/qml/components_generic/ProgressCircle.qml +++ /dev/null @@ -1,145 +0,0 @@ -import QtQuick 2.15 - -import ThemeEngine 1.0 - -// Based on the ProgressCircle component from ByteBau (Jörn Buchholz) @bytebau.com - -Item { - id: control - width: 256 - height: width - - property real from: 0 - property real to: 1 - property real value: 0.5 - - property bool isPie: false // paint a pie instead of an arc - - property real arcOffset: 0 // rotation (0 means starts at top center) - property real arcWidth: 16 // width of the arc - property real arcOpacity: 1 - property string arcColor: Theme.colorPrimary - - property bool background: true // a full circle as a background of the arc - property real backgroundOpacity: 1 - property string backgroundColor: Theme.colorForeground - - property alias animationBegin: animationArcBegin.enabled - property alias animationEnd: animationArcEnd.enabled - property alias animationValue: animationArcValue.enabled - property int animationDuration: 333 - - // private - property real arcBegin: 0 - property real arcEnd: 360 - property real arcValue: mapNumber(value, from, to, arcBegin, arcEnd) - - function mapNumber(n, srcMin, srcMax, dstMin, dstMax) { - if (n < srcMin) n = srcMin - if (n > srcMax) n = srcMax - return (dstMin + ((n - srcMin) * (dstMax - dstMin)) / (srcMax - srcMin)) - } - - //////////////////////////////////////////////////////////////////////////// - - //onFromChanged: canvas.requestPaint() - //onToChanged: canvas.requestPaint() - //onValueChanged: canvas.requestPaint() - - onIsPieChanged: canvas.requestPaint() - - onArcBeginChanged: canvas.requestPaint() - onArcEndChanged: canvas.requestPaint() - onArcValueChanged: canvas.requestPaint() - onArcWidthChanged: canvas.requestPaint() - onArcColorChanged: canvas.requestPaint() - onArcOpacityChanged: canvas.requestPaint() - - onBackgroundChanged: canvas.requestPaint() - onBackgroundColorChanged: canvas.requestPaint() - onBackgroundOpacityChanged: canvas.requestPaint() - - Connections { - target: ThemeEngine - function onCurrentThemeChanged() { canvas.requestPaint() } - } - - Behavior on arcBegin { - id: animationArcBegin - enabled: true - NumberAnimation { - duration: control.animationDuration - easing.type: Easing.InOutCubic - } - } - - Behavior on arcEnd { - id: animationArcEnd - enabled: true - NumberAnimation { - duration: control.animationDuration - easing.type: Easing.InOutCubic - } - } - - Behavior on arcValue { - id: animationArcValue - enabled: true - NumberAnimation { - duration: control.animationDuration - easing.type: Easing.InOutCubic - } - } - - //////////////////////////////////////////////////////////////////////////// - - Canvas { - id: canvas - anchors.fill: parent - - onPaint: { - var ctx = getContext("2d") - var x = (width / 2) - var y = (height / 2) - var start = Math.PI * ((control.arcBegin + control.arcOffset - 90) / 180) - var end = Math.PI * ((control.arcEnd + control.arcOffset - 90) / 180) - var end_value = Math.PI * ((control.arcValue + control.arcOffset - 90) / 180) - ctx.reset() - - // draw - if (control.isPie) { - if (control.background) { - ctx.beginPath() - ctx.globalAlpha = control.backgroundOpacity - ctx.fillStyle = control.backgroundColor - ctx.moveTo(x, y) - ctx.arc(x, y, (width / 2), start, end, false) - ctx.lineTo(x, y) - ctx.fill() - } - ctx.beginPath() - ctx.globalAlpha = control.arcOpacity - ctx.fillStyle = control.arcColor - ctx.moveTo(x, y) - ctx.arc(x, y, (width / 2), start, end_value, false) - ctx.lineTo(x, y) - ctx.fill() - } else { - if (control.background) { - ctx.beginPath() - ctx.globalAlpha = control.backgroundOpacity - ctx.arc(x, y, (width / 2) - (control.arcWidth / 2), start, end, false) - ctx.lineWidth = control.arcWidth - ctx.strokeStyle = control.backgroundColor - ctx.stroke() - } - ctx.beginPath() - ctx.globalAlpha = control.arcOpacity - ctx.arc(x, y, (width / 2) - (control.arcWidth / 2), start, end_value, false) - ctx.lineWidth = control.arcWidth - ctx.strokeStyle = control.arcColor - ctx.stroke() - } - } - } -} diff --git a/qml/components_generic/RangeSliderArrow.qml b/qml/components_generic/RangeSliderArrow.qml deleted file mode 100644 index e99ad300..00000000 --- a/qml/components_generic/RangeSliderArrow.qml +++ /dev/null @@ -1,116 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 - -T.RangeSlider { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - first.implicitHandleWidth + leftPadding + rightPadding, - second.implicitHandleWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - first.implicitHandleHeight + topPadding + bottomPadding, - second.implicitHandleHeight + topPadding + bottomPadding) - - padding: 8 - topPadding: control.horizontal ? 22 : 8 - leftPadding: control.horizontal ? 8 : 22 - - first.value: 0.25 - second.value: 0.75 - snapMode: T.RangeSlider.SnapAlways - - // settings - property int ticksCount: ((to - from) / stepSize) - - // colors - property string colorBg: Theme.colorForeground - property string colorFg: Theme.colorPrimary - property string colorTxt: "white" - - //////////////// - - background: Rectangle { - x: control.leftPadding + (control.horizontal ? 0 : (control.availableWidth - width) / 2) - y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : 0) - implicitWidth: control.horizontal ? 200 : 4 - implicitHeight: control.horizontal ? 4 : 200 - width: control.horizontal ? control.availableWidth : implicitWidth - height: control.horizontal ? implicitHeight : control.availableHeight - - radius: 2 - color: control.colorBg - scale: control.horizontal && control.mirrored ? -1 : 1 - - clip: true - Repeater { - width: control.availableWidth - model: (control.ticksCount - 1) - Rectangle { - x: control.horizontal ? ((control.availableWidth / control.ticksCount) * (index+1)) : 0 - y: control.horizontal ? 0 : ((control.availableHeight / control.ticksCount) * (index+1)) - width: control.horizontal ? 2 : parent.height - height: control.horizontal ? parent.height : 2 - color: Theme.colorComponentBorder - } - } - - Rectangle { - x: control.horizontal ? control.first.visualPosition * control.availableWidth : 0 - y: control.horizontal ? 0 : control.second.visualPosition * control.availableHeight - width: control.horizontal ? control.second.visualPosition * control.availableWidth - control.first.visualPosition * control.availableWidth : 4 - height: control.horizontal ? 4 : control.second.position * parent.height - control.first.position * parent.height - - radius: 2 - color: control.colorFg - } - } - - //////////////// - - first.handle: Rectangle { - x: (control.horizontal ? control.leftPadding + Math.round(first.visualPosition * control.availableWidth) - (width / 2) : -2) - y: (control.horizontal ? 0 : control.topPadding + Math.round(first.visualPosition * control.availableHeight) - (height / 2)) - width: 16 - height: 12 - rotation: control.horizontal ? 0 : -90 - color: first.pressed ? Theme.colorSecondary : Theme.colorPrimary - - Rectangle { - width: 10 - height: 10 - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.bottom - - z: -1 - rotation: 45 - color: parent.color - } - } - - //////////////// - - second.handle: Rectangle { - x: (control.horizontal ? control.leftPadding + Math.round(second.visualPosition * control.availableWidth) - (width / 2) : -2) - y: (control.horizontal ? 0 : control.topPadding + Math.round(second.visualPosition * control.availableHeight) - (height / 2)) - width: 16 - height: 12 - rotation: control.horizontal ? 0 : -90 - color: second.pressed ? Theme.colorSecondary : Theme.colorPrimary - - Rectangle { - width: 10 - height: 10 - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.bottom - - z: -1 - rotation: 45 - color: parent.color - } - } - - //////////////// -} diff --git a/qml/components_generic/RangeSliderValue.qml b/qml/components_generic/RangeSliderValue.qml deleted file mode 100644 index addb0677..00000000 --- a/qml/components_generic/RangeSliderValue.qml +++ /dev/null @@ -1,113 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 -import "qrc:/js/UtilsNumber.js" as UtilsNumber - -T.RangeSlider { - id: control - implicitWidth: 200 - implicitHeight: 4 - - padding: 4 - - first.value: 0.25 - second.value: 0.75 - snapMode: RangeSlider.SnapAlways - - // settings - property string unit - - // colors - property string colorBg: Theme.colorComponent - property string colorFg: Theme.colorPrimary - property string colorTxt: "white" - - //////////////////////////////////////////////////////////////////////////// - - background: Rectangle { - x: control.leftPadding - y: control.topPadding + (control.availableHeight / 2) - (height / 2) - width: control.availableWidth - - height: implicitHeight - radius: 2 - color: colorBg - opacity: 0.9 - - Rectangle { - x: (control.first.visualPosition * parent.width) - width: (control.second.visualPosition * parent.width) - x - height: parent.height - color: colorFg - radius: 2 - } - } - - //////////////////////////////////////////////////////////////////////////// - - first.handle: Rectangle { - x: control.leftPadding + first.visualPosition * (control.availableWidth - width) - y: control.topPadding + (control.availableHeight / 2) - (height / 2) - implicitWidth: 22 - implicitHeight: 22 - width: t1.width + 16 - - radius: 6 - color: colorFg - border.color: colorFg - opacity: first.pressed ? 0.9 : 1 - - Text { - id: t1 - anchors.verticalCenter: parent.verticalCenter - anchors.verticalCenterOffset: 1 - anchors.horizontalCenter: parent.horizontalCenter - - text: { - var vvalue = first.value - if (unit === "°" && settingsManager.tempUnit === "F") vvalue = UtilsNumber.tempCelsiusToFahrenheit(vvalue) - vvalue = vvalue.toFixed(0) - return ((first.value > 999) ? vvalue / 1000 : vvalue) + unit - } - textFormat: Text.PlainText - font.pixelSize: 14 - color: colorTxt - } - } - - //////////////////////////////////////////////////////////////////////////// - - second.handle: Rectangle { - x: control.leftPadding + second.visualPosition * (control.availableWidth - width) - y: control.topPadding + (control.availableHeight / 2) - (height / 2) - implicitWidth: 22 - implicitHeight: 22 - width: t2.width + 16 - - radius: 6 - color: colorFg - border.color: colorFg - opacity: second.pressed ? 0.9 : 1 - - Text { - id: t2 - anchors.verticalCenter: parent.verticalCenter - anchors.verticalCenterOffset: 1 - anchors.horizontalCenter: parent.horizontalCenter - - text: { - var vvalue = second.value - if (unit === "°" && settingsManager.tempUnit === "F") vvalue = UtilsNumber.tempCelsiusToFahrenheit(vvalue) - vvalue = vvalue.toFixed(0) - return ((second.value > 999) ? vvalue / 1000 : vvalue) + unit - } - textFormat: Text.PlainText - font.pixelSize: 14 - color: colorTxt - } - } - - //////////////////////////////////////////////////////////////////////////// -} diff --git a/qml/components_generic/RangeSliderValueSolid.qml b/qml/components_generic/RangeSliderValueSolid.qml deleted file mode 100644 index 25163ce6..00000000 --- a/qml/components_generic/RangeSliderValueSolid.qml +++ /dev/null @@ -1,129 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 -import "qrc:/js/UtilsNumber.js" as UtilsNumber - -T.RangeSlider { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - first.implicitHandleWidth + leftPadding + rightPadding, - second.implicitHandleWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - first.implicitHandleHeight + topPadding + bottomPadding, - second.implicitHandleHeight + topPadding + bottomPadding) - - padding: 4 - - // settings - property int hhh: 18 - property string unit - property int tofixed: 0 - property bool kshort: false - - // colors - property string colorBg: Theme.colorForeground - property string colorFg: Theme.colorPrimary - property string colorTxt: "white" - - //////////////// - - background: Rectangle { - x: control.leftPadding + (control.horizontal ? 0 : (control.availableWidth - width) / 2) - y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : 0) - implicitWidth: control.horizontal ? 200 : hhh - implicitHeight: control.horizontal ? hhh : 200 - width: control.horizontal ? control.availableWidth : implicitWidth - height: control.horizontal ? implicitHeight : control.availableHeight - - radius: hhh - color: control.colorBg - scale: control.horizontal && control.mirrored ? -1 : 1 - - Rectangle { - x: control.horizontal ? control.first.handle.x : 0 - y: control.horizontal ? 0 : control.second.handle.y - width: control.horizontal ? control.second.handle.x - control.first.handle.x + control.second.handle.width*0.66 : hhh - height: control.horizontal ? hhh : control.first.handle.y - control.second.handle.y + control.second.handle.height*0.66 - - radius: hhh - color: control.colorFg - } - } - - //////////////// - - first.handle: Rectangle { - x: control.leftPadding + (control.horizontal ? control.first.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2) - y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : control.first.visualPosition * (control.availableHeight - height)) - implicitWidth: hhh - implicitHeight: hhh - - width: control.horizontal ? t1.contentWidth + 16 : hhh - height: hhh - radius: hhh - color: control.colorFg - border.color: control.colorFg - - Text { - id: t1 - height: hhh - anchors.centerIn: parent - - text: { - var vvalue = first.value - if (control.unit === "°" && settingsManager.tempUnit === "F") vvalue = UtilsNumber.tempCelsiusToFahrenheit(vvalue) - vvalue = vvalue.toFixed(control.tofixed) - return ((control.kshort && first.value > 999) ? (vvalue / 1000) : vvalue) + control.unit - } - textFormat: Text.PlainText - font.bold: true - font.pixelSize: isDesktop ? 12 : 13 - fontSizeMode: Text.Fit - minimumPixelSize: 10 - color: control.colorTxt - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } - } - - //////////////// - - second.handle: Rectangle { - x: control.leftPadding + (control.horizontal ? control.second.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2) - y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : control.second.visualPosition * (control.availableHeight - height)) - implicitWidth: hhh - implicitHeight: hhh - - width: control.horizontal ? t2.contentWidth + 16 : hhh - height: hhh - radius: hhh - color: control.colorFg - border.color: control.colorFg - - Text { - id: t2 - height: hhh - anchors.centerIn: parent - - text: { - var vvalue = second.value - if (control.unit === "°" && settingsManager.tempUnit === "F") vvalue = UtilsNumber.tempCelsiusToFahrenheit(vvalue) - vvalue = vvalue.toFixed(control.tofixed) - return ((control.kshort && second.value > 999) ? (vvalue / 1000) : vvalue) + control.unit - } - textFormat: Text.PlainText - font.bold: true - font.pixelSize: isDesktop ? 12 : 13 - fontSizeMode: Text.Fit - minimumPixelSize: 10 - color: control.colorTxt - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } - } - - //////////////// -} diff --git a/qml/components_generic/RoundButtonIcon.qml b/qml/components_generic/RoundButtonIcon.qml deleted file mode 100644 index d8f33fd9..00000000 --- a/qml/components_generic/RoundButtonIcon.qml +++ /dev/null @@ -1,132 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 -import "qrc:/js/UtilsNumber.js" as UtilsNumber - -T.Button { - id: control - - implicitWidth: Theme.componentHeight - implicitHeight: Theme.componentHeight - - focusPolicy: Qt.NoFocus - - property url source - property int sourceSize: UtilsNumber.alignTo(height * 0.666, 2) - property int sourceRotation: 0 - - // settings - property bool borderVisible: false - property bool backgroundVisible: false - property string highlightMode: "circle" // available: border, circle, color, both (circle+color), off - - // colors - property string iconColor: Theme.colorIcon - property string highlightColor: Theme.colorPrimary - property string borderColor: Theme.colorComponentBorder - property string backgroundColor: Theme.colorComponent - - // animation - property string animation // available: rotate, fade - property bool animationRunning: false - - // tooltip - property string tooltipText - property string tooltipPosition: "bottom" - - //////////////// - - background: Rectangle { - implicitWidth: Theme.componentHeight - implicitHeight: Theme.componentHeight - radius: Theme.componentHeight - - visible: (control.highlightMode === "circle" || control.highlightMode === "both" || control.backgroundVisible) - color: control.backgroundColor - - opacity: { - if (control.hovered) { - return (control.highlightMode === "circle" || - control.highlightMode === "both" || - control.backgroundVisible) ? 1 : 0.75 - } else if (control.highlightMode === "off") { - return control.backgroundVisible ? 1 : 0 - } else { - return control.backgroundVisible ? 0.75 : 0 - } - } - Behavior on opacity { NumberAnimation { duration: 333 } } - - Rectangle { // border - anchors.fill: parent - radius: width - - visible: control.borderVisible - color: "transparent" - border.width: Theme.componentBorderWidth - border.color: control.borderColor - } - } - - //////////////// - - contentItem: Item { - IconSvg { - anchors.centerIn: parent - - width: control.sourceSize - height: control.sourceSize - - rotation: control.sourceRotation - opacity: control.enabled ? 1.0 : 0.33 - Behavior on opacity { NumberAnimation { duration: 333 } } - - source: control.source - color: { - if ((control.highlighted || control.hovered || control.pressed) && - (control.highlightMode === "color" || control.highlightMode === "both")) { - return control.highlightColor - } - return control.iconColor - } - - SequentialAnimation on opacity { - running: (control.animation === "fade" && control.animationRunning) - alwaysRunToEnd: true - loops: Animation.Infinite - - PropertyAnimation { to: 0.33; duration: 750; } - PropertyAnimation { to: 1; duration: 750; } - } - NumberAnimation on rotation { - running: (control.animation === "rotate" && control.animationRunning) - alwaysRunToEnd: true - loops: Animation.Infinite - - duration: 1500 - from: 0 - to: 360 - easing.type: Easing.Linear - } - } - } - - //////////////// - - Loader { - anchors.fill: control - active: control.tooltipText - - sourceComponent: ToolTipFlat { - visible: control.hovered - text: control.tooltipText - textColor: control.iconColor - tooltipPosition: control.tooltipPosition - backgroundColor: control.backgroundColor - } - } - - //////////////// -} diff --git a/qml/components_generic/RoundButtonText.qml b/qml/components_generic/RoundButtonText.qml deleted file mode 100644 index b1b00c23..00000000 --- a/qml/components_generic/RoundButtonText.qml +++ /dev/null @@ -1,103 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 -import "qrc:/js/UtilsNumber.js" as UtilsNumber - -T.Button { - id: control - - implicitWidth: Theme.componentHeight - implicitHeight: Theme.componentHeight - - focusPolicy: Qt.NoFocus - - property int textSize: Math.round(width * 0.333) - - // settings - property bool borderVisible: false - property bool backgroundVisible: false - property string highlightMode: "circle" // available: border, circle, color, both (circle+color), off - - // colors - property string textColor: Theme.colorText - property string highlightColor: Theme.colorPrimary - property string borderColor: Theme.colorComponentBorder - property string backgroundColor: Theme.colorComponent - - // tooltip - property string tooltipText - property string tooltipPosition: "bottom" - - //////////////// - - background: Rectangle { - implicitWidth: Theme.componentHeight - implicitHeight: Theme.componentHeight - radius: Theme.componentHeight - - visible: (control.highlightMode === "circle" || control.highlightMode === "both" || control.backgroundVisible) - color: control.backgroundColor - - opacity: { - if (control.hovered) { - return (control.highlightMode === "circle" || control.highlightMode === "both" || control.backgroundVisible) ? 1 : 0.75 - } else { - return control.backgroundVisible ? 0.75 : 0 - } - } - Behavior on opacity { NumberAnimation { duration: 333 } } - - Rectangle { // border - anchors.fill: parent - radius: width - - visible: control.borderVisible - color: "transparent" - border.width: Theme.componentBorderWidth - border.color: control.borderColor - } - } - - //////////////// - - contentItem: Text { - text: control.text - textFormat: Text.PlainText - elide: Text.ElideMiddle - font.bold: true - font.pixelSize: control.textSize - font.capitalization: Font.Normal - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - - color: { - if ((control.highlighted || control.hovered || control.pressed) && - (control.highlightMode === "color" || control.highlightMode === "both")) { - return control.highlightColor - } - return control.textColor - } - - opacity: control.enabled ? 1.0 : 0.33 - Behavior on opacity { NumberAnimation { duration: 333 } } - } - - //////////////// - - Loader { - anchors.fill: control - active: control.tooltipText - - sourceComponent: ToolTipFlat { - visible: control.hovered - text: control.tooltipText - textColor: control.textColor - tooltipPosition: control.tooltipPosition - backgroundColor: control.backgroundColor - } - } - - //////////////// -} diff --git a/qml/components_generic/SectionTitle.qml b/qml/components_generic/SectionTitle.qml deleted file mode 100644 index e32a7e35..00000000 --- a/qml/components_generic/SectionTitle.qml +++ /dev/null @@ -1,62 +0,0 @@ -import QtQuick -import QtQuick.Controls - -import ThemeEngine 1.0 - -Rectangle { - id: control - - implicitWidth: 512 - implicitHeight: Theme.componentHeightL - - radius: singleColumn ? 0 : Theme.componentRadius - z: 2 - - color: control.backgroundColor - border.width: singleColumn ? 0 : Theme.componentBorderWidth - border.color: control.borderColor - - property string text: "title" - property string source - - // font - property int fontSize: source ? Theme.fontSizeContentBig : - Theme.fontSizeContentVeryBig - - // colors - property string backgroundColor: Theme.colorForeground - property string borderColor: Theme.colorSeparator - - //////////////////////////////////////////////////////////////////////////// - - Row { - anchors.left: parent.left - anchors.leftMargin: 16 - anchors.verticalCenter: parent.verticalCenter - spacing: singleColumn ? 24 : 16 - - IconSvg { - width: 24 - height: 24 - anchors.verticalCenter: parent.verticalCenter - - source: control.source - visible: control.source - color: Theme.colorIcon - } - - Text { - anchors.verticalCenter: parent.verticalCenter - - text: control.text - textFormat: Text.PlainText - font.pixelSize: control.fontSize - font.bold: false - color: Theme.colorText - wrapMode: Text.WordWrap - verticalAlignment: Text.AlignVCenter - } - } - - //////////////////////////////////////////////////////////////////////////// -} diff --git a/qml/components_generic/SelectorMenu.qml b/qml/components_generic/SelectorMenu.qml deleted file mode 100644 index a7662407..00000000 --- a/qml/components_generic/SelectorMenu.qml +++ /dev/null @@ -1,56 +0,0 @@ -import QtQuick 2.15 - -import ThemeEngine 1.0 - -Item { - id: selectorMenu - implicitWidth: 128 - implicitHeight: 32 - - width: contentRow.width - opacity: enabled ? 1 : 0.4 - - property var model: null - - // colors - property string colorBackground: Theme.colorComponentBackground - - // states - property int currentSelection: 1 - signal menuSelected(var index) - - //////////////// - - Rectangle { // background - anchors.fill: parent - - radius: height - color: selectorMenu.colorBackground - - border.width: 2 - border.color: Theme.colorComponentDown - } - - //////////////// - - Row { - id: contentRow - height: parent.height - spacing: -4 - - Repeater { - model: selectorMenu.model - delegate: SelectorMenuItem { - height: parent.height - highlighted: (selectorMenu.currentSelection === idx) - index: idx ?? 0 - text: txt ?? "" - source: src ?? "" - sourceSize: sz ?? 32 - onClicked: selectorMenu.menuSelected(idx) - } - } - } - - //////////////// -} diff --git a/qml/components_generic/SelectorMenuItem.qml b/qml/components_generic/SelectorMenuItem.qml deleted file mode 100644 index 4e4f3b92..00000000 --- a/qml/components_generic/SelectorMenuItem.qml +++ /dev/null @@ -1,78 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 - -T.Button { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - leftPadding: 16 - rightPadding: 16 - - focusPolicy: Qt.NoFocus - - // settings - property int index - property url source - property int sourceSize: 32 - - // colors - property string colorContent: Theme.colorComponentText - property string colorContentHighlight: "white" - property string colorBackgroundHighlight: Theme.colorPrimary - - //////////////// - - background: Rectangle { - implicitWidth: 32 - implicitHeight: 32 - radius: height - - color: control.colorBackgroundHighlight - opacity: { - if (control.highlighted) return 1 - else if (control.hovered) return 0.2 - return 0 - } - Behavior on opacity { OpacityAnimator { duration: 133 } } - } - - //////////////// - - contentItem: Row { - spacing: 4 - - IconSvg { // contentImage - anchors.verticalCenter: parent.verticalCenter - visible: control.source.toString().length - - width: control.sourceSize - height: control.sourceSize - - source: control.source - color: control.highlighted ? control.colorContentHighlight : control.colorContent - opacity: control.highlighted ? 1 : 0.66 - } - - Text { // contentText - anchors.verticalCenter: parent.verticalCenter - visible: control.text - - text: control.text - textFormat: Text.PlainText - font: control.font - verticalAlignment: Text.AlignVCenter - - color: control.highlighted ? control.colorContentHighlight : control.colorContent - opacity: control.highlighted ? 1 : 0.66 - } - } - - //////////////// -} diff --git a/qml/components_generic/SimpleShadow5.qml b/qml/components_generic/SimpleShadow5.qml deleted file mode 100644 index 400a17b3..00000000 --- a/qml/components_generic/SimpleShadow5.qml +++ /dev/null @@ -1,33 +0,0 @@ -import QtQuick 2.15 -import QtGraphicalEffects 1.15 - -Item { - anchors.fill: parent - z: -1 - - property string color: "#666" - property alias radius: shadowarea.radius - property bool filled: true - - Rectangle { - id: shadowarea - anchors.fill: parent - - visible: false - color: parent.filled ? parent.color : "transparent" - - border.width: parent.filled ? 0 : 4 - border.color: parent.color - } - DropShadow { - anchors.fill: parent - - source: shadowarea - cached: true - radius: 16.0 - samples: (radius*2 + 1) - color: parent.color - horizontalOffset: 0 - verticalOffset: 0 - } -} diff --git a/qml/components_generic/SimpleShadow6.qml b/qml/components_generic/SimpleShadow6.qml deleted file mode 100644 index e8157d04..00000000 --- a/qml/components_generic/SimpleShadow6.qml +++ /dev/null @@ -1,34 +0,0 @@ -import QtQuick -import Qt5Compat.GraphicalEffects - -Item { - anchors.fill: parent - z: -1 - - property string color: "#666" - property alias radius: shadowarea.radius - property bool filled: true - - Rectangle { - id: shadowarea - anchors.fill: parent - - visible: false - color: parent.filled ? parent.color : "transparent" - - border.width: parent.filled ? 0 : 4 - border.color: parent.color - } - DropShadow { - anchors.fill: parent - - source: shadowarea - cached: true - radius: 16.0 - //spread: 24 - //samples: 25 // (radius*2 + 1) - color: parent.color - horizontalOffset: 0 - verticalOffset: 0 - } -} diff --git a/qml/components_generic/SliderArrow.qml b/qml/components_generic/SliderArrow.qml deleted file mode 100644 index 9c60fd0a..00000000 --- a/qml/components_generic/SliderArrow.qml +++ /dev/null @@ -1,91 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 - -T.Slider { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitHandleWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitHandleWidth + topPadding + bottomPadding) - - padding: 8 - topPadding: control.horizontal ? 22 : 8 - leftPadding: control.horizontal ? 8 : 22 - - value: 0.5 - snapMode: T.RangeSlider.SnapAlways - - // settings - property int ticksCount: ((to - from) / stepSize) - - // colors - property string colorBg: Theme.colorForeground - property string colorFg: Theme.colorPrimary - property string colorTxt: "white" - - //////////////// - - background: Rectangle { - x: control.leftPadding + (control.horizontal ? 0 : (control.availableWidth - width) / 2) - y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : 0) - implicitWidth: control.horizontal ? 200 : 4 - implicitHeight: control.horizontal ? 4 : 200 - width: control.horizontal ? control.availableWidth : implicitWidth - height: control.horizontal ? implicitHeight : control.availableHeight - - radius: 2 - color: control.colorBg - scale: control.horizontal && control.mirrored ? -1 : 1 - - clip: true - Repeater { - width: control.availableWidth - model: (control.ticksCount - 1) - Rectangle { - x: control.horizontal ? ((control.availableWidth / control.ticksCount) * (index+1)) : 0 - y: control.horizontal ? 0 : ((control.availableHeight / control.ticksCount) * (index+1)) - width: control.horizontal ? 2 : parent.height - height: control.horizontal ? parent.height : 2 - color: Theme.colorComponentBorder - } - } - - Rectangle { - x: control.horizontal ? 0 : 0 - y: control.horizontal ? 0 : control.visualPosition * parent.height - width: control.horizontal ? control.position * parent.width : 4 - height: control.horizontal ? 4 : control.position * parent.height - - radius: 2 - color: control.colorFg - } - } - - //////////////// - - handle: Rectangle { - x: (control.horizontal ? control.leftPadding + Math.round(control.visualPosition * control.availableWidth) - (width / 2) : -2) - y: (control.horizontal ? 0 : control.topPadding + Math.round(control.visualPosition * control.availableHeight) - (height / 2)) - width: 16 - height: 12 - rotation: control.horizontal ? 0 : -90 - color: control.pressed ? Theme.colorSecondary : Theme.colorPrimary - - Rectangle { - width: 10 - height: 10 - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.bottom - - z: -1 - rotation: 45 - color: parent.color - } - } - - //////////////// -} diff --git a/qml/components_generic/SliderValueSolid.qml b/qml/components_generic/SliderValueSolid.qml deleted file mode 100644 index 13ea504a..00000000 --- a/qml/components_generic/SliderValueSolid.qml +++ /dev/null @@ -1,91 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 -import "qrc:/js/UtilsNumber.js" as UtilsNumber - -T.Slider { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitHandleWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitHandleHeight + topPadding + bottomPadding) - - padding: 4 - - // settings - property int hhh: 18 - property string unit - property int tofixed: 0 - property bool kshort: false - - // colors - property string colorBg: Theme.colorForeground - property string colorFg: Theme.colorPrimary - property string colorTxt: "white" - - //////////////// - - background: Rectangle { - x: control.leftPadding + (control.horizontal ? 0 : (control.availableWidth - width) / 2) - y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : 0) - implicitWidth: control.horizontal ? 200 : hhh - implicitHeight: control.horizontal ? hhh : 200 - width: control.horizontal ? control.availableWidth : implicitWidth - height: control.horizontal ? implicitHeight : control.availableHeight - - radius: hhh - color: control.colorBg - scale: control.horizontal && control.mirrored ? -1 : 1 - - Rectangle { - y: control.horizontal ? 0 : handle.y - width: control.horizontal ? Math.max(control.position * parent.width, handle.x + handle.width/2) : hhh - height: control.horizontal ? hhh : parent.height - handle.y - - radius: hhh - color: control.colorFg - } - } - - //////////////// - - handle: Rectangle { - x: control.leftPadding + (control.horizontal ? control.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2) - y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : control.visualPosition * (control.availableHeight - height)) - implicitWidth: hhh - implicitHeight: hhh - - width: control.horizontal ? t1.contentWidth + 16 : hhh - height: hhh - radius: hhh - color: control.colorFg - border.color: control.colorFg - - Text { - id: t1 - width: hhh - height: hhh - anchors.centerIn: parent - - text: { - var vvalue = control.value - if (control.unit === "°" && settingsManager.tempUnit === "F") vvalue = UtilsNumber.tempCelsiusToFahrenheit(vvalue) - vvalue = vvalue.toFixed(0) - return ((control.kshort && control.value > 999) ? (vvalue / 1000) : vvalue) + control.unit - } - textFormat: Text.PlainText - font.bold: true - font.pixelSize: isDesktop ? 12 : 13 - fontSizeMode: Text.Fit - minimumPixelSize: 10 - color: control.colorTxt - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } - } - - //////////////// -} diff --git a/qml/components_generic/SwipeArea.qml b/qml/components_generic/SwipeArea.qml deleted file mode 100644 index a4b8600e..00000000 --- a/qml/components_generic/SwipeArea.qml +++ /dev/null @@ -1,55 +0,0 @@ -import QtQuick 2.15 - -MouseArea { - preventStealing: false - propagateComposedEvents: false - - property real prevX: 0 - property real prevY: 0 - property real velocityX: 0.0 - property real velocityY: 0.0 - property int startX: 0 - property int startY: 0 - property bool tracing: false - - signal swipeLeft() - signal swipeRight() - signal swipeUp() - signal swipeDown() - - onPressed: (mouse) => { - startX = mouse.x - startY = mouse.y - prevX = mouse.x - prevY = mouse.y - velocityX = 0 - velocityY = 0 - tracing = true - } - - onPositionChanged: (mouse) => { - if (!tracing) return - var currVelX = (mouse.x - prevX) - var currVelY = (mouse.y - prevY) - - velocityX = (velocityX + currVelX) / 2.0 - velocityY = (velocityY + currVelY) / 2.0 - - prevX = mouse.x - prevY = mouse.y - - if (velocityX > 15 && mouse.x > width * 0.25) { - tracing = false - swipeRight() - } else if (velocityX < -15 && mouse.x < width * 0.75) { - tracing = false - swipeLeft() - } else if (velocityY > 15 && mouse.y > height * 0.25) { - tracing = false - swipeDown() - } else if (velocityY < -15 && mouse.y < height * 0.75) { - tracing = false - swipeUp() - } - } -} diff --git a/qml/components_generic/TextField_FileDialog6.qml b/qml/components_generic/TextField_FileDialog6.qml deleted file mode 100644 index 1d75dac2..00000000 --- a/qml/components_generic/TextField_FileDialog6.qml +++ /dev/null @@ -1,139 +0,0 @@ -import QtQuick -import QtQuick.Controls.impl -import QtQuick.Templates as T - -import QtQuick.Dialogs -import QtCore - -import ThemeEngine -import "qrc:/js/UtilsPath.js" as UtilsPath - -T.TextField { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - contentWidth + leftPadding + rightPadding, - placeholder.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding, - placeholder.implicitHeight + topPadding + bottomPadding) - - leftPadding: 12 - rightPadding: 12 - - clip: false - color: colorText - opacity: control.enabled ? 1 : 0.66 - - text: "" - font.pixelSize: Theme.componentFontSize - verticalAlignment: TextInput.AlignVCenter - - placeholderText: "" - placeholderTextColor: colorPlaceholderText - - selectByMouse: false - selectionColor: colorSelection - selectedTextColor: colorSelectedText - - onEditingFinished: focus = false - Keys.onBackPressed: focus = false - - // settings - property string dialogTitle: qsTr("Please choose a file!") - property var dialogFilter: ["All files (*)"] - property int dialogFileMode: FileDialog.SaveFile - - property var currentFolder: StandardPaths.writableLocation(StandardPaths.HomeLocation) - - // button - property string buttonText: qsTr("change") - property int buttonWidth: (buttonChange.visible ? buttonChange.width + 2 : 2) - - // colors - property string colorText: Theme.colorComponentText - property string colorPlaceholderText: Theme.colorSubText - property string colorBorder: Theme.colorComponentBorder - property string colorBackground: Theme.colorComponentBackground - property string colorSelection: Theme.colorPrimary - property string colorSelectedText: "white" - - //////////////// - - Loader { - id: pathDialogLoader - - active: false - asynchronous: false - sourceComponent: FileDialog { - title: control.dialogTitle - nameFilters: control.dialogFilter - - fileMode: control.dialogFileMode - currentFolder: UtilsPath.makeUrl(control.currentFolder) - currentFile: UtilsPath.makeUrl(control.text) - - onAccepted: { - //console.log("fileDialog currentFolder: " + currentFolder) - //console.log("fileDialog currentFile: " + currentFile) - //console.log("fileDialog selectedFile: " + selectedFile) - - var f = UtilsPath.cleanUrl(selectedFile) - - control.text = f - } - } - } - - //////////////// - - background: Rectangle { - implicitWidth: 256 - implicitHeight: Theme.componentHeight - - radius: Theme.componentRadius - color: control.colorBackground - } - - PlaceholderText { - id: placeholder - x: control.leftPadding - y: control.topPadding - width: control.width - (control.leftPadding + control.rightPadding) - height: control.height - (control.topPadding + control.bottomPadding) - - text: control.placeholderText - font: control.font - color: control.placeholderTextColor - verticalAlignment: control.verticalAlignment - visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) - elide: Text.ElideRight - renderType: control.renderType - } - - ButtonThemed { - id: buttonChange - anchors.top: parent.top - anchors.right: parent.right - anchors.bottom: parent.bottom - anchors.margins: 0 - - text: control.buttonText - - onClicked: { - pathDialogLoader.active = true - pathDialogLoader.item.open() - } - } - - Rectangle { - anchors.fill: background - radius: Theme.componentRadius - color: "transparent" - - border.width: 2 - border.color: control.activeFocus ? control.colorSelection : control.colorBorder - } - - //////////////// -} diff --git a/qml/components_generic/TextField_FolderDialog6.qml b/qml/components_generic/TextField_FolderDialog6.qml deleted file mode 100644 index c0d20dfa..00000000 --- a/qml/components_generic/TextField_FolderDialog6.qml +++ /dev/null @@ -1,134 +0,0 @@ -import QtQuick -import QtQuick.Controls.impl -import QtQuick.Templates as T - -import QtQuick.Dialogs -import QtCore - -import ThemeEngine -import "qrc:/js/UtilsPath.js" as UtilsPath - -T.TextField { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - contentWidth + leftPadding + rightPadding, - placeholder.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding, - placeholder.implicitHeight + topPadding + bottomPadding) - - leftPadding: 12 - rightPadding: 12 - - clip: false - color: colorText - opacity: control.enabled ? 1 : 0.66 - - text: "" - font.pixelSize: Theme.componentFontSize - verticalAlignment: TextInput.AlignVCenter - - placeholderText: "" - placeholderTextColor: colorPlaceholderText - - selectByMouse: false - selectionColor: colorSelection - selectedTextColor: colorSelectedText - - onEditingFinished: focus = false - Keys.onBackPressed: focus = false - - // settings - property string dialogTitle: qsTr("Please choose a folder!") - - property var currentFolder: StandardPaths.writableLocation(StandardPaths.HomeLocation) - - // button - property string buttonText: qsTr("change") - property int buttonWidth: (buttonChange.visible ? buttonChange.width + 2 : 2) - - // colors - property string colorText: Theme.colorComponentText - property string colorPlaceholderText: Theme.colorSubText - property string colorBorder: Theme.colorComponentBorder - property string colorBackground: Theme.colorComponentBackground - property string colorSelection: Theme.colorPrimary - property string colorSelectedText: "white" - - //////////////// - - Loader { - id: pathDialogLoader - - active: false - asynchronous: false - sourceComponent: FolderDialog { - title: control.dialogTitle - - currentFolder: UtilsPath.makeUrl(control.currentFolder) - - onAccepted: { - //console.log("fileDialog currentFolder: " + currentFolder) - //console.log("fileDialog selectedFolder: " + selectedFolder) - - var f = UtilsPath.cleanUrl(selectedFolder) - if (f.slice(0, -1) !== "/") f += "/" - - control.text = f - } - } - } - - //////////////// - - background: Rectangle { - implicitWidth: 256 - implicitHeight: Theme.componentHeight - - radius: Theme.componentRadius - color: control.colorBackground - } - - PlaceholderText { - id: placeholder - x: control.leftPadding - y: control.topPadding - width: control.width - (control.leftPadding + control.rightPadding) - height: control.height - (control.topPadding + control.bottomPadding) - - text: control.placeholderText - font: control.font - color: control.placeholderTextColor - verticalAlignment: control.verticalAlignment - visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) - elide: Text.ElideRight - renderType: control.renderType - } - - ButtonThemed { - id: buttonChange - anchors.top: parent.top - anchors.right: parent.right - anchors.bottom: parent.bottom - anchors.margins: 0 - - text: control.buttonText - - onClicked: { - pathDialogLoader.active = true - pathDialogLoader.item.open() - } - } - - Rectangle { - anchors.fill: background - radius: Theme.componentRadius - color: "transparent" - - border.width: 2 - border.color: control.activeFocus ? control.colorSelection : control.colorBorder - } - - //////////////// -} diff --git a/qml/components_generic/ToolTipFlat.qml b/qml/components_generic/ToolTipFlat.qml deleted file mode 100644 index 76043265..00000000 --- a/qml/components_generic/ToolTipFlat.qml +++ /dev/null @@ -1,112 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 - -T.Popup { - id: control - - x: { - if (tooltipPosition === "left") return -(implicitWidth + 10) - if (tooltipPosition === "right") return +(parent.width + 10) - if (tooltipPosition === "topRight" || tooltipPosition === "bottomRight") return 0 - if (tooltipPosition === "topLeft" || tooltipPosition === "bottomLeft") return (parent.width - implicitWidth) - return (parent.width - implicitWidth) / 2 - } - y: { - if (tooltipPosition === "top" || tooltipPosition === "topLeft" || tooltipPosition === "topRight") return -(implicitHeight + 10) - if (tooltipPosition === "bottom" || tooltipPosition === "bottomLeft" || tooltipPosition === "bottomRight") return (parent.height + 10) - return ((parent.height / 2) - (implicitHeight / 2)) - } - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding) - - margins: 6 - padding: 6 - - // settings - property string text - property string tooltipPosition - - // colors - property string textColor: Theme.colorText - property string backgroundColor: Theme.colorComponent - - onVisibleChanged: { - if (!visible) return - - var obj = mapToItem(appContent, x, y) - var thestart = obj.x - var theend = obj.x + implicitWidth + 24 - //console.log("checking tooltip position: " + thestart + " > " + theend) - - if (tooltipPosition === "top") { - if (thestart < 0) { - tooltipPosition = "topRight" - } else if (theend > appContent.width) { - tooltipPosition = "topLeft" - } else { - tooltipPosition = "top" - } - } else if (tooltipPosition === "bottom") { - if (thestart < 0) { - tooltipPosition = "bottomRight" - } else if (theend > appContent.width) { - tooltipPosition = "bottomLeft" - } else { - tooltipPosition = "bottom" - } - } - } - - //////////////////////////////////////////////////////////////////////////// - - enter: Transition { NumberAnimation { property: "opacity"; from: 0.0; to: 1.0; duration: 133; } } - exit: Transition { NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; duration: 133; } } - - //////////////////////////////////////////////////////////////////////////// - - contentItem: Text { - text: control.text - textFormat: Text.PlainText - - font: control.font - wrapMode: Text.Wrap - color: control.textColor - } - - //////////////////////////////////////////////////////////////////////////// - - background: Rectangle { - color: control.backgroundColor - radius: 4 - - Rectangle { // arrow - width: 12; height: 12; rotation: 45; - color: control.backgroundColor - - anchors.horizontalCenter: { - if (tooltipPosition === "left") return parent.right - if (tooltipPosition === "right") return parent.left - return parent.horizontalCenter - } - anchors.horizontalCenterOffset: { - if (tooltipPosition === "topLeft" || tooltipPosition === "bottomLeft") return (control.implicitWidth / 2) - (control.parent.width / 2) - if (tooltipPosition === "topRight" || tooltipPosition === "bottomRight") return -(control.implicitWidth / 2) + (control.parent.width / 2) - return 0 - } - anchors.verticalCenter: { - if (tooltipPosition === "bottom" || tooltipPosition === "bottomLeft" || tooltipPosition === "bottomRight") return parent.top - if (tooltipPosition === "top" || tooltipPosition === "topLeft" || tooltipPosition === "topRight") return parent.bottom - if (tooltipPosition === "left" || tooltipPosition === "right") return parent.verticalCenter - return parent.top - } - } - } - - //////////////////////////////////////////////////////////////////////////// -} diff --git a/qml/components_themed/ButtonIconThemed.qml b/qml/components_themed/ButtonIconThemed.qml deleted file mode 100644 index a55e772b..00000000 --- a/qml/components_themed/ButtonIconThemed.qml +++ /dev/null @@ -1,82 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T -import QtQuick.Layouts 1.15 - -import ThemeEngine 1.0 -import "qrc:/js/UtilsNumber.js" as UtilsNumber - -T.Button { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - leftPadding: 12 - rightPadding: 12+6 - spacing: 6 - - font.pixelSize: Theme.componentFontSize - font.bold: false - - focusPolicy: Qt.NoFocus - - // settings - property url source - property int sourceSize: UtilsNumber.alignTo(height * 0.666, 2) - property int layoutDirection: Qt.LeftToRight - - //////////////// - - background: Rectangle { - implicitWidth: 80 - implicitHeight: Theme.componentHeight - - radius: Theme.componentRadius - opacity: enabled ? 1 : 0.33 - color: control.down ? Theme.colorComponentDown : Theme.colorComponent - } - - //////////////// - - contentItem: RowLayout { - spacing: control.spacing - layoutDirection: control.layoutDirection - - IconSvg { - source: control.source - width: control.sourceSize - height: control.sourceSize - - visible: control.source.toString().length - Layout.maximumWidth: control.sourceSize - Layout.maximumHeight: control.sourceSize - Layout.alignment: Qt.AlignVCenter - - opacity: enabled ? 1.0 : 0.33 - color: Theme.colorComponentContent - } - - Text { - text: control.text - textFormat: Text.PlainText - - visible: control.text - Layout.fillWidth: true - Layout.alignment: Qt.AlignVCenter - - font: control.font - elide: Text.ElideMiddle - //wrapMode: Text.WordWrap - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - - opacity: enabled ? 1.0 : 0.33 - color: Theme.colorComponentContent - } - } - - //////////////// -} diff --git a/qml/components_themed/ButtonThemed.qml b/qml/components_themed/ButtonThemed.qml deleted file mode 100644 index 6c89e989..00000000 --- a/qml/components_themed/ButtonThemed.qml +++ /dev/null @@ -1,50 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 - -T.Button { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - leftPadding: 12 - rightPadding: 12 - - font.pixelSize: Theme.componentFontSize - - focusPolicy: Qt.NoFocus - - //////////////// - - background: Rectangle { - implicitWidth: 80 - implicitHeight: Theme.componentHeight - - radius: Theme.componentRadius - opacity: enabled ? 1 : 0.33 - color: control.down ? Theme.colorComponentDown : Theme.colorComponent - } - - //////////////// - - contentItem: Text { - text: control.text - textFormat: Text.PlainText - - font: control.font - elide: Text.ElideMiddle - //wrapMode: Text.WordWrap - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - - opacity: enabled ? 1.0 : 0.33 - color: control.down ? Theme.colorComponentContent : Theme.colorComponentContent - } - - //////////////// -} diff --git a/qml/components_themed/CheckBoxThemed.qml b/qml/components_themed/CheckBoxThemed.qml deleted file mode 100644 index 1a5db706..00000000 --- a/qml/components_themed/CheckBoxThemed.qml +++ /dev/null @@ -1,68 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 - -T.CheckBox { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - padding: 8 - spacing: 8 - font.pixelSize: Theme.componentFontSize - - property int layoutDirection: Qt.LeftToRight - - //////////////// - - indicator: Rectangle { - implicitWidth: Theme.componentHeight - implicitHeight: Theme.componentHeight - - x: (layoutDirection === Qt.LeftToRight) ? - (control.leftPadding) : - (control.width - control.padding - width) - y: (parent.height / 2) - (height / 2) - width: 24 - height: 24 - radius: Theme.componentRadius - - color: Theme.colorComponentBackground - border.width: Theme.componentBorderWidth - border.color: control.down ? Theme.colorSecondary : Theme.colorComponentBorder - - Rectangle { - anchors.centerIn: parent - width: 12 - height: 12 - radius: (Theme.componentRadius / 2) - - color: Theme.colorSecondary - opacity: control.checked ? 1 : 0 - Behavior on opacity { NumberAnimation { duration: 133 } } - } - } - - //////////////// - - contentItem: Text { - leftPadding: (layoutDirection === Qt.LeftToRight) ? control.indicator.width + control.spacing : 0 - rightPadding: (layoutDirection === Qt.RightToLeft) ? control.indicator.width + control.spacing : 0 - verticalAlignment: Text.AlignVCenter - - text: control.text - textFormat: Text.PlainText - font: control.font - wrapMode: Text.WordWrap - - color: control.checked ? Theme.colorText : Theme.colorSubText - opacity: enabled ? 1.0 : 0.33 - } - - //////////////// -} diff --git a/qml/components_themed/ComboBoxThemed.qml b/qml/components_themed/ComboBoxThemed.qml deleted file mode 100644 index 42e8028e..00000000 --- a/qml/components_themed/ComboBoxThemed.qml +++ /dev/null @@ -1,124 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 - -T.ComboBox { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding, - implicitIndicatorHeight + topPadding + bottomPadding) - - leftPadding: 16 - rightPadding: 16 - - font.pixelSize: Theme.componentFontSize - opacity: enabled ? 1.0 : 0.4 - - //////////////// - - background: Rectangle { - implicitWidth: 200 - implicitHeight: Theme.componentHeight - - radius: Theme.componentRadius - color: control.down ? Theme.colorComponentDown : Theme.colorComponent - border.width: 2 - border.color: Theme.colorComponentBorder - } - - //////////////// - - contentItem: Text { - text: control.displayText - textFormat: Text.PlainText - - font: control.font - elide: Text.ElideRight - verticalAlignment: Text.AlignVCenter - - color: Theme.colorComponentContent - } - - //////////////// - - indicator: Canvas { - x: control.width - width - control.rightPadding - y: control.topPadding + ((control.availableHeight - height) / 2) - width: 12 - height: 8 - rotation: control.popup.visible ? 180 : 0 - - Connections { - target: ThemeEngine - function onCurrentThemeChanged() { indicator.requestPaint() } - } - - onPaint: { - var ctx = getContext("2d") - ctx.reset() - ctx.moveTo(0, 0) - ctx.lineTo(width, 0) - ctx.lineTo(width / 2, height) - ctx.closePath() - ctx.fillStyle = Theme.colorIcon - ctx.fill() - } - } - - //////////////// - - delegate: T.ItemDelegate { - width: control.width - 2 - height: control.height - highlighted: (control.highlightedIndex === index) - - background: Rectangle { - implicitWidth: 200 - implicitHeight: Theme.componentHeight - - radius: Theme.componentRadius - color: highlighted ? "#F6F6F6" : "white" - } - - contentItem: Text { - leftPadding: control.leftPadding - text: control.textRole - ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) - : modelData - color: highlighted ? "black" : Theme.colorSubText - font.pixelSize: Theme.componentFontSize - elide: Text.ElideRight - verticalAlignment: Text.AlignVCenter - } - } - - //////////////// - - popup: T.Popup { - y: control.height - 1 - width: control.width - implicitHeight: (contentItem.implicitHeight) ? contentItem.implicitHeight + 2 : 0 - padding: 1 - - contentItem: ListView { - implicitHeight: contentHeight - clip: true - currentIndex: control.highlightedIndex - model: control.popup.visible ? control.delegateModel : null - } - - background: Rectangle { - radius: Theme.componentRadius - color: "white" - border.color: Theme.colorComponentBorder - border.width: control.visualFocus ? 0 : 1 - } - } - - //////////////// -} diff --git a/qml/components_themed/DialThemed.qml b/qml/components_themed/DialThemed.qml deleted file mode 100644 index 9e216950..00000000 --- a/qml/components_themed/DialThemed.qml +++ /dev/null @@ -1,49 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 - -T.Dial { - id: control - implicitWidth: (Theme.componentHeight * 2) - implicitHeight: (Theme.componentHeight * 2) - - //////////////// - - background: Rectangle { - x: (control.width / 2) - (width / 2) - y: (control.height / 2) - (height / 2) - - width: Math.max(64, Math.min(control.width, control.height)) - height: width - radius: width - - opacity: control.enabled ? 1 : 0.3 - color: Theme.colorForeground - border.width: Theme.componentBorderWidth - border.color: Theme.colorPrimary - } - - //////////////// - - handle: Rectangle { - x: control.background.x + (control.background.width / 2) - (width / 2) - y: control.background.y + (control.background.height / 2) - (height / 2) - - width: 16 - height: 16 - radius: 8 - - opacity: control.enabled ? 1 : 0.3 - color: control.pressed ? Theme.colorSecondary : Theme.colorPrimary - antialiasing: true - - transform: [ - Translate { y: -Math.min(control.background.width, control.background.height) * 0.4 + 8; }, - Rotation { angle: control.angle; origin.x: 8; origin.y: 8; } - ] - } - - //////////////// -} diff --git a/qml/components_themed/DrawerThemed.qml b/qml/components_themed/DrawerThemed.qml deleted file mode 100644 index 0aa03a14..00000000 --- a/qml/components_themed/DrawerThemed.qml +++ /dev/null @@ -1,56 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 - -T.Drawer { - id: control - - parent: T.Overlay.overlay - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding) - - width: (appWindow.singleColumn || appWindow.screenOrientation === Qt.PortraitOrientation || appWindow.width < 480) - ? 0.8 * appWindow.width : 0.5 * appWindow.width - height: appWindow.height - - topPadding: 0 - leftPadding: 0 - rightPadding: 0 - bottomPadding: 0 - - topInset: 0 - leftInset: 0 - rightInset: 0 - bottomInset: 0 - - enter: Transition { SmoothedAnimation { velocity: 5 } } - exit: Transition { SmoothedAnimation { velocity: 5 } } - - T.Overlay.modal: Rectangle { - color: Color.transparent(control.palette.shadow, 0.5) - } - - T.Overlay.modeless: Rectangle { - color: Color.transparent(control.palette.shadow, 0.12) - } - - //////////////// - - background: Rectangle { - color: Theme.colorBackground - - Rectangle { // left border line - x: parent.width - width: 1 - height: parent.height - color: Theme.colorSeparator - } - } - - //////////////// -} diff --git a/qml/components_themed/FrameThemed.qml b/qml/components_themed/FrameThemed.qml deleted file mode 100644 index e9e3ab0f..00000000 --- a/qml/components_themed/FrameThemed.qml +++ /dev/null @@ -1,31 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 - -T.Frame { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding) - - padding: 12 - - // colors - property string backgroundColor: Theme.colorForeground - property string borderColor: Theme.colorSeparator - - //////////////// - - background: Rectangle { - radius: Theme.componentRadius - color: control.backgroundColor - border.width: 2 - border.color: control.borderColor - } - - //////////////// -} diff --git a/qml/components_themed/GroupBoxThemed.qml b/qml/components_themed/GroupBoxThemed.qml deleted file mode 100644 index 7ce03547..00000000 --- a/qml/components_themed/GroupBoxThemed.qml +++ /dev/null @@ -1,52 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 - -T.GroupBox { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - contentWidth + leftPadding + rightPadding, - implicitLabelWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding) - - spacing: 12 - padding: 12 - - topPadding: title ? 4 + (implicitLabelWidth > 0 ? implicitLabelHeight + spacing : 0) : padding - - // colors - property string backgroundColor: Theme.colorForeground - property string borderColor: Theme.colorSeparator - - //////////////// - - background: Rectangle { - y: control.topPadding - control.bottomPadding - width: parent.width - height: parent.height - control.topPadding + control.bottomPadding - - radius: Theme.componentRadius - color: control.backgroundColor - border.width: 2 - border.color: control.borderColor - } - - //////////////// - - label: Text { - x: control.leftPadding - width: control.availableWidth - - text: control.title - font: control.font - color: Theme.colorText - elide: Text.ElideRight - verticalAlignment: Text.AlignVCenter - } - - //////////////// -} diff --git a/qml/components_themed/ItemDelegateThemed.qml b/qml/components_themed/ItemDelegateThemed.qml deleted file mode 100644 index f5b664f5..00000000 --- a/qml/components_themed/ItemDelegateThemed.qml +++ /dev/null @@ -1,80 +0,0 @@ -import QtQuick -import QtQuick.Templates as T -import QtQuick.Controls.impl -import QtQuick.Controls.Material -import QtQuick.Controls.Material.impl - -import ThemeEngine - -T.ItemDelegate { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding, - implicitIndicatorHeight + topPadding + bottomPadding) - - padding: Theme.componentMargin - spacing: Theme.componentMargin - verticalPadding: 0 - - icon.width: 32 - icon.height: 32 - icon.color: enabled ? Material.foreground : Material.hintTextColor - - //////////////// - - background: Rectangle { - implicitHeight: Theme.componentHeightXL - - color: control.highlighted ? control.Material.listHighlightColor : "transparent" - - RippleThemed { - width: parent.width - height: parent.height - - clip: visible - anchor: control - pressed: control.pressed - active: enabled && (control.down || control.visualFocus || control.hovered) - color: Qt.rgba(Theme.colorForeground.r, Theme.colorForeground.g, Theme.colorForeground.b, 0.5) - } - } - - //////////////// - - contentItem: Row { - anchors.verticalCenter: parent.verticalCenter - width: control.width - spacing: Theme.componentMargin - - RoundButtonIcon { - anchors.verticalCenter: parent.verticalCenter - width: Theme.componentHeight - height: Theme.componentHeight - - source: model.icon - backgroundVisible: true - } - - Column { - anchors.verticalCenter: parent.verticalCenter - - Text { - text: model.title - textFormat: Text.PlainText - font.pixelSize: Theme.componentFontSize - color: Theme.colorText - } - Text { - text: model.text - textFormat: Text.PlainText - font.pixelSize: Theme.componentFontSize - color: Theme.colorSubText - } - } - } - - //////////////// -} diff --git a/qml/components_themed/MiddleSliderThemed.qml b/qml/components_themed/MiddleSliderThemed.qml deleted file mode 100644 index 99ca9ff0..00000000 --- a/qml/components_themed/MiddleSliderThemed.qml +++ /dev/null @@ -1,76 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 - -T.Slider { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitHandleWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitHandleHeight + topPadding + bottomPadding) - - padding: 6 - - //////////////// - - background: Rectangle { - x: control.leftPadding + (control.horizontal ? 0 : (control.availableWidth - width) / 2) - y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : 0) - implicitWidth: control.horizontal ? 200 : 4 - implicitHeight: control.horizontal ? 4 : 200 - width: control.horizontal ? control.availableWidth : implicitWidth - height: control.horizontal ? implicitHeight : control.availableHeight - - radius: 2 - color: Theme.colorComponentBackground - scale: control.horizontal && control.mirrored ? -1 : 1 - - Rectangle { - x: control.horizontal ? ((handle.x < control.availableWidth / 2) ? handle.x : control.width / 2) : -1 - y: control.horizontal ? -1 : ((handle.y < control.availableHeight / 2) ? handle.y : control.height / 2) - width: control.horizontal ? Math.abs((control.width / 2) - handle.x) : 6 - height: control.horizontal ? 6 : Math.abs((control.height / 2) - handle.y) - - radius: 2 - color: Theme.colorPrimary - } - } - - //////////////// - - handle: Rectangle { - x: control.leftPadding + (control.horizontal ? (control.visualPosition * (control.availableWidth - width)) : (control.availableWidth - width)) - y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : (control.visualPosition * (control.availableHeight - height))) - - implicitWidth: 18 - implicitHeight: 18 - radius: 9 - - color: control.pressed ? Theme.colorSecondary : Theme.colorPrimary - border.width: 1 - border.color: Theme.colorPrimary - - MouseArea { - anchors.fill: parent - anchors.margins: -10 - z: -1 - - acceptedButtons: Qt.NoButton - hoverEnabled: (isDesktop && control.enabled) - propagateComposedEvents: false - - Rectangle { - anchors.fill: parent - radius: width - color: Theme.colorPrimary - opacity: (control.pressed || parent.containsMouse) ? 0.2 : 0 - Behavior on opacity { NumberAnimation { duration: 233 } } - } - } - } - - //////////////// -} diff --git a/qml/components_themed/PageIndicatorThemed.qml b/qml/components_themed/PageIndicatorThemed.qml deleted file mode 100644 index c2091058..00000000 --- a/qml/components_themed/PageIndicatorThemed.qml +++ /dev/null @@ -1,50 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 - -T.PageIndicator { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - padding: 6 - spacing: 6 - - count: 1 - currentIndex: 1 - - property color color: Theme.colorHeaderContent - - //////////////// - - delegate: Rectangle { - implicitWidth: 12 - implicitHeight: 12 - radius: (width / 2) - - color: control.color - opacity: (index === control.currentIndex) ? (0.95) : (control.pressed ? 0.7 : 0.45) - - required property int index - - Behavior on opacity { OpacityAnimator { duration: 133 } } - } - - //////////////// - - contentItem: Row { - spacing: control.spacing - - Repeater { - model: control.count - delegate: control.delegate - } - } - - //////////////// -} diff --git a/qml/components_themed/PaneThemed.qml b/qml/components_themed/PaneThemed.qml deleted file mode 100644 index 864f16e3..00000000 --- a/qml/components_themed/PaneThemed.qml +++ /dev/null @@ -1,20 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 - -T.Pane { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding) - - padding: 12 - - background: Rectangle { - color: Theme.colorBackground - } -} diff --git a/qml/components_themed/ProgressBarThemed.qml b/qml/components_themed/ProgressBarThemed.qml deleted file mode 100644 index 01166e3f..00000000 --- a/qml/components_themed/ProgressBarThemed.qml +++ /dev/null @@ -1,54 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -//import QtGraphicalEffects 1.15 // Qt5 -import Qt5Compat.GraphicalEffects // Qt6 - -import ThemeEngine 1.0 - -T.ProgressBar { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - property var colorBackground: Theme.colorComponentBackground - property var colorForeground: Theme.colorPrimary - - //////////////// - - background: Rectangle { - implicitWidth: 200 - implicitHeight: 12 - y: (control.height - height) / 2 - - radius: (Theme.componentRadius / 2) - color: control.colorBackground - } - - //////////////// - - contentItem: Item { - Rectangle { - width: control.visualPosition * control.width - height: control.height - color: control.colorForeground - } - - layer.enabled: true - layer.effect: OpacityMask { - maskSource: Rectangle { - x: contentItem.x - y: contentItem.y - width: contentItem.width - height: contentItem.height - radius: contentItem.height - } - } - } - - //////////////// -} diff --git a/qml/components_themed/RadioButtonThemed.qml b/qml/components_themed/RadioButtonThemed.qml deleted file mode 100644 index 558d4659..00000000 --- a/qml/components_themed/RadioButtonThemed.qml +++ /dev/null @@ -1,63 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 - -T.RadioButton { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - padding: 4 - spacing: 8 - font.pixelSize: Theme.componentFontSize - - //////////////// - - indicator: Rectangle { - implicitWidth: Theme.componentHeight - implicitHeight: Theme.componentHeight - - x: control.leftPadding - y: (parent.height / 2) - (height / 2) - width: 24 - height: 24 - radius: (width / 2) - - color: Theme.colorComponentBackground - border.width: Theme.componentBorderWidth - border.color: control.down ? Theme.colorSecondary : Theme.colorComponentBorder - - Rectangle { - anchors.centerIn: parent - width: 12 - height: 12 - radius: (width / 2) - - color: Theme.colorSecondary - opacity: control.checked ? 1 : 0 - Behavior on opacity { NumberAnimation { duration: 133 } } - } - } - - //////////////// - - contentItem: Text { - leftPadding: control.indicator.width + control.spacing - verticalAlignment: Text.AlignVCenter - - text: control.text - textFormat: Text.PlainText - font: control.font - wrapMode: Text.WordWrap - - color: control.checked ? Theme.colorText : Theme.colorSubText - opacity: enabled ? 1.0 : 0.33 - } - - //////////////// -} diff --git a/qml/components_themed/RangeSliderThemed.qml b/qml/components_themed/RangeSliderThemed.qml deleted file mode 100644 index 428f6d5c..00000000 --- a/qml/components_themed/RangeSliderThemed.qml +++ /dev/null @@ -1,111 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 - -T.RangeSlider { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - first.implicitHandleWidth + leftPadding + rightPadding, - second.implicitHandleWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - first.implicitHandleHeight + topPadding + bottomPadding, - second.implicitHandleHeight + topPadding + bottomPadding) - - padding: 6 - - //////////////// - - background: Rectangle { - x: control.leftPadding + (control.horizontal ? 0 : (control.availableWidth - width) / 2) - y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : 0) - implicitWidth: control.horizontal ? 200 : 4 - implicitHeight: control.horizontal ? 4 : 200 - width: control.horizontal ? control.availableWidth : implicitWidth - height: control.horizontal ? implicitHeight : control.availableHeight - - radius: 2 - color: Theme.colorComponentBackground - scale: control.horizontal && control.mirrored ? -1 : 1 - - Rectangle { - x: control.horizontal ? control.first.position * parent.width + 3 : -1 - y: control.horizontal ? -1 : control.second.visualPosition * parent.height + 3 - width: control.horizontal ? control.second.position * parent.width - control.first.position * parent.width - 6 : 6 - height: control.horizontal ? 6 : control.second.position * parent.height - control.first.position * parent.height - 6 - - radius: 2 - color: Theme.colorPrimary - } - } - - //////////////// - - first.handle: Rectangle { - x: control.leftPadding + (control.horizontal ? control.first.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2) - y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : control.first.visualPosition * (control.availableHeight - height)) - - implicitWidth: 18 - implicitHeight: 18 - radius: 9 - - color: first.pressed ? Theme.colorSecondary : Theme.colorPrimary - border.width: 1 - border.color: Theme.colorPrimary - - MouseArea { - anchors.fill: parent - anchors.margins: -10 - z: -1 - - acceptedButtons: Qt.NoButton - hoverEnabled: (isDesktop && control.enabled) - propagateComposedEvents: false - - Rectangle { - anchors.fill: parent - radius: width - color: Theme.colorPrimary - opacity: (first.pressed || parent.containsMouse) ? 0.2 : 0 - Behavior on opacity { NumberAnimation { duration: 233 } } - } - } - } - - //////////////// - - second.handle: Rectangle { - x: control.leftPadding + (control.horizontal ? control.second.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2) - y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : control.second.visualPosition * (control.availableHeight - height)) - - implicitWidth: 18 - implicitHeight: 18 - radius: 9 - - color: second.pressed ? Theme.colorSecondary : Theme.colorPrimary - border.width: 1 - border.color: Theme.colorPrimary - - MouseArea { - anchors.fill: parent - anchors.margins: -10 - z: -1 - - acceptedButtons: Qt.NoButton - hoverEnabled: (isDesktop && control.enabled) - propagateComposedEvents: false - - Rectangle { - anchors.fill: parent - radius: width - color: Theme.colorPrimary - opacity: (second.pressed || parent.containsMouse) ? 0.2 : 0 - Behavior on opacity { NumberAnimation { duration: 233 } } - } - } - } - - //////////////// -} diff --git a/qml/components_themed/RippleThemed.qml b/qml/components_themed/RippleThemed.qml deleted file mode 100644 index c85d531f..00000000 --- a/qml/components_themed/RippleThemed.qml +++ /dev/null @@ -1,3 +0,0 @@ -import QtQuick.Controls.Material.impl as QQuickMaterial - -QQuickMaterial.Ripple {} diff --git a/qml/components_themed/RoundButtonIconThemed.qml b/qml/components_themed/RoundButtonIconThemed.qml deleted file mode 100644 index 08ecf7b6..00000000 --- a/qml/components_themed/RoundButtonIconThemed.qml +++ /dev/null @@ -1,47 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 -import "qrc:/js/UtilsNumber.js" as UtilsNumber - -T.Button { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - focusPolicy: Qt.NoFocus - - property url source - property int sourceSize: UtilsNumber.alignTo(height * 0.666, 2) - - //////////////// - - background: Rectangle { - implicitWidth: Theme.componentHeight - implicitHeight: Theme.componentHeight - - radius: Theme.componentHeight - opacity: enabled ? 1 : 0.33 - color: control.down ? Theme.colorComponentDown : Theme.colorComponent - } - - //////////////// - - contentItem: Item { - IconSvg { - anchors.centerIn: parent - width: control.sourceSize - height: control.sourceSize - - opacity: enabled ? 1.0 : 0.33 - source: control.source - color: Theme.colorComponentContent - } - } - - //////////////// -} diff --git a/qml/components_themed/RoundButtonThemed.qml b/qml/components_themed/RoundButtonThemed.qml deleted file mode 100644 index 7eaf2077..00000000 --- a/qml/components_themed/RoundButtonThemed.qml +++ /dev/null @@ -1,46 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 - -T.Button { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - font.pixelSize: Theme.componentFontSize - - focusPolicy: Qt.NoFocus - - //////////////// - - background: Rectangle { - implicitWidth: Theme.componentHeight - implicitHeight: Theme.componentHeight - - radius: Theme.componentHeight - opacity: enabled ? 1 : 0.33 - color: control.down ? Theme.colorComponentDown : Theme.colorComponent - } - - //////////////// - - contentItem: Text { - text: control.text - textFormat: Text.PlainText - - font: control.font - elide: Text.ElideRight - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - - opacity: enabled ? 1.0 : 0.33 - color: control.down ? Theme.colorComponentContent : Theme.colorComponentContent - } - - //////////////// -} diff --git a/qml/components_themed/ScrollBarThemed.qml b/qml/components_themed/ScrollBarThemed.qml deleted file mode 100644 index 696377a7..00000000 --- a/qml/components_themed/ScrollBarThemed.qml +++ /dev/null @@ -1,61 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 - -T.ScrollBar { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - visible: control.policy !== T.ScrollBar.AlwaysOff - minimumSize: orientation === Qt.Horizontal ? height / width : width / height - - states: State { - name: "active" - when: control.policy === T.ScrollBar.AlwaysOn || (control.active && control.size < 1.0) - PropertyChanges { control.background.opacity: 0.75 } - PropertyChanges { control.contentItem.opacity: 0.75 } - } - - transitions: Transition { - from: "active" - SequentialAnimation { - PauseAnimation { duration: 450 } - NumberAnimation { target: control.background; duration: 200; property: "opacity"; to: 0.0 } - NumberAnimation { target: control.contentItem; duration: 200; property: "opacity"; to: 0.0 } - } - } - - //////////////// - - background: Rectangle { - implicitWidth: orientation === Qt.Vertical ? 12 : 100 - implicitHeight: orientation === Qt.Vertical ? 100 : 12 - - x: control.leftPadding - width: control.width - control.leftPadding - control.rightPadding - - y: control.topPadding - height: control.height - control.topPadding - control.bottomPadding - - color: Theme.colorForeground - opacity: 0.0 - } - - //////////////// - - contentItem: Rectangle { - implicitWidth: control.interactive ? 12 : 6 - implicitHeight: control.interactive ? 12 : 6 - - color: control.pressed ? Theme.colorSecondary : control.palette.mid // Qt.darker(Theme.colorForeground, 1.1) - opacity: 0.0 - } - - //////////////// -} diff --git a/qml/components_themed/SelectorMenuThemed.qml b/qml/components_themed/SelectorMenuThemed.qml deleted file mode 100644 index 6d4c1fdc..00000000 --- a/qml/components_themed/SelectorMenuThemed.qml +++ /dev/null @@ -1,57 +0,0 @@ -import QtQuick 2.15 - -import ThemeEngine 1.0 - -Item { - id: selectorMenu - implicitWidth: 128 - implicitHeight: 32 - - width: contentRow.width - opacity: enabled ? 1 : 0.4 - - signal menuSelected(var index) - property int currentSelection: 1 - - property var model: null - - //////////////// - - Rectangle { // background - anchors.fill: parent - radius: Theme.componentRadius - color: Theme.colorComponentBackground - } - - //////////////// - - Row { - id: contentRow - height: parent.height - spacing: Theme.componentBorderWidth - - Repeater { - model: selectorMenu.model - delegate: SelectorMenuThemedItem { - height: parent.height - highlighted: (selectorMenu.currentSelection === idx) - index: idx ?? 0 - text: txt ?? "" - source: src ?? "" - sourceSize: sz ?? 32 - onClicked: selectorMenu.menuSelected(idx) - } - } - } - - Rectangle { // foreground border - anchors.fill: parent - radius: Theme.componentRadius - - color: "transparent" - border.width: Theme.componentBorderWidth - border.color: Theme.colorComponentBorder - } - - //////////////// -} diff --git a/qml/components_themed/SelectorMenuThemedItem.qml b/qml/components_themed/SelectorMenuThemedItem.qml deleted file mode 100644 index ba92181a..00000000 --- a/qml/components_themed/SelectorMenuThemedItem.qml +++ /dev/null @@ -1,79 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 - -T.Button { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - leftPadding: 16 - rightPadding: 16 - - focusPolicy: Qt.NoFocus - - // settings - property int index - property url source - property int sourceSize: 32 - - // colors - property string colorContent: Theme.colorComponentText - property string colorContentHighlight: Theme.colorComponentContent - property string colorBackgroundHighlight: Theme.colorComponentDown - - //////////////// - - background: Rectangle { - implicitWidth: 32 - implicitHeight: 32 - radius: Theme.componentRadius - - color: control.colorBackgroundHighlight - opacity: { - if (control.hovered && control.highlighted) return 0.9 - else if (control.highlighted) return 0.7 - else if (control.hovered) return 0.5 - return 0 - } - Behavior on opacity { OpacityAnimator { duration: 133 } } - } - - //////////////// - - contentItem: Row { - spacing: 4 - - IconSvg { // contentImage - anchors.verticalCenter: parent.verticalCenter - visible: control.source.toString().length - - width: control.sourceSize - height: control.sourceSize - - source: control.source - color: control.highlighted ? control.colorContentHighlight : control.colorContent - opacity: control.highlighted ? 1 : 0.5 - } - - Text { // contentText - anchors.verticalCenter: parent.verticalCenter - visible: control.text - - text: control.text - textFormat: Text.PlainText - font: control.font - verticalAlignment: Text.AlignVCenter - - color: control.highlighted ? control.colorContentHighlight : control.colorContent - opacity: control.highlighted ? 1 : 0.66 - } - } - - //////////////// -} diff --git a/qml/components_themed/SliderThemed.qml b/qml/components_themed/SliderThemed.qml deleted file mode 100644 index f4df4d84..00000000 --- a/qml/components_themed/SliderThemed.qml +++ /dev/null @@ -1,76 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 - -T.Slider { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitHandleWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitHandleHeight + topPadding + bottomPadding) - - padding: 6 - - //////////////// - - background: Rectangle { - x: control.leftPadding + (control.horizontal ? 0 : (control.availableWidth - width) / 2) - y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : 0) - implicitWidth: control.horizontal ? 200 : 4 - implicitHeight: control.horizontal ? 4 : 200 - width: control.horizontal ? control.availableWidth : implicitWidth - height: control.horizontal ? implicitHeight : control.availableHeight - - radius: 2 - color: Theme.colorComponentBackground - scale: control.horizontal && control.mirrored ? -1 : 1 - - Rectangle { - x: control.horizontal ? 0 : -1 - y: control.horizontal ? -1 : control.visualPosition * parent.height - width: control.horizontal ? control.position * parent.width : 6 - height: control.horizontal ? 6 : control.position * parent.height - - radius: 2 - color: Theme.colorPrimary - } - } - - //////////////// - - handle: Rectangle { - x: control.leftPadding + (control.horizontal ? control.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2) - y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : control.visualPosition * (control.availableHeight - height)) - - implicitWidth: 18 - implicitHeight: 18 - radius: 9 - - color: control.pressed ? Theme.colorSecondary : Theme.colorPrimary - border.width: 1 - border.color: Theme.colorPrimary - - MouseArea { - anchors.fill: parent - anchors.margins: -10 - z: -1 - - acceptedButtons: Qt.NoButton - hoverEnabled: (isDesktop && control.enabled) - propagateComposedEvents: false - - Rectangle { - anchors.fill: parent - radius: width - color: Theme.colorPrimary - opacity: (control.pressed || parent.containsMouse) ? 0.2 : 0 - Behavior on opacity { NumberAnimation { duration: 233 } } - } - } - } - - //////////////// -} diff --git a/qml/components_themed/SpinBoxThemed_desktop.qml b/qml/components_themed/SpinBoxThemed_desktop.qml deleted file mode 100644 index de8bf9ff..00000000 --- a/qml/components_themed/SpinBoxThemed_desktop.qml +++ /dev/null @@ -1,225 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -//import QtGraphicalEffects 1.15 // Qt5 -import Qt5Compat.GraphicalEffects // Qt6 - -import ThemeEngine 1.0 -import "qrc:/js/UtilsNumber.js" as UtilsNumber - -T.SpinBox { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding, - up.implicitIndicatorHeight, down.implicitIndicatorHeight) - - leftPadding: padding + (control.mirrored ? (up.indicator ? up.indicator.width : 0) : (down.indicator ? down.indicator.width : 0)) - rightPadding: padding + (control.mirrored ? (down.indicator ? down.indicator.width : 0) : (up.indicator ? up.indicator.width : 0)) - - opacity: enabled ? 1 : 0.4 - font.pixelSize: Theme.componentFontSize - - property string legend - - //////////////// - - validator: IntValidator { - locale: control.locale.name - bottom: Math.min(control.from, control.to) - top: Math.max(control.from, control.to) - } - - //////////////// - - background: Rectangle { - implicitWidth: 128 - implicitHeight: Theme.componentHeight - - radius: Theme.componentRadius - color: Theme.colorComponentBackground - - Rectangle { - width: control.height - height: control.height / 2 - x: control.mirrored ? 0 : control.width - width - y: 0 - color: control.up.pressed ? Theme.colorComponentDown : Theme.colorComponent - } - Rectangle { - width: control.height - height: control.height / 2 - x: control.mirrored ? 0 : control.width - width - y: height - color: control.down.pressed ? Theme.colorComponentDown : Theme.colorComponent - } - - Rectangle { - anchors.fill: parent - radius: Theme.componentRadius - color: "transparent" - border.width: Theme.componentBorderWidth - border.color: control.focus ? Theme.colorPrimary : Theme.colorComponentBorder - } - - layer.enabled: true - layer.effect: OpacityMask { - maskSource: Rectangle { - x: control.x - y: control.y - width: control.width - height: control.height - radius: Theme.componentRadius - } - } - } - - //////////////// - - contentItem: Item { - anchors.left: parent.left - anchors.leftMargin: control.leftPadding - anchors.right: parent.right - anchors.rightMargin: control.rightPadding + control.height - - Row { - anchors.centerIn: parent - spacing: 4 - - TextInput { - height: control.height - anchors.verticalCenter: parent.verticalCenter - - color: Theme.colorComponentText - selectionColor: Theme.colorPrimary - selectedTextColor: "white" - selectByMouse: control.editable - - text: control.value - font: control.font - horizontalAlignment: Qt.AlignHCenter - verticalAlignment: Qt.AlignVCenter - - readOnly: !control.editable - validator: control.validator - inputMethodHints: Qt.ImhDigitsOnly - - onEditingFinished: { - //var v = parseInt(text) - //if (text.length <= 0) v = control.from - //if (isNaN(v)) v = control.from - //if (v < control.from) v = control.from - //if (v > control.to) v = control.to - - //control.value = v - //control.valueModified() - - control.focus = false - focus = false - } - Keys.onBackPressed: { - control.focus = false - focus = false - } - } - - Text { - height: control.height - anchors.verticalCenter: parent.verticalCenter - - visible: control.legend - color: Theme.colorComponentText - opacity: 0.66 - - text: control.legend - textFormat: Text.PlainText - font: control.font - horizontalAlignment: Qt.AlignHCenter - verticalAlignment: Qt.AlignVCenter - } - } - } - - //////////////// - - up.indicator: Item { - implicitWidth: Theme.componentHeight - implicitHeight: Theme.componentHeight / 2 - - width: control.height - height: control.height / 2 - x: control.mirrored ? 0 : control.width - width - y: 0 - - opacity: enabled ? 1 : 0.33 - - Canvas { - id: arrowup - anchors.centerIn: parent - anchors.verticalCenterOffset: 2 - width: 12 - height: 6 - rotation: 180 - - Connections { - target: ThemeEngine - function onCurrentThemeChanged() { arrowup.requestPaint() } - } - - onPaint: { - var ctx = getContext("2d") - ctx.reset() - ctx.moveTo(0, 0) - ctx.lineTo(width, 0) - ctx.lineTo(width / 2, height) - ctx.closePath() - ctx.fillStyle = Theme.colorIcon - ctx.fill() - } - } - } - - //////////////// - - down.indicator: Item { - implicitWidth: Theme.componentHeight - implicitHeight: Theme.componentHeight / 2 - - width: control.height - height: control.height / 2 - x: control.mirrored ? 0 : control.width - width - y: height - - opacity: enabled ? 1 : 0.33 - - Canvas { - id: arrowdown - anchors.centerIn: parent - anchors.verticalCenterOffset: -2 - width: 12 - height: 6 - rotation: 0 - - Connections { - target: ThemeEngine - function onCurrentThemeChanged() { arrowdown.requestPaint() } - } - - onPaint: { - var ctx = getContext("2d") - ctx.reset() - ctx.moveTo(0, 0) - ctx.lineTo(width, 0) - ctx.lineTo(width / 2, height) - ctx.closePath() - ctx.fillStyle = Theme.colorIcon - ctx.fill() - } - } - } - - //////////////// -} diff --git a/qml/components_themed/SpinBoxThemed_mobile.qml b/qml/components_themed/SpinBoxThemed_mobile.qml deleted file mode 100644 index 16830a1f..00000000 --- a/qml/components_themed/SpinBoxThemed_mobile.qml +++ /dev/null @@ -1,190 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -//import QtGraphicalEffects 1.15 // Qt5 -import Qt5Compat.GraphicalEffects // Qt6 - -import ThemeEngine 1.0 -import "qrc:/js/UtilsNumber.js" as UtilsNumber - -T.SpinBox { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding, - up.implicitIndicatorHeight, down.implicitIndicatorHeight) - - leftPadding: padding + (control.mirrored ? (up.indicator ? up.indicator.width : 0) : (down.indicator ? down.indicator.width : 0)) - rightPadding: padding + (control.mirrored ? (down.indicator ? down.indicator.width : 0) : (up.indicator ? up.indicator.width : 0)) - - opacity: enabled ? 1 : 0.4 - font.pixelSize: Theme.componentFontSize - - property string legend - - //////////////// - - validator: IntValidator { - locale: control.locale.name - bottom: Math.min(control.from, control.to) - top: Math.max(control.from, control.to) - } - - //////////////// - - background: Rectangle { - implicitWidth: 140 - implicitHeight: Theme.componentHeight - - radius: Theme.componentRadius - color: Theme.colorComponentBackground - - Rectangle { - width: control.height - height: control.height - anchors.verticalCenter: parent.verticalCenter - x: control.mirrored ? 0 : control.width - width - color: control.up.pressed ? Theme.colorComponentDown : Theme.colorComponent - } - Rectangle { - width: control.height - height: control.height - anchors.verticalCenter: parent.verticalCenter - x: control.mirrored ? control.width - width : 0 - color: control.down.pressed ? Theme.colorComponentDown : Theme.colorComponent - } - - Rectangle { - anchors.fill: parent - radius: Theme.componentRadius - color: "transparent" - border.width: Theme.componentBorderWidth - border.color: control.focus ? Theme.colorPrimary : Theme.colorComponentBorder - } - - layer.enabled: true - layer.effect: OpacityMask { - maskSource: Rectangle { - x: control.x - y: control.y - width: control.width - height: control.height - radius: Theme.componentRadius - } - } - } - - //////////////// - - contentItem: Item { - Row { - anchors.centerIn: parent - spacing: 4 - - TextInput { - height: control.height - anchors.verticalCenter: parent.verticalCenter - - color: Theme.colorComponentText - selectionColor: Theme.colorPrimary - selectedTextColor: "white" - selectByMouse: control.editable - - text: control.value - font: control.font - horizontalAlignment: Qt.AlignHCenter - verticalAlignment: Qt.AlignVCenter - - readOnly: !control.editable - validator: control.validator - inputMethodHints: Qt.ImhDigitsOnly - - onEditingFinished: { - //var v = parseInt(text) - //if (text.length <= 0) v = control.from - //if (isNaN(v)) v = control.from - //if (v < control.from) v = control.from - //if (v > control.to) v = control.to - - //control.value = v - //control.valueModified() - - control.focus = false - focus = false - } - Keys.onBackPressed: { - control.focus = false - focus = false - } - } - - Text { - height: control.height - anchors.verticalCenter: parent.verticalCenter - - visible: control.legend - color: Theme.colorComponentText - opacity: 0.66 - - text: control.legend - textFormat: Text.PlainText - font: control.font - horizontalAlignment: Qt.AlignHCenter - verticalAlignment: Qt.AlignVCenter - } - } - } - - //////////////// - - up.indicator: Item { - implicitWidth: Theme.componentHeight - implicitHeight: Theme.componentHeight - - width: control.height - height: control.height - x: control.mirrored ? 0 : control.width - width - anchors.verticalCenter: control.verticalCenter - - opacity: enabled ? 1 : 0.33 - - Rectangle { - anchors.centerIn: parent - width: UtilsNumber.round2(parent.height * 0.4) - height: 2 - color: Theme.colorComponentContent - } - Rectangle { - anchors.centerIn: parent - width: 2 - height: UtilsNumber.round2(parent.height * 0.4) - color: Theme.colorComponentContent - } - } - - //////////////// - - down.indicator: Item { - implicitWidth: Theme.componentHeight - implicitHeight: Theme.componentHeight - - width: control.height - height: control.height - x: control.mirrored ? control.width - width : 0 - anchors.verticalCenter: control.verticalCenter - - opacity: enabled ? 1 : 0.33 - - Rectangle { - anchors.centerIn: parent - width: UtilsNumber.round2(parent.height * 0.4) - height: 2 - color: Theme.colorComponentContent - } - } - - //////////////// -} diff --git a/qml/components_themed/SwitchThemed_desktop.qml b/qml/components_themed/SwitchThemed_desktop.qml deleted file mode 100644 index 26e79eb1..00000000 --- a/qml/components_themed/SwitchThemed_desktop.qml +++ /dev/null @@ -1,77 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 - -T.Switch { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - padding: 4 - spacing: 12 - - font.pixelSize: Theme.componentFontSize - - property color colorText: Theme.colorText - property color colorSubText: Theme.colorSubText - - //////////////// - - indicator: Rectangle { - implicitWidth: 48 - implicitHeight: Theme.componentHeight - - x: control.text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 - y: control.topPadding + (control.availableHeight - height) / 2 - width: 48 - height: (width / 2) - radius: (width / 2) - - color: Theme.colorComponentBackground - - border.color: Theme.colorComponentBorder - border.width: Theme.componentBorderWidth - - Rectangle { - x: control.checked ? (parent.width - width) : 0 - Behavior on x { NumberAnimation { duration: 133 } } - width: 24 - height: width - radius: (width / 2) - anchors.verticalCenter: parent.verticalCenter - - color: control.checked ? Theme.colorPrimary : Theme.colorComponentBorder - - Rectangle { - anchors.fill: parent - anchors.margins: -10 - z: -1 - radius: (width / 2) - color: parent.color - opacity: enabled && (control.pressed || control.hovered) ? 0.2 : 0 - Behavior on opacity { NumberAnimation { duration: 233 } } - } - } - } - - contentItem: Text { - leftPadding: !control.mirrored ? control.indicator.width + control.spacing : 0 - rightPadding: control.mirrored ? control.indicator.width + control.spacing : 0 - - opacity: enabled ? 1.0 : 0.33 - - text: control.text - textFormat: Text.PlainText - font: control.font - color: control.checked ? control.colorText : control.colorSubText - elide: Text.ElideRight - verticalAlignment: Text.AlignVCenter - } - - //////////////// -} diff --git a/qml/components_themed/SwitchThemed_mobile.qml b/qml/components_themed/SwitchThemed_mobile.qml deleted file mode 100644 index 40c4edca..00000000 --- a/qml/components_themed/SwitchThemed_mobile.qml +++ /dev/null @@ -1,72 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 - -T.Switch { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - padding: 4 - spacing: 12 - - font.pixelSize: Theme.componentFontSize - - //////////////// - - indicator: Rectangle { - implicitWidth: 48 - implicitHeight: Theme.componentHeight - - x: control.leftPadding - y: (parent.height / 2) - (height / 2) - width: 40 - height: 16 - radius: 16 - - color: control.checked ? Theme.colorSecondary : Theme.colorComponentDown - Behavior on color { ColorAnimation { duration: 133; easing.type: Easing.InOutCirc; } } - - Rectangle { - x: control.checked ? (parent.width - width) : 0 - Behavior on x { NumberAnimation { duration: 133 } } - width: 24 - height: width - radius: (width / 2) - anchors.verticalCenter: parent.verticalCenter - - color: control.checked ? Theme.colorPrimary : Theme.colorComponent - border.width: control.checked ? 0 : 1 - border.color: Theme.colorComponentBorder - - Rectangle { - anchors.fill: parent - anchors.margins: -10 - z: -1 - radius: (width / 2) - color: parent.color - opacity: (control.pressed) ? 0.2 : 0 - Behavior on opacity { NumberAnimation { duration: 233 } } - } - } - } - - contentItem: Text { - leftPadding: control.indicator.width + control.spacing - verticalAlignment: Text.AlignVCenter - - text: control.text - textFormat: Text.PlainText - font: control.font - - color: control.checked ? Theme.colorText : Theme.colorSubText - opacity: enabled ? 1.0 : 0.33 - } - - //////////////// -} diff --git a/qml/components_themed/TextAreaThemed.qml b/qml/components_themed/TextAreaThemed.qml deleted file mode 100644 index bbbe8fa5..00000000 --- a/qml/components_themed/TextAreaThemed.qml +++ /dev/null @@ -1,74 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 - -T.TextArea { - id: control - - implicitWidth: Math.max(contentWidth + leftPadding + rightPadding, - implicitBackgroundWidth + leftInset + rightInset, - placeholder.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(contentHeight + topPadding + bottomPadding, - implicitBackgroundHeight + topInset + bottomInset, - placeholder.implicitHeight + topPadding + bottomPadding) - - padding: 12 - - color: colorText - opacity: control.enabled ? 1 : 0.66 - - text: "" - font.pixelSize: Theme.componentFontSize - verticalAlignment: Text.AlignTop - - placeholderText: "" - placeholderTextColor: colorPlaceholderText - - selectByMouse: false - selectionColor: colorSelection - selectedTextColor: colorSelectedText - - onEditingFinished: focus = false - Keys.onBackPressed: focus = false - - // colors - property string colorText: Theme.colorComponentContent - property string colorPlaceholderText: Theme.colorSubText - property string colorBorder: Theme.colorComponentBorder - property string colorBackground: Theme.colorComponentBackground - property string colorSelection: Theme.colorPrimary - property string colorSelectedText: "white" - - //////////////// - - background: Rectangle { - implicitWidth: 256 - implicitHeight: Theme.componentHeight*2 - - radius: Theme.componentRadius - color: control.colorBackground - - border.width: 2 - border.color: control.activeFocus ? control.colorSelection : control.colorBorder - } - - PlaceholderText { - id: placeholder - x: control.leftPadding - y: control.topPadding - width: control.width - (control.leftPadding + control.rightPadding) - height: control.height - (control.topPadding + control.bottomPadding) - - text: control.placeholderText - font: control.font - color: control.placeholderTextColor - verticalAlignment: control.verticalAlignment - visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) - elide: Text.ElideRight - renderType: control.renderType - } - - //////////////// -} diff --git a/qml/components_themed/TextEditThemed.qml b/qml/components_themed/TextEditThemed.qml deleted file mode 100644 index 7e780b1f..00000000 --- a/qml/components_themed/TextEditThemed.qml +++ /dev/null @@ -1,18 +0,0 @@ -import QtQuick 2.15 - -import ThemeEngine 1.0 - -TextEdit { - readOnly: false - - selectByMouse: isDesktop - selectionColor: Theme.colorPrimary - selectedTextColor: "white" - - onEditingFinished: focus = false - Keys.onBackPressed: focus = false - - color: Theme.colorText - font.pixelSize: Theme.componentFontSize - wrapMode: Text.WrapAnywhere -} diff --git a/qml/components_themed/TextFieldThemed.qml b/qml/components_themed/TextFieldThemed.qml deleted file mode 100644 index 8e9641c0..00000000 --- a/qml/components_themed/TextFieldThemed.qml +++ /dev/null @@ -1,74 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 - -T.TextField { - id: control - - implicitWidth: implicitBackgroundWidth + leftInset + rightInset - || Math.max(contentWidth, placeholder.implicitWidth) + leftPadding + rightPadding - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding, - placeholder.implicitHeight + topPadding + bottomPadding) - - leftPadding: 12 - rightPadding: 12 - - color: colorText - opacity: control.enabled ? 1 : 0.66 - - text: "" - font.pixelSize: Theme.componentFontSize - verticalAlignment: TextInput.AlignVCenter - - placeholderText: "" - placeholderTextColor: colorPlaceholderText - - selectByMouse: false - selectionColor: colorSelection - selectedTextColor: colorSelectedText - - onEditingFinished: focus = false - Keys.onBackPressed: focus = false - - // colors - property string colorText: Theme.colorComponentText - property string colorPlaceholderText: Theme.colorSubText - property string colorBorder: Theme.colorComponentBorder - property string colorBackground: Theme.colorComponentBackground - property string colorSelection: Theme.colorPrimary - property string colorSelectedText: "white" - - //////////////// - - background: Rectangle { - implicitWidth: 256 - implicitHeight: Theme.componentHeight - - radius: Theme.componentRadius - color: control.colorBackground - - border.width: 2 - border.color: control.activeFocus ? control.colorSelection : control.colorBorder - } - - PlaceholderText { - id: placeholder - x: control.leftPadding - y: control.topPadding - width: control.width - (control.leftPadding + control.rightPadding) - height: control.height - (control.topPadding + control.bottomPadding) - - text: control.placeholderText - font: control.font - color: control.placeholderTextColor - verticalAlignment: control.verticalAlignment - visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) - elide: Text.ElideRight - renderType: control.renderType - } - - //////////////// -} diff --git a/qml/components_themed/ToolTipThemed.qml b/qml/components_themed/ToolTipThemed.qml deleted file mode 100644 index 6679bafc..00000000 --- a/qml/components_themed/ToolTipThemed.qml +++ /dev/null @@ -1,57 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 - -T.ToolTip { - id: control - - x: parent ? (parent.width - implicitWidth) / 2 : 0 - y: -implicitHeight - 8 - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding) - - margins: 6 - padding: 6 - - closePolicy: T.Popup.CloseOnEscape | T.Popup.CloseOnPressOutsideParent | T.Popup.CloseOnReleaseOutsideParent - - // colors - property string textColor: Theme.colorText - property string backgroundColor: Theme.colorComponent - - enter: Transition { NumberAnimation { property: "opacity"; from: 0.0; to: 1.0; duration: 133; } } - exit: Transition { NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; duration: 133; } } - - //////////////// - - contentItem: Text { - text: control.text - textFormat: Text.PlainText - - font: control.font - wrapMode: Text.Wrap - color: control.textColor - } - - //////////////// - - background: Rectangle { - color: control.backgroundColor - radius: 4 - - Rectangle { // arrow - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.top - - width: 12; height: 12; rotation: 45 - color: control.backgroundColor - } - } - - //////////////// -} diff --git a/qml/components_themed/TumblerThemed.qml b/qml/components_themed/TumblerThemed.qml deleted file mode 100644 index 6077e53c..00000000 --- a/qml/components_themed/TumblerThemed.qml +++ /dev/null @@ -1,73 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T - -import ThemeEngine 1.0 - -T.Tumbler { - id: control - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - opacity: (control.enabled ? 1.0 : 0.8) - - //////////////// - - background: Item { - implicitWidth: Theme.componentHeight - implicitHeight: Theme.componentHeight * 2 - } - - //////////////// - - contentItem: PathView { - id: pathView - - model: control.model - delegate: control.delegate - - clip: true - pathItemCount: control.visibleItemCount + 1 - preferredHighlightBegin: 0.5 - preferredHighlightEnd: 0.5 - dragMargin: (width / 2) - - path: Path { - startX: (pathView.width / 2) - startY: -(pathView.delegateHeight / 2) - - PathLine { - x: (pathView.width / 2) - y: (pathView.pathItemCount * pathView.delegateHeight) - (pathView.delegateHeight / 2) - } - } - - property real delegateHeight: (control.availableHeight / control.visibleItemCount) - } - - //////////////// - - delegate: Text { - text: modelData - textFormat: Text.PlainText - font: control.font - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - - color: (control.currentIndex === modelData) ? Theme.colorPrimary : Theme.colorText - Behavior on color { ColorAnimation { duration: 133 } } - - opacity: 1.0 - Math.abs(T.Tumbler.displacement) / (control.visibleItemCount / 2) - - //scale: 1.0 + Math.max(0, 1 - Math.abs(T.Tumbler.displacement)) * 0.33 - //scale: (control.currentIndex === modelData) ? 1.33 : 1.0 - - required property var modelData - required property int index - } - - //////////////// -} diff --git a/qml/popups/PopupDate.qml b/qml/popups/PopupDate.qml index 3c12ee39..13e5fc54 100644 --- a/qml/popups/PopupDate.qml +++ b/qml/popups/PopupDate.qml @@ -529,23 +529,16 @@ Popup { //////////////// Row { - height: Theme.componentHeight*2 + parent.spacing anchors.right: parent.right anchors.rightMargin: 24 - spacing: 24 + spacing: 16 ButtonSolid { - width: 96 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("Cancel") color: Theme.colorGrey onClicked: popupDate.close() } ButtonSolid { - width: 128 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("Change") source: "qrc:/assets/icons_material/duotone-schedule-24px.svg" color: Theme.colorPrimary diff --git a/qml/popups/PopupEncoding.qml b/qml/popups/PopupEncoding.qml index fcd52dde..a46c1823 100755 --- a/qml/popups/PopupEncoding.qml +++ b/qml/popups/PopupEncoding.qml @@ -1,6 +1,6 @@ import QtQuick +import QtQuick.Effects import QtQuick.Controls -import Qt5Compat.GraphicalEffects import ThemeEngine import StorageUtils @@ -25,6 +25,8 @@ Popup { signal confirmed() + property bool singleColumn: false + //////// property int popupMode: 0 @@ -318,7 +320,7 @@ Popup { } //////////////////////////////////////////////////////////////////////////// - +/* enter: Transition { NumberAnimation { property: "opacity"; from: 0.5; to: 1.0; duration: 133; } } background: Item { @@ -340,10 +342,57 @@ Popup { cached: true } } + */ + enter: Transition { NumberAnimation { property: "opacity"; from: 0.5; to: 1.0; duration: 133; } } + //exit: Transition { NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; duration: 200; } } + + Overlay.modal: Rectangle { + color: "#000" + opacity: ThemeEngine.isLight ? 0.24 : 0.666 + } + + background: Rectangle { + color: Theme.colorBackground + border.color: Theme.colorSeparator + border.width: singleColumn ? 0 : Theme.componentBorderWidth + radius: singleColumn ? 0 : Theme.componentRadius + + Rectangle { + width: parent.width + height: Theme.componentBorderWidth + visible: singleColumn + color: Theme.colorSeparator + } + layer.enabled: true + layer.effect: MultiEffect { + maskEnabled: true + maskInverted: false + maskThresholdMin: 0.5 + maskSpreadAtMin: 1.0 + maskSpreadAtMax: 0.0 + maskSource: ShaderEffectSource { + sourceItem: Rectangle { + x: background.x + y: background.y + width: background.width + height: background.height + radius: Theme.componentRadius + } + } + } + } + + MultiEffect { + anchors.fill: control + autoPaddingEnabled: true + shadowEnabled: true + shadowColor: ThemeEngine.isLight ? "red" : "red" + } //////////////////////////////////////////////////////////////////////////// contentItem: Column { + bottomPadding: Theme.componentMarginXL Rectangle { // titleArea anchors.left: parent.left @@ -381,9 +430,7 @@ Popup { Rectangle { id: filesArea anchors.left: parent.left - anchors.leftMargin: 2 anchors.right: parent.right - anchors.rightMargin: 2 z: 1 height: 48 @@ -426,9 +473,9 @@ Popup { id: contentArea height: columnEncoding.height anchors.left: parent.left - anchors.leftMargin: 24 + anchors.leftMargin: Theme.componentMarginXL anchors.right: parent.right - anchors.rightMargin: 24 + anchors.rightMargin: Theme.componentMarginXL //////// @@ -1478,24 +1525,18 @@ Popup { //////////////////////////////////////////////////////////////////////// Row { - height: Theme.componentHeight*2 + parent.spacing anchors.right: parent.right - anchors.rightMargin: 24 - spacing: 24 + anchors.rightMargin: Theme.componentMarginXL + spacing: Theme.componentMargin - ButtonWireframe { - anchors.verticalCenter: parent.verticalCenter - width: 96 - //color: Theme.colorGrey + ButtonSolid { + color: Theme.colorGrey text: qsTr("Cancel") onClicked: popupEncoding.close() } - ButtonWireframe { - anchors.verticalCenter: parent.verticalCenter - width: 128 - + ButtonSolid { text: qsTr("Encode") source: "qrc:/assets/icons_material/baseline-memory-24px.svg" diff --git a/qml/popups/PopupExit.qml b/qml/popups/PopupExit.qml index 1ccb7a0c..cdc6ecc5 100644 --- a/qml/popups/PopupExit.qml +++ b/qml/popups/PopupExit.qml @@ -1,6 +1,6 @@ import QtQuick +import QtQuick.Effects import QtQuick.Controls -import Qt5Compat.GraphicalEffects import ThemeEngine @@ -12,58 +12,79 @@ Popup { width: 720 padding: 0 - signal confirmed() - + dim: true modal: true focus: true closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside + parent: Overlay.overlay + + signal confirmed() //////////////////////////////////////////////////////////////////////////// enter: Transition { NumberAnimation { property: "opacity"; from: 0.5; to: 1.0; duration: 133; } } - background: Item { - Rectangle { - id: bgrect + background: Rectangle { + radius: Theme.componentRadius + color: Theme.colorBackground + + Item { anchors.fill: parent - radius: Theme.componentRadius - color: Theme.colorBackground - border.color: Theme.colorSeparator - border.width: Theme.componentBorderWidth + Rectangle { // title area + anchors.left: parent.left + anchors.right: parent.right + height: 64 + color: Theme.colorPrimary + } + + Rectangle { + anchors.fill: parent + radius: Theme.componentRadius + color: "transparent" + border.color: Theme.colorSeparator + border.width: Theme.componentBorderWidth + opacity: 0.4 + } + + layer.enabled: true + layer.effect: MultiEffect { + maskEnabled: true + maskInverted: false + maskThresholdMin: 0.5 + maskSpreadAtMin: 1.0 + maskSpreadAtMax: 0.0 + maskSource: ShaderEffectSource { + sourceItem: Rectangle { + x: background.x + y: background.y + width: background.width + height: background.height + radius: background.radius + } + } + } } - DropShadow { - anchors.fill: parent - source: bgrect - color: "#60000000" - radius: 24 - samples: radius*2+1 - cached: true + + layer.enabled: true + layer.effect: MultiEffect { + autoPaddingEnabled: true + shadowEnabled: true + shadowColor: ThemeEngine.isLight ? "#aa000000" : "#aaffffff" } } //////////////////////////////////////////////////////////////////////////// contentItem: Column { - spacing: 16 + spacing: Theme.componentMarginXL - Rectangle { // titleArea + //////// + + Item { // titleArea anchors.left: parent.left anchors.right: parent.right - height: 64 - color: Theme.colorPrimary - radius: Theme.componentRadius - - Rectangle { - anchors.left: parent.left - anchors.leftMargin: 1 - anchors.right: parent.right - anchors.rightMargin: 0 - anchors.bottom: parent.bottom - height: parent.radius - color: parent.color - } Text { anchors.left: parent.left @@ -77,7 +98,7 @@ Popup { } } - //////////////// + //////// Text { height: Theme.componentHeight @@ -94,29 +115,26 @@ Popup { wrapMode: Text.WordWrap } - //////////////// + //////// + + Item { width: 1; height: 1; } // spacer Row { - height: Theme.componentHeight*2 + parent.spacing anchors.right: parent.right - anchors.rightMargin: 24 - spacing: 24 + anchors.rightMargin: Theme.componentMarginXL + spacing: Theme.componentMargin ButtonSolid { - width: 96 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("Cancel") color: Theme.colorGrey onClicked: popupExit.close() } - ButtonSolid { - anchors.verticalCenter: parent.verticalCenter + ButtonSolid { text: qsTr("Exit") - width: 128 source: "qrc:/assets/icons_material/duotone-exit_to_app-24px.svg" color: Theme.colorWarning + onClicked: { popupExit.confirmed() popupExit.close() @@ -124,5 +142,11 @@ Popup { } } } + + Item { width: 1; height: 1; } // spacer + + //////// } + + //////////////////////////////////////////////////////////////////////////// } diff --git a/qml/popups/PopupMediaDirectory.qml b/qml/popups/PopupMediaDirectory.qml index 5d94419e..de03a550 100644 --- a/qml/popups/PopupMediaDirectory.qml +++ b/qml/popups/PopupMediaDirectory.qml @@ -1,6 +1,6 @@ import QtQuick +import QtQuick.Effects import QtQuick.Controls -import Qt5Compat.GraphicalEffects import ThemeEngine import StorageUtils @@ -16,59 +16,90 @@ Popup { width: 720 padding: 0 - parent: Overlay.overlay - + dim: true modal: true focus: true closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside + parent: Overlay.overlay + + property int legendWidth: 96 //////////////////////////////////////////////////////////////////////////// enter: Transition { NumberAnimation { property: "opacity"; from: 0.5; to: 1.0; duration: 133; } } - background: Item { - Rectangle { - id: bgrect + background: Rectangle { + radius: Theme.componentRadius + color: Theme.colorBackground + + Item { anchors.fill: parent - radius: Theme.componentRadius - color: Theme.colorBackground - border.color: Theme.colorSeparator - border.width: Theme.componentBorderWidth + Column { + anchors.left: parent.left + anchors.right: parent.right + + Rectangle { // title area + anchors.left: parent.left + anchors.right: parent.right + height: 64 + color: Theme.colorPrimary + } + + Rectangle { // subtitle area + anchors.left: parent.left + anchors.right: parent.right + height: 48 + color: Theme.colorForeground + } + } + + Rectangle { + anchors.fill: parent + radius: Theme.componentRadius + color: "transparent" + border.color: Theme.colorSeparator + border.width: Theme.componentBorderWidth + opacity: 0.4 + } + + layer.enabled: true + layer.effect: MultiEffect { + maskEnabled: true + maskInverted: false + maskThresholdMin: 0.5 + maskSpreadAtMin: 1.0 + maskSpreadAtMax: 0.0 + maskSource: ShaderEffectSource { + sourceItem: Rectangle { + x: background.x + y: background.y + width: background.width + height: background.height + radius: background.radius + } + } + } } - DropShadow { - anchors.fill: parent - source: bgrect - color: "#60000000" - radius: 24 - samples: radius*2+1 - cached: true + + layer.enabled: true + layer.effect: MultiEffect { + autoPaddingEnabled: true + shadowEnabled: true + shadowColor: ThemeEngine.isLight ? "#aa000000" : "#aaffffff" } } //////////////////////////////////////////////////////////////////////////// - property int legendWidth: 96 - contentItem: Column { - Rectangle { // titleArea + //////////////// + + Item { // titleArea anchors.left: parent.left anchors.right: parent.right - height: 64 - color: Theme.colorPrimary - radius: Theme.componentRadius - - Rectangle { - anchors.left: parent.left - anchors.leftMargin: 0 - anchors.right: parent.right - anchors.rightMargin: 0 - anchors.bottom: parent.bottom - height: parent.radius - color: parent.color - } Text { anchors.left: parent.left @@ -86,11 +117,8 @@ Popup { Rectangle { anchors.left: parent.left - anchors.leftMargin: 2 anchors.right: parent.right - anchors.rightMargin: 2 - z: 1 height: 48 color: Theme.colorForeground @@ -336,12 +364,12 @@ Popup { visible: (directory.directoryHierarchy === StorageUtils.HierarchyCustom) - ItemTagButton { text: "DATE"; onClicked: tfHC.insert(tfHC.selectionStart, "$(DATE)"); } - ItemTagButton { text: "YEAR"; onClicked: tfHC.insert(tfHC.selectionStart, "$(YEAR)"); } - ItemTagButton { text: "MONTH"; onClicked: tfHC.insert(tfHC.selectionStart, "$(MONTH)"); } - ItemTagButton { text: "DAY"; onClicked: tfHC.insert(tfHC.selectionStart, "$(DAY)"); } - ItemTagButton { text: "SHOT NAME"; onClicked: tfHC.insert(tfHC.selectionStart, "$(SHOT_NAME)"); } - ItemTagButton { text: "CAMERA"; onClicked: tfHC.insert(tfHC.selectionStart, "$(CAMERA)"); } + TagButtonFlat { text: "DATE"; onClicked: tfHC.insert(tfHC.selectionStart, "$(DATE)"); } + TagButtonFlat { text: "YEAR"; onClicked: tfHC.insert(tfHC.selectionStart, "$(YEAR)"); } + TagButtonFlat { text: "MONTH"; onClicked: tfHC.insert(tfHC.selectionStart, "$(MONTH)"); } + TagButtonFlat { text: "DAY"; onClicked: tfHC.insert(tfHC.selectionStart, "$(DAY)"); } + TagButtonFlat { text: "SHOT NAME"; onClicked: tfHC.insert(tfHC.selectionStart, "$(SHOT_NAME)"); } + TagButtonFlat { text: "CAMERA"; onClicked: tfHC.insert(tfHC.selectionStart, "$(CAMERA)"); } } //////// @@ -350,23 +378,27 @@ Popup { ////////////////// + Item{ width: 1; height: 1; } // spacer + Row { - height: Theme.componentHeight*2 + parent.spacing anchors.right: parent.right - anchors.rightMargin: 24 - spacing: 24 + anchors.rightMargin: Theme.componentMarginXL + spacing: Theme.componentMargin ButtonSolid { - anchors.verticalCenter: parent.verticalCenter - text: qsTr("OK") source: "qrc:/assets/icons_material/baseline-done-24px.svg" - color: Theme.colorPrimary onClicked: { popupMediaDirectory.close() } } } + + Item { width: 1; height: 1; } // spacer + + ////////////////// } + + //////////////////////////////////////////////////////////////////////////// } diff --git a/qml/popups/PopupMerge.qml b/qml/popups/PopupMerge.qml index 861e3c30..e23db84e 100644 --- a/qml/popups/PopupMerge.qml +++ b/qml/popups/PopupMerge.qml @@ -394,17 +394,17 @@ Popup { height: Theme.componentHeight*2 + parent.spacing anchors.right: parent.right anchors.rightMargin: 24 - spacing: 24 + spacing: 16 - ButtonWireframe { + ButtonSolid { anchors.verticalCenter: parent.verticalCenter width: 96 - //color: Theme.colorGrey + color: Theme.colorGrey text: qsTr("Cancel") onClicked: popupMerge.close() } - ButtonWireframe { + ButtonSolid { anchors.verticalCenter: parent.verticalCenter enabled: (shots_files.length > 1) diff --git a/qml/popups/PopupMove.qml b/qml/popups/PopupMove.qml index 1bcda054..74f795ee 100644 --- a/qml/popups/PopupMove.qml +++ b/qml/popups/PopupMove.qml @@ -1,6 +1,6 @@ import QtQuick +import QtQuick.Effects import QtQuick.Controls -import Qt5Compat.GraphicalEffects import ThemeEngine import StorageUtils @@ -74,29 +74,27 @@ Popup { enter: Transition { NumberAnimation { property: "opacity"; from: 0.5; to: 1.0; duration: 133; } } - background: Item { - Rectangle { - id: bgrect - anchors.fill: parent - - radius: Theme.componentRadius - color: Theme.colorBackground - border.color: Theme.colorSeparator - border.width: Theme.componentBorderWidth - } - DropShadow { - anchors.fill: parent - source: bgrect - color: "#60000000" - radius: 24 - samples: radius*2+1 - cached: true + background: Rectangle { + radius: Theme.componentRadius + color: Theme.colorBackground + border.color: Theme.colorSeparator + border.width: Theme.componentBorderWidth + + layer.enabled: true + layer.effect: MultiEffect { + autoPaddingEnabled: true + shadowEnabled: true + shadowColor: ThemeEngine.isLight ? "#aa000000" : "#aaffffff" } } //////////////////////////////////////////////////////////////////////////// contentItem: Column { + id: columnContent + //spacing: Theme.componentMarginXL + + //////// Rectangle { // titleArea anchors.left: parent.left @@ -338,17 +336,17 @@ Popup { height: Theme.componentHeight*2 + parent.spacing anchors.right: parent.right anchors.rightMargin: 24 - spacing: 24 + spacing: 16 - ButtonWireframe { + ButtonSolid { anchors.verticalCenter: parent.verticalCenter width: 96 - //color: Theme.colorGrey + color: Theme.colorGrey text: qsTr("Cancel") onClicked: popupMove.close() } - ButtonWireframe { + ButtonSolid { anchors.verticalCenter: parent.verticalCenter text: qsTr("Move") diff --git a/qml/popups/PopupOffload.qml b/qml/popups/PopupOffload.qml index 6d5e3a18..115354b0 100644 --- a/qml/popups/PopupOffload.qml +++ b/qml/popups/PopupOffload.qml @@ -423,10 +423,9 @@ Popup { Row { id: rowButtons - height: Theme.componentHeight*2 + parent.spacing anchors.right: parent.right anchors.rightMargin: 24 - spacing: 24 + spacing: 16 ButtonFlat { id: buttonCancel diff --git a/qml/popups/PopupTelemetry.qml b/qml/popups/PopupTelemetry.qml index 907f1dce..43ddc7c8 100644 --- a/qml/popups/PopupTelemetry.qml +++ b/qml/popups/PopupTelemetry.qml @@ -461,17 +461,17 @@ Popup { anchors.rightMargin: 24 spacing: 16 - ButtonWireframe { + ButtonSolid { anchors.verticalCenter: parent.verticalCenter width: 96 - //color: Theme.colorGrey + color: Theme.colorGrey text: qsTr("Close") onClicked: popupTelemetry.close() } - ButtonWireframe { + ButtonSolid { anchors.verticalCenter: parent.verticalCenter - //color: Theme.colorSecondary + color: Theme.colorSecondary text: qsTr("Extract telemetry") source: "qrc:/assets/icons_material/baseline-insert_chart-24px.svg"