from PyQt6.QtWidgets import QComboBox, QLabel, QPushButton from PyQt6 import QtCore from gui.v2.ui.pages.Page import Page class DurationSelectionPage(Page): def __init__(self, page_stack, main_window=None, parent=None): super().__init__("Select Duration", page_stack, main_window, parent) self.update_status = main_window self.create_interface_elements() self.button_reverse.setVisible(True) def create_interface_elements(self): self.title = QLabel("Select Duration", self) self.title.setGeometry(QtCore.QRect(530, 30, 210, 40)) self.title.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter) self.button_reverse.clicked.connect(self.reverse) self.combo_box = QComboBox(self) self.combo_box.setGeometry(200, 200, 400, 60) self.combo_box.addItems( ["1 month (€1.50)", "3 months (€4.30)", "6 months (€8)", "12 months (€16)"]) self.combo_box.setEditable(False) self.combo_box.setMaxVisibleItems(4) self.combo_box.setDuplicatesEnabled(True) self.combo_box.setPlaceholderText("Select options") self.combo_box.setStyleSheet(""" QComboBox { font-size: 16px; padding: 10px; background-color: #000000; color: #00ffff; border: 2px solid #00ffff; border-radius: 8px; } QComboBox::drop-down { width: 30px; background-color: #1a1a1a; border-left: 1px solid #00ffff; } QComboBox::down-arrow { width: 12px; height: 12px; color: #00ffff; } QComboBox QAbstractItemView { background-color: #0a0a0a; border: 1px solid #00ffff; border-radius: 4px; selection-background-color: #003333; selection-color: #00ffff; } QComboBox QAbstractItemView::item { padding: 8px; border: none; color: #00ffff; background-color: #0a0a0a; } QComboBox QAbstractItemView::item:hover { background-color: #1a1a1a; color: #00ffff; } QComboBox QAbstractItemView::item:selected { background-color: #003333; color: #00ffff; } """) self.next_button = QPushButton("Next", self) self.next_button.setGeometry(350, 300, 100, 40) self.next_button.setStyleSheet(""" QPushButton { font-size: 18px; padding: 10px; border: 2px solid #ccc; border-radius: 10px; background-color: cyan; color: black; font-weight: bold; } """) self.next_button.clicked.connect(self.show_next) def show_next(self): self.custom_window.navigator.navigate("currency_selection") currency_page = self.custom_window.navigator.get_cached("currency_selection") if currency_page is not None: currency_page.selected_duration = self.combo_box.currentText() def reverse(self): self.custom_window.navigator.navigate("id")