From 6e4ced8dcb95e0db07f4c138edee693122ebeab8 Mon Sep 17 00:00:00 2001 From: brunoherbelin Date: Sat, 10 Apr 2021 00:22:16 +0200 Subject: [PATCH] Unified undo history messages --- GeometryView.cpp | 22 +++++++++++----------- LayerView.cpp | 6 +++--- MixingView.cpp | 8 ++++---- TextureView.cpp | 12 ++++++------ 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/GeometryView.cpp b/GeometryView.cpp index 580efcd..49bf0af 100644 --- a/GeometryView.cpp +++ b/GeometryView.cpp @@ -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(), -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(), -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(), -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); diff --git a/LayerView.cpp b/LayerView.cpp index 6d0ccab..3e253fc 100644 --- a/LayerView.cpp +++ b/LayerView.cpp @@ -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_++; } diff --git a/MixingView.cpp b/MixingView.cpp index b7d9f65..44ed867 100644 --- a/MixingView.cpp +++ b/MixingView.cpp @@ -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(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(); diff --git a/TextureView.cpp b/TextureView.cpp index eea1304..99d8b79 100644 --- a/TextureView.cpp +++ b/TextureView.cpp @@ -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);