Unified undo history messages

This commit is contained in:
brunoherbelin
2021-04-10 00:22:16 +02:00
parent e69be79aed
commit 6e4ced8dcb
4 changed files with 24 additions and 24 deletions

View File

@@ -277,7 +277,7 @@ void GeometryView::draw()
s->group(mode_)->rotation_.z = 0;
s->group(mode_)->translation_ = glm::vec3(0.f);
s->touch();
Action::manager().store(s->name() + std::string("Source Fit."));
Action::manager().store(s->name() + std::string(": Geometry Fit"));
}
if (ImGui::Selectable( ICON_FA_VECTOR_SQUARE " Reset" )){
s->group(mode_)->scale_ = glm::vec3(1.f);
@@ -285,23 +285,23 @@ void GeometryView::draw()
s->group(mode_)->crop_ = glm::vec3(1.f);
s->group(mode_)->translation_ = glm::vec3(0.f);
s->touch();
Action::manager().store(s->name() + std::string("Source Reset."));
Action::manager().store(s->name() + std::string(": Geometry Reset"));
}
if (ImGui::Selectable( ICON_FA_CROSSHAIRS " Reset position" )){
s->group(mode_)->translation_ = glm::vec3(0.f);
s->touch();
Action::manager().store(s->name() + std::string("Source Reset position."));
Action::manager().store(s->name() + std::string(": Reset position"));
}
if (ImGui::Selectable( ICON_FA_COMPASS " Reset rotation" )){
s->group(mode_)->rotation_.z = 0;
s->touch();
Action::manager().store(s->name() + std::string("Source Reset rotation."));
Action::manager().store(s->name() + std::string(": Reset rotation"));
}
if (ImGui::Selectable( ICON_FA_EXPAND_ALT " Reset aspect ratio" )){
s->group(mode_)->scale_.x = s->group(mode_)->scale_.y;
s->group(mode_)->scale_.x *= s->group(mode_)->crop_.x / s->group(mode_)->crop_.y;
s->touch();
Action::manager().store(s->name() + std::string("Source Reset aspect ratio."));
Action::manager().store(s->name() + std::string(": Reset aspect ratio"));
}
}
ImGui::EndPopup();
@@ -325,7 +325,7 @@ void GeometryView::draw()
(*sit)->group(mode_)->translation_ = glm::vec3(0.f);
(*sit)->touch();
}
Action::manager().store(std::string("Selection Fit all."));
Action::manager().store(std::string("Selection: Fit all."));
}
if (ImGui::Selectable( ICON_FA_VECTOR_SQUARE " Reset all" )){
// apply to every sources in selection
@@ -336,7 +336,7 @@ void GeometryView::draw()
(*sit)->group(mode_)->translation_ = glm::vec3(0.f);
(*sit)->touch();
}
Action::manager().store(std::string("Selection Reset all."));
Action::manager().store(std::string("Selection: Reset all."));
}
// if (ImGui::Selectable( ICON_FA_TH " Mosaic" )){ // TODO
@@ -347,7 +347,7 @@ void GeometryView::draw()
glm::mat4 T = glm::translate(glm::identity<glm::mat4>(), -overlay_selection_->translation_);
initiate();
applySelectionTransform(T);
Action::manager().store(std::string("Selection Center."));
Action::manager().store(std::string("Selection: Center."));
}
if (ImGui::Selectable( ICON_FA_COMPASS " Align" )){
// apply to every sources in selection
@@ -355,7 +355,7 @@ void GeometryView::draw()
(*sit)->group(mode_)->rotation_.z = overlay_selection_->rotation_.z;
(*sit)->touch();
}
Action::manager().store(std::string("Selection Align."));
Action::manager().store(std::string("Selection: Align."));
}
if (ImGui::Selectable( ICON_FA_COMPRESS " Best Fit" )){
glm::mat4 T = glm::translate(glm::identity<glm::mat4>(), -overlay_selection_->translation_);
@@ -373,7 +373,7 @@ void GeometryView::draw()
glm::mat4 M = S * R * T;
initiate();
applySelectionTransform(M);
Action::manager().store(std::string("Selection Best Fit."));
Action::manager().store(std::string("Selection: Best Fit."));
}
if (ImGui::Selectable( ICON_FA_EXCHANGE_ALT " Mirror" )){
glm::mat4 T = glm::translate(glm::identity<glm::mat4>(), -overlay_selection_->translation_);
@@ -381,7 +381,7 @@ void GeometryView::draw()
glm::mat4 M = glm::inverse(T) * F * T;
initiate();
applySelectionTransform(M);
Action::manager().store(std::string("Selection Mirror."));
Action::manager().store(std::string("Selection: Mirror."));
}
ImGui::PopStyleColor(2);

View File

@@ -122,7 +122,7 @@ void LayerView::draw()
depth += depth_inc;
(*it)->setDepth(depth);
}
Action::manager().store(std::string("Selection Layer Distribute."));
Action::manager().store(std::string("Selection: Layer Distribute"));
View::need_deep_update_++;
}
if (ImGui::Selectable( ICON_FA_RULER_HORIZONTAL " Compress" )){
@@ -133,7 +133,7 @@ void LayerView::draw()
depth += LAYER_STEP;
(*it)->setDepth(depth);
}
Action::manager().store(std::string("Selection Layer Compress."));
Action::manager().store(std::string("Selection: Layer Compress"));
View::need_deep_update_++;
}
if (ImGui::Selectable( ICON_FA_EXCHANGE_ALT " Reverse order" )){
@@ -143,7 +143,7 @@ void LayerView::draw()
for (; it != dsl.end(); ++it, ++rit) {
(*it)->setDepth((*rit)->depth());
}
Action::manager().store(std::string("Selection Layer Reverse order."));
Action::manager().store(std::string("Selection: Layer Reverse order"));
View::need_deep_update_++;
}

View File

@@ -172,7 +172,7 @@ void MixingView::draw()
(*it)->group(View::MIXING)->translation_ -= glm::vec3(center, 0.f);
(*it)->touch();
}
Action::manager().store(std::string("Selection Mixing Center."));
Action::manager().store(std::string("Selection: Mixing Center"));
}
if (ImGui::Selectable( ICON_FA_HAYKAL " Distribute" )){
SourceList list;
@@ -201,21 +201,21 @@ void MixingView::draw()
(*it)->touch();
angle -= glm::two_pi<float>() / float(list.size());
}
Action::manager().store(std::string("Selection Mixing Distribute."));
Action::manager().store(std::string("Selection: Mixing Distribute"));
}
if (ImGui::Selectable( ICON_FA_CLOUD_SUN " Expand & hide" )){
SourceList::iterator it = Mixer::selection().begin();
for (; it != Mixer::selection().end(); ++it) {
(*it)->setAlpha(0.f);
}
Action::manager().store(std::string("Selection Mixing Expand & hide."));
Action::manager().store(std::string("Selection: Mixing Expand & hide"));
}
if (ImGui::Selectable( ICON_FA_SUN " Compress & show" )){
SourceList::iterator it = Mixer::selection().begin();
for (; it != Mixer::selection().end(); ++it) {
(*it)->setAlpha(0.99f);
}
Action::manager().store(std::string("Selection Mixing Compress & show."));
Action::manager().store(std::string("Selection: Mixing Compress & show"));
}
ImGui::PopStyleColor(2);
ImGui::EndPopup();

View File

@@ -843,12 +843,12 @@ void TextureView::draw()
if (s->textureMirrored()) {
if (ImGui::Selectable( ICON_FA_TH " Repeat " )){
s->setTextureMirrored(false);
Action::manager().store(s->name() + std::string(": Texture Repeat."));
Action::manager().store(s->name() + std::string(": Texture Repeat"));
}
} else {
if (ImGui::Selectable( ICON_FA_TH " Mirror " )){
s->setTextureMirrored(true);
Action::manager().store(s->name() + std::string(": Texture Mirror."));
Action::manager().store(s->name() + std::string(": Texture Mirror"));
}
}
ImGui::Separator();
@@ -859,23 +859,23 @@ void TextureView::draw()
s->group(mode_)->crop_ = glm::vec3(1.f);
s->group(mode_)->translation_ = glm::vec3(0.f);
s->touch();
Action::manager().store(s->name() + std::string(": Texture Reset."));
Action::manager().store(s->name() + std::string(": Texture Reset"));
}
if (ImGui::Selectable( ICON_FA_CROSSHAIRS " Reset position" )){
s->group(mode_)->translation_ = glm::vec3(0.f);
s->touch();
Action::manager().store(s->name() + std::string(": Texture Reset position."));
Action::manager().store(s->name() + std::string(": Texture Reset position"));
}
if (ImGui::Selectable( ICON_FA_COMPASS " Reset rotation" )){
s->group(mode_)->rotation_.z = 0;
s->touch();
Action::manager().store(s->name() + std::string(": Texture Reset rotation."));
Action::manager().store(s->name() + std::string(": Texture Reset rotation"));
}
if (ImGui::Selectable( ICON_FA_EXPAND_ALT " Reset aspect ratio" )){
s->group(mode_)->scale_.x = s->group(mode_)->scale_.y;
s->group(mode_)->scale_.x *= s->group(mode_)->crop_.x / s->group(mode_)->crop_.y;
s->touch();
Action::manager().store(s->name() + std::string(": Texture Reset aspect ratio."));
Action::manager().store(s->name() + std::string(": Texture Reset aspect ratio"));
}
}
ImGui::PopStyleColor(2);