mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-22 17:45:09 -07:00
[App/Theme] Palette Editor (#6877)
* [App/Theme] Palette Editor Took 1 minute Took 1 hour 47 minutes Took 6 seconds Took 3 minutes Took 5 minutes Took 3 minutes * Add oracle, add palette files and configs. Took 10 minutes * Fix a stupid include mistake, thanks IDE Took 3 minutes Took 20 seconds * Includes. Took 4 minutes * Fix ampersand not displaying correctly. Took 14 minutes * Longer variable names. Took 10 minutes Took 5 seconds * Change ampersand everywhere Took 23 seconds * Doxygen properly. Took 1 minute * Remove namespace, fold I/O into structs. Took 12 minutes * Remove namespace, fold I/O into structs. Took 33 seconds * Alphabetize. Took 35 seconds * Lint. Took 49 seconds * Add a combo box to quick switch settings. Took 19 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
989a5be23b
commit
117ea543c5
23 changed files with 1874 additions and 232 deletions
94
cockatrice/src/interface/palette_editor/quick_setup_panel.h
Normal file
94
cockatrice/src/interface/palette_editor/quick_setup_panel.h
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
#ifndef COCKATRICE_QUICK_SETUP_PANEL_H
|
||||
#define COCKATRICE_QUICK_SETUP_PANEL_H
|
||||
|
||||
#include "color_button.h"
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
class QPushButton;
|
||||
class QHBoxLayout;
|
||||
class QLabel;
|
||||
class QSlider;
|
||||
|
||||
/**
|
||||
* @class QuickSetupPanel
|
||||
* @brief Provides a compact "Quick Setup" interface for generating theme palettes.
|
||||
*
|
||||
* The panel contains:
|
||||
* - an accent color picker,
|
||||
* - an intensity slider,
|
||||
* - and a generate button.
|
||||
*
|
||||
* When the user clicks the generate button, the panel emits
|
||||
* generateRequested() with the currently selected accent color
|
||||
* and intensity value.
|
||||
*
|
||||
* Typically used together with PaletteGenerator::fromAccent()
|
||||
* to quickly generate color schemes from a chosen accent color.
|
||||
*/
|
||||
class QuickSetupPanel : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Constructs the quick setup panel.
|
||||
*
|
||||
* @param parent Optional parent widget.
|
||||
*/
|
||||
explicit QuickSetupPanel(QWidget *parent = nullptr);
|
||||
|
||||
/**
|
||||
* @brief Retranslates all user-visible strings.
|
||||
*
|
||||
* Intended to be called when the application language changes.
|
||||
*/
|
||||
void retranslateUi();
|
||||
|
||||
/**
|
||||
* @brief Returns the currently selected accent color.
|
||||
*
|
||||
* @return The selected accent color.
|
||||
*/
|
||||
QColor accentColor() const;
|
||||
|
||||
/**
|
||||
* @brief Returns the current intensity slider value.
|
||||
*
|
||||
* @return The selected intensity value.
|
||||
*/
|
||||
int intensity() const;
|
||||
|
||||
/**
|
||||
* @brief Updates the displayed accent color.
|
||||
*
|
||||
* Used by the parent dialog when switching schemes to keep
|
||||
* the color swatch synchronized with the active palette.
|
||||
*
|
||||
* @param c The new accent color.
|
||||
*/
|
||||
void setAccentColor(const QColor &c);
|
||||
|
||||
signals:
|
||||
/**
|
||||
* @brief Emitted when the user requests palette generation.
|
||||
*
|
||||
* @param accent The selected accent color.
|
||||
* @param intensity The selected intensity value.
|
||||
*/
|
||||
void generateRequested(QColor accent, int intensity);
|
||||
|
||||
private:
|
||||
QHBoxLayout *layout;
|
||||
QLabel *heading;
|
||||
QLabel *accentLabel;
|
||||
ColorButton *accentButton;
|
||||
QLabel *intensityLabel;
|
||||
QLabel *labelLow;
|
||||
QLabel *labelHigh;
|
||||
QSlider *intensitySlider;
|
||||
QLabel *intensityPercentageLabel;
|
||||
QPushButton *generateButton;
|
||||
};
|
||||
|
||||
#endif // COCKATRICE_QUICK_SETUP_PANEL_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue