|
| 1 | +// SPDX-FileCopyrightText: 2026 EasyReflectometry contributors <support@easyreflectometry.org> |
| 2 | +// SPDX-License-Identifier: BSD-3-Clause |
| 3 | +// © 2026 Contributors to the EasyReflectometry project <https://github.com/easyscience/EasyReflectometry> |
| 4 | + |
| 5 | +import QtQuick |
| 6 | +import QtQuick.Controls |
| 7 | +import QtQuick.Controls.Material |
| 8 | + |
| 9 | +import EasyApp.Gui.Style as EaStyle |
| 10 | +import EasyApp.Gui.Animations as EaAnimations |
| 11 | +import EasyApp.Gui.Elements as EaElements |
| 12 | + |
| 13 | +Item { |
| 14 | + id: sideBarContainer |
| 15 | + |
| 16 | + property alias tabs: tabs.contentData |
| 17 | + property alias items: items.contentData |
| 18 | + |
| 19 | + property alias continueButton: continueButton |
| 20 | + property Component footerComponent: null |
| 21 | + |
| 22 | + anchors.fill: parent |
| 23 | + |
| 24 | + // Sidebar tabs |
| 25 | + EaElements.TabBar { |
| 26 | + id: tabs |
| 27 | + |
| 28 | + anchors.top: sideBarContainer.top |
| 29 | + anchors.left: sideBarContainer.left |
| 30 | + anchors.right: sideBarContainer.right |
| 31 | + } |
| 32 | + // Sidebar tabs |
| 33 | + |
| 34 | + // Sidebar content |
| 35 | + SwipeView { |
| 36 | + id: items |
| 37 | + |
| 38 | + anchors.top: tabs.bottom |
| 39 | + anchors.bottom: footerLoader.top |
| 40 | + anchors.left: sideBarContainer.left |
| 41 | + anchors.right: sideBarContainer.right |
| 42 | + |
| 43 | + anchors.bottomMargin: EaStyle.Sizes.fontPixelSize |
| 44 | + |
| 45 | + clip: true |
| 46 | + interactive: false |
| 47 | + |
| 48 | + currentIndex: tabs.currentIndex |
| 49 | + } |
| 50 | + // Sidebar content |
| 51 | + |
| 52 | + // Footer content (pinned above continue button) |
| 53 | + Loader { |
| 54 | + id: footerLoader |
| 55 | + |
| 56 | + active: sideBarContainer.footerComponent !== null |
| 57 | + sourceComponent: sideBarContainer.footerComponent |
| 58 | + |
| 59 | + anchors.bottom: continueButton.visible ? continueButton.top : sideBarContainer.bottom |
| 60 | + anchors.horizontalCenter: sideBarContainer.horizontalCenter |
| 61 | + |
| 62 | + anchors.bottomMargin: footerLoader.item ? 0.25 * EaStyle.Sizes.fontPixelSize : 0 |
| 63 | + } |
| 64 | + // Footer content |
| 65 | + |
| 66 | + // Continue button |
| 67 | + EaElements.SideBarButton { |
| 68 | + id: continueButton |
| 69 | + |
| 70 | + showBackground: false |
| 71 | + |
| 72 | + anchors.bottom: sideBarContainer.bottom |
| 73 | + anchors.horizontalCenter: sideBarContainer.horizontalCenter |
| 74 | + |
| 75 | + anchors.bottomMargin: 0.5 * EaStyle.Sizes.fontPixelSize |
| 76 | + |
| 77 | + fontIcon: "arrow-circle-right" |
| 78 | + text: qsTr("Continue") |
| 79 | + } |
| 80 | + // Continue button |
| 81 | + |
| 82 | + // Gradient area above button |
| 83 | + Rectangle { |
| 84 | + height: 1.25 * EaStyle.Sizes.fontPixelSize |
| 85 | + anchors.bottom: footerLoader.top |
| 86 | + anchors.left: sideBarContainer.left |
| 87 | + anchors.right: sideBarContainer.right |
| 88 | + |
| 89 | + anchors.bottomMargin: 0.85 * EaStyle.Sizes.fontPixelSize |
| 90 | + anchors.leftMargin: EaStyle.Sizes.fontPixelSize |
| 91 | + anchors.rightMargin: EaStyle.Sizes.fontPixelSize |
| 92 | + |
| 93 | + gradient: Gradient{ |
| 94 | + GradientStop{ position : 0.0; color: `${EaStyle.Colors.contentBackground}`.replace('#', '#00')} |
| 95 | + GradientStop{ position : 1.0; color: `${EaStyle.Colors.contentBackground}`.replace('#', '#ff')} |
| 96 | + } |
| 97 | + } |
| 98 | + // Gradient area above button |
| 99 | + |
| 100 | +} |
0 commit comments