diff --git a/rsc/images/icons.dds b/rsc/images/icons.dds index 0a5065c..270174c 100644 Binary files a/rsc/images/icons.dds and b/rsc/images/icons.dds differ diff --git a/src/ImGuiToolkit.cpp b/src/ImGuiToolkit.cpp index 97b984a..7e32083 100644 --- a/src/ImGuiToolkit.cpp +++ b/src/ImGuiToolkit.cpp @@ -610,6 +610,8 @@ bool ImGuiToolkit::SelectableIcon(int i, int j, const char* label, bool selected char text_buf[256]; ImFormatString(text_buf, IM_ARRAYSIZE(text_buf), "%s%s", space_buf, label); + ImGui::PushID( i * 20 + j + ImGui::GetID("##SelectableIcon") ); + // draw menu item bool ret = ImGui::Selectable(text_buf, selected, ImGuiSelectableFlags_None, size_arg); @@ -620,6 +622,8 @@ bool ImGuiToolkit::SelectableIcon(int i, int j, const char* label, bool selected // overlay of icon on top of first item _drawIcon(draw_pos, i, j); + ImGui::PopID(); + return ret; } diff --git a/src/ImGuiVisitor.cpp b/src/ImGuiVisitor.cpp index 79c8459..47b340c 100644 --- a/src/ImGuiVisitor.cpp +++ b/src/ImGuiVisitor.cpp @@ -935,7 +935,7 @@ void ImGuiVisitor::visit (RenderSource& s) } // icon to open output view ImGui::SetCursorPos(top); - if (ImGuiToolkit::IconButton(ICON_FA_LAPTOP, "Open Display")) + if (ImGuiToolkit::IconButton(ICON_FA_DESKTOP, "Open Display")) Settings::application.widget.preview = true; } else diff --git a/src/OutputPreviewWindow.cpp b/src/OutputPreviewWindow.cpp index cdf532d..88f328a 100644 --- a/src/OutputPreviewWindow.cpp +++ b/src/OutputPreviewWindow.cpp @@ -224,7 +224,8 @@ void OutputPreviewWindow::Render() if (ImGui::BeginMenu(IMGUI_TITLE_PREVIEW)) { // Preview and output menu - ImGui::MenuItem( MENU_LARGEPREVIEW, SHORTCUT_LARGEPREVIEW, &UserInterface::manager().show_output_fullview); + if (ImGuiToolkit::MenuItemIcon(ICON_PREVIEW, MENU_PREVIEW, SHORTCUT_PREVIEW) ) + UserInterface::manager().show_output_fullview = true; ImGui::MenuItem( MENU_OUTPUTDISABLE, SHORTCUT_OUTPUTDISABLE, &Settings::application.render.disabled); // Display window manager menu @@ -570,7 +571,7 @@ void OutputPreviewWindow::Render() h += (Settings::application.accept_connections ? 1.f : 0.f); draw_list->AddRectFilled(draw_pos, ImVec2(draw_pos.x + imagesize.x, draw_pos.y + h * r), IMGUI_COLOR_OVERLAY); ImGui::SetCursorScreenPos(draw_pos); - ImGui::Text(" " ICON_FA_LAPTOP " %d x %d px, %.d fps", output->width(), output->height(), int(Mixer::manager().fps()) ); + ImGui::Text(" " ICON_FA_DESKTOP " %d x %d px, %.d fps", output->width(), output->height(), int(Mixer::manager().fps()) ); if (Settings::application.accept_connections) ImGui::Text( " " ICON_FA_SHARE_ALT_SQUARE " Available as %s (%ld peer connected)", Connection::manager().info().name.c_str(), diff --git a/src/UserInterfaceManager.cpp b/src/UserInterfaceManager.cpp index 6cb0d92..e428a09 100644 --- a/src/UserInterfaceManager.cpp +++ b/src/UserInterfaceManager.cpp @@ -1292,6 +1292,15 @@ void UserInterface::RenderOutputView() // draw inspector (magnifying glass) if ( _inspector && ImGui::IsItemHovered() ) DrawInspector(output->texture(), imagesize, imagesize, draw_pos); + + // closing icon + ImGui::SetCursorScreenPos(draw_pos + ImVec2(IMGUI_SAME_LINE, IMGUI_SAME_LINE)); + ImGuiToolkit::PushFont(ImGuiToolkit::FONT_LARGE); + if ( ImGuiToolkit::IconButton(ICON_FA_TIMES, "Close preview") ) + show_output_fullview = false; + if ( ImGui::IsItemHovered() ) + _inspector = false; + ImGui::PopFont(); } // local keyboard handler (because focus is captured by modal dialog) @@ -2352,6 +2361,10 @@ void UserInterface::RenderHelp() ImGui::SetColumnWidth(0, width_column0); ImGui::PushTextWrapPos(width_window ); + ImGui::Text(ICON_FA_MOUSE_POINTER " Snap cursor"); ImGui::NextColumn(); + ImGui::Text ("Snapping mouse cursors modify the mouse effective position to enhace the movement: e.g. snap to grid, move on a line, or trigger on metronome. " + "They are activated with the [" ALT_MOD "] key" ); + ImGui::NextColumn(); ImGui::Text(ICON_FA_BULLSEYE " Mixing"); ImGui::NextColumn(); ImGui::Text ("Adjust opacity of sources, visible in the center and transparent on the side. Sources are de-activated outside of darker circle."); ImGui::NextColumn(); @@ -2359,7 +2372,7 @@ void UserInterface::RenderHelp() ImGui::Text ("Move, scale, rotate or crop sources to place them in the output frame."); ImGui::NextColumn(); ImGuiToolkit::Icon(ICON_WORKSPACE); ImGui::SameLine(0, IMGUI_SAME_LINE); ImGui::Text("Layers"); ImGui::NextColumn(); - ImGui::Text ("Organize the rendering order of sources, from background to foreground."); + ImGui::Text ("Organize the rendering order of sources in depth, from background to foreground."); ImGui::NextColumn(); ImGui::Text(ICON_FA_CHESS_BOARD " Texturing"); ImGui::NextColumn(); ImGui::Text ("Apply masks or freely paint the texture on the source surface. Repeat or crop the graphics."); @@ -2379,7 +2392,7 @@ void UserInterface::RenderHelp() ImGui::PushTextWrapPos(width_window ); ImGui::Text(IMGUI_TITLE_PREVIEW); ImGui::NextColumn(); - ImGui::Text ("Preview the output displayed in the rendering window. Control video recording and streaming."); + ImGui::Text ("Preview the output displayed in the rendering window(s). Control video recording and streaming."); ImGui::NextColumn(); ImGui::Text(IMGUI_TITLE_MEDIAPLAYER); ImGui::NextColumn(); ImGui::Text ("Play, pause, rewind videos or dynamic sources. Control play duration, speed and synchronize multiple videos."); @@ -2540,6 +2553,10 @@ void UserInterface::RenderHelp() ImGui::Text(ICON_FA_BACKSPACE " Delete source"); ImGui::NextColumn(); ImGui::Text("TAB"); ImGui::NextColumn(); ImGui::Text(ICON_FA_EXCHANGE_ALT " Switch Current source"); ImGui::NextColumn(); + ImGui::Text("[ 0 ][ i ]..[ 9 ]"); ImGui::NextColumn(); + ImGui::Text(ICON_FA_HASHTAG " Switch to source at index i"); ImGui::NextColumn(); + ImGui::Text(ALT_MOD); ImGui::NextColumn(); + ImGui::Text(ICON_FA_MOUSE_POINTER " Activate Snap mouse cursor"); ImGui::NextColumn(); ImGui::Text("F1"); ImGui::NextColumn(); ImGui::Text(ICON_FA_BULLSEYE " Mixing view"); ImGui::NextColumn(); ImGui::Text("F2"); ImGui::NextColumn(); @@ -2550,13 +2567,15 @@ void UserInterface::RenderHelp() ImGui::Text(ICON_FA_CHESS_BOARD " Texturing view"); ImGui::NextColumn(); ImGui::Text("F5"); ImGui::NextColumn(); ImGui::Text(ICON_FA_TV " Displays view"); ImGui::NextColumn(); + ImGui::Text(SHORTCUT_PREVIEW); ImGui::NextColumn(); + ImGuiToolkit::Icon(ICON_PREVIEW); ImGui::SameLine(0, IMGUI_SAME_LINE); ImGui::Text("Preview output (toggle or long press)"); ImGui::NextColumn(); ImGui::Text(CTRL_MOD "TAB"); ImGui::NextColumn(); ImGui::Text("Switch view"); ImGui::NextColumn(); ImGui::Text(SHORTCUT_FULLSCREEN); ImGui::NextColumn(); ImGui::Text(ICON_FA_EXPAND_ALT " " TOOLTIP_FULLSCREEN " window"); ImGui::NextColumn(); ImGui::Separator(); ImGui::Text(SHORTCUT_OUTPUT); ImGui::NextColumn(); - ImGui::Text(ICON_FA_LAPTOP " " TOOLTIP_OUTPUT "window"); ImGui::NextColumn(); + ImGui::Text(ICON_FA_DESKTOP " " TOOLTIP_OUTPUT "window"); ImGui::NextColumn(); ImGui::Text(SHORTCUT_PLAYER); ImGui::NextColumn(); ImGui::Text(ICON_FA_PLAY_CIRCLE " " TOOLTIP_PLAYER "window" ); ImGui::NextColumn(); ImGui::Text(SHORTCUT_TIMER); ImGui::NextColumn(); @@ -2566,7 +2585,7 @@ void UserInterface::RenderHelp() ImGui::Text(SHORTCUT_SHADEREDITOR); ImGui::NextColumn(); ImGui::Text(ICON_FA_CODE " " TOOLTIP_SHADEREDITOR "window"); ImGui::NextColumn(); ImGui::Text("ESC"); ImGui::NextColumn(); - ImGui::Text(" Hide / Show all windows"); ImGui::NextColumn(); + ImGui::Text(" Hide / Show all windows (toggle or long press)"); ImGui::NextColumn(); ImGui::Separator(); ImGui::Text(SHORTCUT_NEW_FILE); ImGui::NextColumn(); ImGui::Text(MENU_NEW_FILE " session"); ImGui::NextColumn(); @@ -2596,8 +2615,6 @@ void UserInterface::RenderHelp() ImGui::Text(MENU_CAPTUREFRAME " display"); ImGui::NextColumn(); ImGui::Text(SHORTCUT_OUTPUTDISABLE); ImGui::NextColumn(); ImGui::Text(MENU_OUTPUTDISABLE " display output"); ImGui::NextColumn(); - ImGui::Text(SHORTCUT_LARGEPREVIEW); ImGui::NextColumn(); - ImGui::Text(MENU_LARGEPREVIEW " of output"); ImGui::NextColumn(); ImGui::Text(SHORTCUT_RECORD); ImGui::NextColumn(); ImGui::Text(MENU_RECORD " Output"); ImGui::NextColumn(); ImGui::Text(SHORTCUT_RECORDCONT); ImGui::NextColumn(); @@ -3010,9 +3027,12 @@ void Navigator::Render() view_options_timeout = 0; } - if (ImGui::Selectable( ICON_FA_TV, &selected_view[View::DISPLAYS], 0, iconsize)) + int j = Settings::application.render.disabled ? 8 : 7; + if (ImGuiToolkit::SelectableIcon(10, j, "", selected_view[View::DISPLAYS], iconsize)) +// if (ImGui::Selectable( ICON_FA_TV, &selected_view[View::DISPLAYS], 0, iconsize)) { UserInterface::manager().setView(View::DISPLAYS); + Settings::application.current_view = View::DISPLAYS; if (previous_view == Settings::application.current_view) { ImGui::OpenPopup( "PopupViewOptions" ); view_options_pos = ImGui::GetCursorScreenPos(); @@ -4649,7 +4669,7 @@ void Navigator::RenderMainPannelVimix() ImGui::SameLine(0, 0.5f * ImGui::GetTextLineHeight()); on = Settings::application.widget.preview; - if (ImGuiToolkit::IconToggle( ICON_FA_LAPTOP, &on, TOOLTIP_OUTPUT, SHORTCUT_OUTPUT)) + if (ImGuiToolkit::IconToggle( ICON_FA_DESKTOP, &on, TOOLTIP_OUTPUT, SHORTCUT_OUTPUT)) UserInterface::manager().outputcontrol.setVisible(on); ImGui::SameLine(0, ImGui::GetTextLineHeight()); diff --git a/src/defines.h b/src/defines.h index 445a1de..dd0918c 100644 --- a/src/defines.h +++ b/src/defines.h @@ -128,7 +128,7 @@ #define IMGUI_TITLE_HELP ICON_FA_LIFE_RING " Help" #define IMGUI_TITLE_TOOLBOX ICON_FA_HAMSA " Guru Toolbox" #define IMGUI_TITLE_SHADEREDITOR ICON_FA_CODE " Shader Editor" -#define IMGUI_TITLE_PREVIEW ICON_FA_LAPTOP " Display" +#define IMGUI_TITLE_PREVIEW ICON_FA_DESKTOP " Display" #ifdef APPLE #define CTRL_MOD "Cmd+" @@ -180,8 +180,9 @@ #define SHORTCUT_CAPTURE_GUI "F9" #define MENU_OUTPUTDISABLE ICON_FA_EYE_SLASH " Disable" #define SHORTCUT_OUTPUTDISABLE "F12" -#define MENU_LARGEPREVIEW ICON_FA_EXPAND_ARROWS_ALT " Large preview" -#define SHORTCUT_LARGEPREVIEW "F6" +#define ICON_PREVIEW 4, 15 +#define MENU_PREVIEW "Preview" +#define SHORTCUT_PREVIEW "F6" #define MENU_CLOSE ICON_FA_TIMES " Close" #define DIALOG_FAILED_SOURCE ICON_FA_EXCLAMATION_TRIANGLE " Source failure"