Replacement for KColorButton

This commit is contained in:
Magnus Hellströmer
2025-02-28 16:29:15 +01:00
parent 01d018f8cf
commit b815244494
11 changed files with 161 additions and 44 deletions

View File

@@ -140,10 +140,7 @@ void DynamicTextFieldEditor::updateForm()
ui -> m_user_text_le -> setText(m_text_field.data() -> text());
ui -> m_size_sb -> setValue(m_text_field.data() -> font().pointSize());
ui->m_keep_visual_rotation_cb->setChecked(m_text_field.data()->keepVisualRotation());
#ifdef BUILD_WITHOUT_KF6
#else
m_color_kpb -> setColor(m_text_field.data() -> color());
#endif
ui -> m_width_sb -> setValue(m_text_field.data() -> textWidth());
ui -> m_font_pb -> setText(m_text_field -> font().family());
@@ -169,16 +166,13 @@ void DynamicTextFieldEditor::updateForm()
void DynamicTextFieldEditor::setupWidget()
{
#ifdef BUILD_WITHOUT_KF6
#else
m_color_kpb = new KColorButton(this);
m_color_kpb = new ColorButton(this);
m_color_kpb->setObjectName(QString::fromUtf8("m_color_kpb"));
connect(m_color_kpb, &KColorButton::changed,
connect(m_color_kpb, &ColorButton::changed,
this, &DynamicTextFieldEditor::on_m_color_kpb_changed);
ui->m_main_grid_layout->addWidget(m_color_kpb, 6, 1, 1, 2);
#endif
}
void DynamicTextFieldEditor::setUpConnections()

View File

@@ -21,10 +21,7 @@
#include "../elementitemeditor.h"
#include "../graphicspart/partdynamictextfield.h"
#ifdef BUILD_WITHOUT_KF6
#else
# include <KColorButton>
#endif
#include "../../colorbutton.h"
namespace Ui {
class DynamicTextFieldEditor;
@@ -77,10 +74,7 @@ class DynamicTextFieldEditor : public ElementItemEditor {
QList<PartDynamicTextField*> m_parts;
QList<QMetaObject::Connection> m_connection_list;
#ifdef BUILD_WITHOUT_KF6
#else
KColorButton* m_color_kpb = nullptr;
#endif
ColorButton* m_color_kpb = nullptr;
};
#endif // DYNAMICTEXTFIELDEDITOR_H

View File

@@ -62,10 +62,7 @@ void TextEditor::updateForm()
m_rotation_sb -> setValue(m_text -> rotation());
m_size_sb -> setValue(m_text -> font().pointSize());
m_font_pb -> setText(m_text -> font().family());
#ifdef BUILD_WITHOUT_KF6
#else
m_color_pb -> setColor(m_text -> defaultTextColor());
#endif
setUpEditConnection();
}
@@ -344,19 +341,16 @@ void TextEditor::setUpWidget(QWidget *parent)
m_line_edit->setPlaceholderText(tr("Entrer votre texte ici"));
gridLayout->addWidget(m_line_edit, 0, 0, 1, 6);
#ifdef BUILD_WITHOUT_KF6
#else
m_color_pb = new KColorButton(parent);
m_color_pb = new ColorButton(parent);
m_color_pb->setObjectName(QString::fromUtf8("m_color_pb"));
connect(
m_color_pb,
&KColorButton::changed,
&ColorButton::changed,
this,
&TextEditor::on_m_color_pb_changed);
gridLayout->addWidget(m_color_pb, 2, 5, 1, 1);
#endif
QLabel *label_5 = new QLabel(parent);
label_5->setObjectName(QString::fromUtf8("label_5"));

View File

@@ -25,10 +25,7 @@
#include <QSpinBox>
#include <QLineEdit>
#include <QPushButton>
#ifdef BUILD_WITHOUT_KF6
#else
#include <KColorButton>
#endif
#include "../../colorbutton.h"
class PartText;
class TextEditor : public ElementItemEditor {
@@ -65,10 +62,7 @@ class TextEditor : public ElementItemEditor {
QSpinBox *m_size_sb;
QLineEdit *m_line_edit;
QPushButton *m_font_pb;
#ifdef BUILD_WITHOUT_KF6
#else
KColorButton *m_color_pb;
#endif
ColorButton *m_color_pb;
};
#endif // TEXTEDITOR_H