chore: 格式化ElaWidgetTools代码

This commit is contained in:
sleepwithoutbz
2025-09-20 01:39:00 +08:00
parent d2fded145d
commit 4ab391f8a1
394 changed files with 10913 additions and 15860 deletions

View File

@@ -20,13 +20,12 @@ class ElaPushButton;
class ElaToolButton;
class QSlider;
class ElaColorValueSliderStyle;
class ElaColorDialogPrivate : public QObject
{
class ElaColorDialogPrivate : public QObject {
Q_OBJECT
Q_D_CREATE(ElaColorDialog)
Q_PROPERTY_CREATE_D(QColor, CurrentColor)
public:
explicit ElaColorDialogPrivate(QObject* parent = nullptr);
explicit ElaColorDialogPrivate(QObject *parent = nullptr);
~ElaColorDialogPrivate();
Q_SLOT void onColorPickerColorChanged(QColor selectedColor);
@@ -34,53 +33,53 @@ public:
Q_SLOT void onColorModeChanged(int index);
Q_SLOT void onHtmlEditFocusOut(QString text);
Q_SLOT void onHtmlEditChanged(const QString& text);
Q_SLOT void onColorEditChanged(const QString& text);
Q_SLOT void onHtmlEditChanged(const QString &text);
Q_SLOT void onColorEditChanged(const QString &text);
Q_SLOT void onBasicColorViewClicked(const QModelIndex& index);
Q_SLOT void onCustomColorViewClicked(const QModelIndex& index);
Q_SLOT void onBasicColorViewClicked(const QModelIndex &index);
Q_SLOT void onCustomColorViewClicked(const QModelIndex &index);
Q_SLOT void onAddCustomColorButtonClicked();
Q_SLOT void onRemoveCustomColorButtonClicked();
private:
ElaThemeType::ThemeMode _themeMode;
ElaAppBar* _appBar{nullptr};
ElaColorPicker* _colorPicker{nullptr};
ElaColorPreview* _colorPreview{nullptr};
QSlider* _colorValueSlider{nullptr};
ElaColorValueSliderStyle* _colorValueSliderStyle{nullptr};
ElaLineEdit* _htmlEdit{nullptr};
ElaComboBox* _modeComboBox{nullptr};
ElaLineEdit* _firstEdit{nullptr};
ElaLineEdit* _secondEdit{nullptr};
ElaLineEdit* _thridEdit{nullptr};
ElaText* _firstText{nullptr};
ElaText* _secondText{nullptr};
ElaText* _thridText{nullptr};
ElaThemeType::ThemeMode _themeMode;
ElaAppBar *_appBar{nullptr};
ElaColorPicker *_colorPicker{nullptr};
ElaColorPreview *_colorPreview{nullptr};
QSlider *_colorValueSlider{nullptr};
ElaColorValueSliderStyle *_colorValueSliderStyle{nullptr};
ElaLineEdit *_htmlEdit{nullptr};
ElaComboBox *_modeComboBox{nullptr};
ElaLineEdit *_firstEdit{nullptr};
ElaLineEdit *_secondEdit{nullptr};
ElaLineEdit *_thridEdit{nullptr};
ElaText *_firstText{nullptr};
ElaText *_secondText{nullptr};
ElaText *_thridText{nullptr};
ElaBaseListView* _basicColorView{nullptr};
ElaColorDisplayModel* _basicColorModel{nullptr};
ElaColorDisplayDelegate* _basicColorDelegate{nullptr};
ElaBaseListView *_basicColorView{nullptr};
ElaColorDisplayModel *_basicColorModel{nullptr};
ElaColorDisplayDelegate *_basicColorDelegate{nullptr};
ElaToolButton* _addCustomColorButton{nullptr};
ElaToolButton* _removeCustomColorButton{nullptr};
ElaBaseListView* _customColorView{nullptr};
ElaColorDisplayModel* _customColorModel{nullptr};
ElaColorDisplayDelegate* _customColorDelegate{nullptr};
ElaToolButton *_addCustomColorButton{nullptr};
ElaToolButton *_removeCustomColorButton{nullptr};
ElaBaseListView *_customColorView{nullptr};
ElaColorDisplayModel *_customColorModel{nullptr};
ElaColorDisplayDelegate *_customColorDelegate{nullptr};
ElaPushButton* _overButton{nullptr};
ElaPushButton* _cancelButton{nullptr};
ElaPushButton *_overButton{nullptr};
ElaPushButton *_cancelButton{nullptr};
void _initBasicColor();
void _initCustomColor();
void _updateHtmlEditValue();
void _updateEditValue();
void _updateColorPreview();
void _updateColorValueSlider();
void _initBasicColor();
void _initCustomColor();
void _updateHtmlEditValue();
void _updateEditValue();
void _updateColorPreview();
void _updateColorValueSlider();
QString _completeColorText(QString text) const;
QString _getHexRgbValue() const;
QColor _getColorFromEdit() const;
QColor _getColorFromEdit() const;
};
#endif // ELACOLORDIALOGPRIVATE_H