diff --git a/src/qt/palladiumamountfield.cpp b/src/qt/palladiumamountfield.cpp index 0b90fb9..2c44899 100644 --- a/src/qt/palladiumamountfield.cpp +++ b/src/qt/palladiumamountfield.cpp @@ -190,6 +190,19 @@ protected: return QAbstractSpinBox::event(event); } + void changeEvent(QEvent *event) + { + if (event->type() == QEvent::StyleChange || + event->type() == QEvent::PaletteChange || + event->type() == QEvent::FontChange) + { + // Invalidate cached size hint when theme/style changes + cachedMinimumSizeHint = QSize(); + updateGeometry(); + } + QAbstractSpinBox::changeEvent(event); + } + StepEnabled stepEnabled() const { if (isReadOnly()) // Disable steps when AmountSpinBox is read-only diff --git a/src/qt/palladiumgui.cpp b/src/qt/palladiumgui.cpp index 5f51df2..68b6bff 100644 --- a/src/qt/palladiumgui.cpp +++ b/src/qt/palladiumgui.cpp @@ -1544,14 +1544,22 @@ void PalladiumGUI::toggleTheme() // 1. Standard Theme (Weiß) qApp->setStyleSheet(""); qApp->setPalette(style()->standardPalette()); - + // 2. Speichern, dass er aus ist settings.setValue("darkModeEnabled", false); - + if (modalOverlay) { modalOverlay->setStyleSheet(""); } } + + // Force geometry recalculation for all widgets after theme change + // This ensures proper sizing when switching between native (light) and stylesheet (dark) rendering + for (QWidget *widget : qApp->allWidgets()) { + if (widget && widget->isVisible()) { + widget->updateGeometry(); + } + } } void PalladiumGUI::checkUpdate() diff --git a/src/qt/res/styles/dark.qss b/src/qt/res/styles/dark.qss index 69f0315..0acf55a 100644 --- a/src/qt/res/styles/dark.qss +++ b/src/qt/res/styles/dark.qss @@ -432,6 +432,8 @@ PalladiumAmountField QAbstractSpinBox { background-color: #1E1E1E; color: #FFFFFF; border: 1px solid #4A4A4A; + min-height: 26px; + padding: 2px; } PalladiumAmountField QAbstractSpinBox:hover { @@ -444,6 +446,49 @@ PalladiumAmountField QAbstractSpinBox:focus { background-color: #252525; } +/* Fix for spinbox up/down buttons visibility */ +PalladiumAmountField QAbstractSpinBox::up-button, +PalladiumAmountField QAbstractSpinBox::down-button { + background-color: #2A2A2A; + border: 1px solid #3A3A3A; + width: 16px; +} + +PalladiumAmountField QAbstractSpinBox::up-button:hover, +PalladiumAmountField QAbstractSpinBox::down-button:hover { + background-color: #3A3A3A; + border: 1px solid #4A4A4A; +} + +PalladiumAmountField QAbstractSpinBox::up-button:pressed, +PalladiumAmountField QAbstractSpinBox::down-button:pressed { + background-color: #007BFF; +} + +PalladiumAmountField QAbstractSpinBox::up-arrow { + image: none; + width: 8px; + height: 8px; + border-left: 4px solid transparent; + border-right: 4px solid transparent; + border-bottom: 6px solid #808080; +} + +PalladiumAmountField QAbstractSpinBox::down-arrow { + image: none; + width: 8px; + height: 8px; + border-left: 4px solid transparent; + border-right: 4px solid transparent; + border-top: 6px solid #808080; +} + +PalladiumAmountField QAbstractSpinBox::up-arrow:hover, +PalladiumAmountField QAbstractSpinBox::down-arrow:hover { + border-bottom-color: #A0A0A0; + border-top-color: #A0A0A0; +} + PalladiumAmountField QComboBox { background-color: #1E1E1E; color: #E0E0E0;