BugFix UI Source toolbox and Display view

This commit is contained in:
Bruno Herbelin
2023-04-23 19:11:32 +02:00
parent 2891ad7efe
commit ef74faeef4
6 changed files with 25 additions and 31 deletions

View File

@@ -190,6 +190,19 @@ void DisplaysView::update(float dt)
windows_[i].output_group_->visible_ = false;
}
if ( current_window_ == i ) {
windows_[i].overlays_->setActive(1);
windows_[i].output_handles_->visible_ = true;
windows_[i].output_frame_->color = glm::vec4( COLOR_FRAME, 1.f );
windows_[i].title_->shader()->color = glm::vec4( COLOR_WINDOW, 1.f );
}
else {
windows_[i].overlays_->setActive(0);
windows_[i].output_handles_->visible_ = false;
windows_[i].output_frame_->color = glm::vec4( COLOR_FRAME, 0.3f );
windows_[i].title_->shader()->color = glm::vec4( COLOR_WINDOW, 0.8f );
}
}
output_ar = Mixer::manager().session()->frame()->aspectRatio();
@@ -684,16 +697,6 @@ std::pair<Node *, glm::vec2> DisplaysView::pick(glm::vec2 P)
(pick.first == windows_[i].output_handles_) ||
(pick.first == windows_[i].menu_) ) {
current_window_ = i;
windows_[i].overlays_->setActive(1);
windows_[i].output_handles_->visible_ = true;
windows_[i].output_frame_->color = glm::vec4( COLOR_FRAME, 1.f );
windows_[i].title_->shader()->color = glm::vec4( COLOR_WINDOW, 1.f );
}
else {
windows_[i].overlays_->setActive(0);
windows_[i].output_handles_->visible_ = false;
windows_[i].output_frame_->color = glm::vec4( COLOR_FRAME, 0.3f );
windows_[i].title_->shader()->color = glm::vec4( COLOR_WINDOW, 0.8f );
}
}
@@ -728,18 +731,9 @@ void DisplaysView::select(glm::vec2 A, glm::vec2 B)
for (; itp != pv.rend(); ++itp){
// search for WindowPreview
auto w = std::find_if(windows_.begin(), windows_.end(), WindowPreview::hasNode(itp->first));
if (w != windows_.end()) {
// cancel previous current
if (current_window_>-1) {
windows_[current_window_].overlays_->setActive(0);
windows_[current_window_].output_group_->visible_ = false;
}
if (w != windows_.end())
// set current
current_window_ = (int) std::distance(windows_.begin(), w);
windows_[current_window_].overlays_->setActive(1);
windows_[current_window_].output_group_->visible_ = true;
}
}
}

View File

@@ -396,7 +396,7 @@ void GeometryView::draw()
}
Action::manager().store(std::string("Selection: Align."));
}
if (ImGui::Selectable( ICON_FA_COMPRESS " Best Fit" )){
if (ImGui::Selectable( ICON_FA_OBJECT_GROUP " Best Fit" )){
glm::mat4 T = glm::translate(glm::identity<glm::mat4>(), -overlay_selection_->translation_);
float factor = 1.f;
float angle = -overlay_selection_->rotation_.z;

View File

@@ -129,7 +129,7 @@ void LayerView::draw()
ImGui::Separator();
// manipulation of sources in Mixing view
if (ImGui::Selectable( ICON_FA_ALIGN_CENTER " Distribute" )){
if (ImGui::Selectable( ICON_FA_GRIP_LINES_VERTICAL ICON_FA_GRIP_LINES_VERTICAL " Distribute" )){
SourceList dsl = depth_sorted(Mixer::selection().getCopy());
SourceList::iterator it = dsl.begin();
float depth = (*it)->depth();
@@ -140,7 +140,7 @@ void LayerView::draw()
}
Action::manager().store(std::string("Selection: Layer Distribute"));
}
if (ImGui::Selectable( ICON_FA_RULER_HORIZONTAL " Compress" )){
if (ImGui::Selectable( ICON_FA_CARET_RIGHT ICON_FA_CARET_LEFT " Compress" )){
SourceList dsl = depth_sorted(Mixer::selection().getCopy());
SourceList::iterator it = dsl.begin();
float depth = (*it)->depth();

View File

@@ -271,7 +271,7 @@ void MixingView::draw()
}
Action::manager().store(std::string("Selection: Mixing Distribute in circle"));
}
if (ImGui::Selectable( ICON_FA_ELLIPSIS_V " Align & Distribute" )){
if (ImGui::Selectable( ICON_FA_ALIGN_CENTER " Align & Distribute" )){
SourceList list;
glm::vec2 center = glm::vec2(0.f, 0.f);
for (SourceList::iterator it = Mixer::selection().begin(); it != Mixer::selection().end(); ++it) {

View File

@@ -1552,7 +1552,7 @@ void UserInterface::RenderSourceToolbar(bool *p_open, int* p_border, int *p_mode
ImGui::SetNextItemWidth( sliderwidth );
if ( ImGui::DragFloat("##ScaleX", &v, 1.f, -MAX_SCALE * out.x, MAX_SCALE * out.x, "%.0fpx") ) {
if (v > 10.f) {
n->scale_.x = v / out.x;
n->scale_.x = v / ( out.y * s->frame()->aspectRatio());
if (*p_mode & SourceToolbar_linkar)
n->scale_.y = n->scale_.x / ar_scale;
s->touch();
@@ -1560,7 +1560,7 @@ void UserInterface::RenderSourceToolbar(bool *p_open, int* p_border, int *p_mode
}
if (ImGui::IsItemHovered() && io.MouseWheel != 0.f && v > 10.f){
v += io.MouseWheel;
n->scale_.x = v / out.x;
n->scale_.x = v / ( out.y * s->frame()->aspectRatio());
if (*p_mode & SourceToolbar_linkar)
n->scale_.y = n->scale_.x / ar_scale;
s->touch();
@@ -1760,7 +1760,7 @@ void UserInterface::RenderSourceToolbar(bool *p_open, int* p_border, int *p_mode
ImGui::SetNextItemWidth( 2.7f * ImGui::GetTextLineHeightWithSpacing() );
if ( ImGui::DragFloat("##ScaleX", &v, 1.f, -MAX_SCALE * out.x, MAX_SCALE * out.x, "%.0f") ) {
if (v > 10.f) {
n->scale_.x = v / out.x;
n->scale_.x = v / ( out.y * s->frame()->aspectRatio());
if (*p_mode & SourceToolbar_linkar)
n->scale_.y = n->scale_.x / ar_scale;
s->touch();
@@ -1768,7 +1768,7 @@ void UserInterface::RenderSourceToolbar(bool *p_open, int* p_border, int *p_mode
}
if (ImGui::IsItemHovered() && io.MouseWheel != 0.f && v > 10.f){
v += io.MouseWheel;
n->scale_.x = v / out.x;
n->scale_.x = v / ( out.y * s->frame()->aspectRatio());
if (*p_mode & SourceToolbar_linkar)
n->scale_.y = n->scale_.x / ar_scale;
s->touch();
@@ -8900,9 +8900,9 @@ void Navigator::RenderMainPannelVimix()
ImGui::SameLine(0, ImGui::GetTextLineHeight());
ImGuiToolkit::IconToggle( ICON_FA_HAND_PAPER, &Settings::application.widget.inputs, TOOLTIP_INPUTS, SHORTCUT_INPUTS);
ImGui::SameLine(0, ImGui::GetTextLineHeight());
ImGui::SameLine(0, ImGui::GetTextLineHeight() - IMGUI_SAME_LINE);
static uint counter_menu_timeout = 0;
if ( ImGuiToolkit::IconButton( ICON_FA_ELLIPSIS_V ) || ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup) ) {
if ( ImGuiToolkit::IconButton( " " ICON_FA_ELLIPSIS_V " " ) || ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup) ) {
counter_menu_timeout=0;
ImGui::OpenPopup( "MenuToolboxWindows" );
}

View File

@@ -77,7 +77,7 @@
#define MENU_NOTE ICON_FA_STICKY_NOTE " Add sticky note"
#define MENU_METRICS ICON_FA_TACHOMETER_ALT " Metrics"
#define MENU_SOURCE_TOOL ICON_FA_VECTOR_SQUARE " Source editor"
#define MENU_SOURCE_TOOL ICON_FA_LIST_ALT " Source toolbox"
#define MENU_HELP ICON_FA_LIFE_RING " Help"
#define SHORTCUT_HELP CTRL_MOD "H"
#define MENU_LOGS ICON_FA_LIST_UL " Logs"