mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
Element editor: make element text option "keep visual rotation" editable.
This commit is contained in:
@@ -139,6 +139,7 @@ void DynamicTextFieldEditor::updateForm()
|
||||
ui -> m_frame_cb -> setChecked(m_text_field.data() -> frame());
|
||||
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_KF5
|
||||
#else
|
||||
m_color_kpb -> setColor(m_text_field.data() -> color());
|
||||
@@ -176,7 +177,7 @@ void DynamicTextFieldEditor::setupWidget()
|
||||
connect(m_color_kpb, &KColorButton::changed,
|
||||
this, &DynamicTextFieldEditor::on_m_color_kpb_changed);
|
||||
|
||||
ui->m_main_grid_layout->addWidget(m_color_kpb, 7, 1, 1, 2);
|
||||
ui->m_main_grid_layout->addWidget(m_color_kpb, 6, 1, 1, 2);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -204,6 +205,8 @@ void DynamicTextFieldEditor::setUpConnections()
|
||||
[this](){this -> updateForm();});
|
||||
m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::compositeTextChanged,
|
||||
[this](){this -> updateForm();});
|
||||
m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::keepVisualRotationChanged,
|
||||
[this](){this -> updateForm();});
|
||||
}
|
||||
|
||||
void DynamicTextFieldEditor::disconnectConnections()
|
||||
@@ -434,3 +437,16 @@ void DynamicTextFieldEditor::on_m_color_kpb_changed(const QColor &newColor) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DynamicTextFieldEditor::on_m_keep_visual_rotation_cb_clicked()
|
||||
{
|
||||
bool keep = ui -> m_keep_visual_rotation_cb -> isChecked();
|
||||
|
||||
for (int i = 0; i < m_parts.length(); i++) {
|
||||
if(keep != m_parts[i] -> keepVisualRotation()) {
|
||||
QPropertyUndoCommand *undo = new QPropertyUndoCommand(m_parts[i], "keepVisualRotation", m_parts[i] -> frame(), keep);
|
||||
undo -> setText(tr("Modifier la conservation de l'angle"));
|
||||
undoStack().push(undo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user