mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 18:34:58 +01:00
Improved UI tooltips
This commit is contained in:
@@ -53,9 +53,9 @@ void ImGuiToolkit::ButtonOpenUrl( const char* label, const char* url, const ImVe
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool ImGuiToolkit::ButtonToggle( const char* label, bool* toggle )
|
bool ImGuiToolkit::ButtonToggle( const char* label, bool* toggle, const char *tooltip)
|
||||||
{
|
{
|
||||||
ImVec4* colors = ImGui::GetStyle().Colors;
|
const ImVec4* colors = ImGui::GetStyle().Colors;
|
||||||
const auto active = *toggle;
|
const auto active = *toggle;
|
||||||
if( active ) {
|
if( active ) {
|
||||||
ImGui::PushStyleColor( ImGuiCol_Button, colors[ImGuiCol_TabActive] );
|
ImGui::PushStyleColor( ImGuiCol_Button, colors[ImGuiCol_TabActive] );
|
||||||
@@ -63,6 +63,8 @@ bool ImGuiToolkit::ButtonToggle( const char* label, bool* toggle )
|
|||||||
ImGui::PushStyleColor( ImGuiCol_ButtonActive, colors[ImGuiCol_Tab] );
|
ImGui::PushStyleColor( ImGuiCol_ButtonActive, colors[ImGuiCol_Tab] );
|
||||||
}
|
}
|
||||||
bool action = ImGui::Button( label );
|
bool action = ImGui::Button( label );
|
||||||
|
if (tooltip != nullptr && ImGui::IsItemHovered())
|
||||||
|
ImGuiToolkit::ToolTip(tooltip);
|
||||||
if( action ) *toggle = !*toggle;
|
if( action ) *toggle = !*toggle;
|
||||||
if( active ) ImGui::PopStyleColor( 3 );
|
if( active ) ImGui::PopStyleColor( 3 );
|
||||||
return action;
|
return action;
|
||||||
@@ -169,16 +171,23 @@ bool ImGuiToolkit::ButtonIcon(int i, int j, const char *tooltip)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ImGuiToolkit::ButtonIconToggle(int i, int j, int i_toggle, int j_toggle, bool* toggle)
|
bool ImGuiToolkit::ButtonIconToggle(int i, int j, int i_toggle, int j_toggle, bool* toggle, const char *tooltip)
|
||||||
{
|
{
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
ImGui::PushID( i * 20 + j + i_toggle * 20 + j_toggle);
|
ImGui::PushID( i * 20 + j + i_toggle * 20 + j_toggle);
|
||||||
|
|
||||||
if (*toggle) {
|
const ImVec4* colors = ImGui::GetStyle().Colors;
|
||||||
|
const auto active = *toggle;
|
||||||
|
if( active ) {
|
||||||
|
ImGui::PushStyleColor( ImGuiCol_Button, colors[ImGuiCol_TabActive] );
|
||||||
|
ImGui::PushStyleColor( ImGuiCol_ButtonHovered, colors[ImGuiCol_TabHovered] );
|
||||||
|
ImGui::PushStyleColor( ImGuiCol_ButtonActive, colors[ImGuiCol_Tab] );
|
||||||
|
|
||||||
if ( ButtonIcon(i_toggle, j_toggle)) {
|
if ( ButtonIcon(i_toggle, j_toggle)) {
|
||||||
*toggle = false;
|
*toggle = false;
|
||||||
ret = true;
|
ret = true;
|
||||||
}
|
}
|
||||||
|
ImGui::PopStyleColor( 3 );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ( ButtonIcon(i, j)) {
|
if ( ButtonIcon(i, j)) {
|
||||||
@@ -187,6 +196,9 @@ bool ImGuiToolkit::ButtonIconToggle(int i, int j, int i_toggle, int j_toggle, bo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (tooltip != nullptr && ImGui::IsItemHovered())
|
||||||
|
ImGuiToolkit::ToolTip(tooltip);
|
||||||
|
|
||||||
ImGui::PopID();
|
ImGui::PopID();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace ImGuiToolkit
|
|||||||
|
|
||||||
// buttons and gui items with icon
|
// buttons and gui items with icon
|
||||||
bool ButtonIcon (int i, int j, const char* tooltip = nullptr);
|
bool ButtonIcon (int i, int j, const char* tooltip = nullptr);
|
||||||
bool ButtonIconToggle (int i, int j, int i_toggle, int j_toggle, bool* toggle);
|
bool ButtonIconToggle (int i, int j, int i_toggle, int j_toggle, bool* toggle, const char *tooltip = nullptr);
|
||||||
bool ButtonIconMultistate (std::vector<std::pair<int, int> > icons, int* state, const char* tooltip = nullptr);
|
bool ButtonIconMultistate (std::vector<std::pair<int, int> > icons, int* state, const char* tooltip = nullptr);
|
||||||
bool MenuItemIcon (int i, int j, const char* label, bool selected = false, bool enabled = true);
|
bool MenuItemIcon (int i, int j, const char* label, bool selected = false, bool enabled = true);
|
||||||
bool SelectableIcon(const char* label, int i, int j, bool selected = false);
|
bool SelectableIcon(const char* label, int i, int j, bool selected = false);
|
||||||
@@ -32,8 +32,8 @@ namespace ImGuiToolkit
|
|||||||
bool ComboIcon (const char* label, std::vector<std::pair<int, int> > icons, std::vector<std::string> items, int* i);
|
bool ComboIcon (const char* label, std::vector<std::pair<int, int> > icons, std::vector<std::string> items, int* i);
|
||||||
|
|
||||||
// buttons
|
// buttons
|
||||||
bool ButtonToggle (const char* label, bool* toggle);
|
bool ButtonToggle (const char* label, bool* toggle, const char *tooltip = nullptr);
|
||||||
bool ButtonSwitch (const char* label, bool* toggle , const char *help = nullptr);
|
bool ButtonSwitch (const char* label, bool* toggle, const char *help = nullptr);
|
||||||
void ButtonOpenUrl (const char* label, const char* url, const ImVec2& size_arg = ImVec2(0,0));
|
void ButtonOpenUrl (const char* label, const char* url, const ImVec2& size_arg = ImVec2(0,0));
|
||||||
|
|
||||||
// tooltip and mouse over
|
// tooltip and mouse over
|
||||||
|
|||||||
@@ -470,7 +470,7 @@ void ImGuiVisitor::visit (Source& s)
|
|||||||
// toggle enable/disable image processing
|
// toggle enable/disable image processing
|
||||||
bool on = s.imageProcessingEnabled();
|
bool on = s.imageProcessingEnabled();
|
||||||
ImGui::SetCursorPos( ImVec2(preview_width + 15, pos.y + 3.5f * ImGui::GetFrameHeightWithSpacing()) );
|
ImGui::SetCursorPos( ImVec2(preview_width + 15, pos.y + 3.5f * ImGui::GetFrameHeightWithSpacing()) );
|
||||||
if ( ImGuiToolkit::ButtonToggle(ICON_FA_MAGIC, &on) ){
|
if ( ImGuiToolkit::ButtonIconToggle(6, 2, 6, 2, &on, "Filters") ){
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
oss << s.name() << ": " << ( on ? "Enable Filter" : "Disable Filter");
|
oss << s.name() << ": " << ( on ? "Enable Filter" : "Disable Filter");
|
||||||
Action::manager().store(oss.str());
|
Action::manager().store(oss.str());
|
||||||
|
|||||||
@@ -3709,7 +3709,13 @@ Navigator::Navigator()
|
|||||||
view_pannel_visible = false;
|
view_pannel_visible = false;
|
||||||
clearButtonSelection();
|
clearButtonSelection();
|
||||||
|
|
||||||
|
// restore media mode as saved
|
||||||
|
if (Settings::application.recentImportFolders.path.compare(IMGUI_LABEL_RECENT_FILES) == 0)
|
||||||
new_media_mode = MEDIA_RECENT;
|
new_media_mode = MEDIA_RECENT;
|
||||||
|
else if (Settings::application.recentImportFolders.path.compare(IMGUI_LABEL_RECENT_RECORDS) == 0)
|
||||||
|
new_media_mode = MEDIA_RECORDING;
|
||||||
|
else
|
||||||
|
new_media_mode = MEDIA_FOLDER;
|
||||||
new_media_mode_changed = true;
|
new_media_mode_changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3737,6 +3743,7 @@ void Navigator::clearButtonSelection()
|
|||||||
pattern_type = -1;
|
pattern_type = -1;
|
||||||
sourceSequenceFiles.clear();
|
sourceSequenceFiles.clear();
|
||||||
sourceMediaFileCurrent.clear();
|
sourceMediaFileCurrent.clear();
|
||||||
|
new_media_mode_changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Navigator::showPannelSource(int index)
|
void Navigator::showPannelSource(int index)
|
||||||
@@ -3767,6 +3774,7 @@ void Navigator::togglePannelNew()
|
|||||||
{
|
{
|
||||||
selected_button[NAV_NEW] = !selected_button[NAV_NEW];
|
selected_button[NAV_NEW] = !selected_button[NAV_NEW];
|
||||||
applyButtonSelection(NAV_NEW);
|
applyButtonSelection(NAV_NEW);
|
||||||
|
new_media_mode_changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Navigator::hidePannel()
|
void Navigator::hidePannel()
|
||||||
@@ -4294,9 +4302,9 @@ void Navigator::RenderNewPannel()
|
|||||||
ImGui::SetCursorPos( ImVec2( pannel_width_ IMGUI_RIGHT_ALIGN, pos_bot.y - 2.f * ImGui::GetFrameHeightWithSpacing()));
|
ImGui::SetCursorPos( ImVec2( pannel_width_ IMGUI_RIGHT_ALIGN, pos_bot.y - 2.f * ImGui::GetFrameHeightWithSpacing()));
|
||||||
ImGuiToolkit::HelpMarker("Recently recorded videos (lastest on top). Clic on a filename to open.\n\n"
|
ImGuiToolkit::HelpMarker("Recently recorded videos (lastest on top). Clic on a filename to open.\n\n"
|
||||||
ICON_FA_CHEVRON_CIRCLE_RIGHT " Auto-preload prepares this panel with the "
|
ICON_FA_CHEVRON_CIRCLE_RIGHT " Auto-preload prepares this panel with the "
|
||||||
"most recent video after finishing recording.");
|
"most recent recording after 'Stop Record' or 'Save & continue'.");
|
||||||
ImGui::SetCursorPos( ImVec2( pannel_width_ IMGUI_RIGHT_ALIGN, pos_bot.y - ImGui::GetFrameHeightWithSpacing()) );
|
ImGui::SetCursorPos( ImVec2( pannel_width_ IMGUI_RIGHT_ALIGN, pos_bot.y - ImGui::GetFrameHeightWithSpacing()) );
|
||||||
if (ImGuiToolkit::ButtonToggle( ICON_FA_CHEVRON_CIRCLE_RIGHT, &Settings::application.recentRecordings.load_at_start ) ){
|
if (ImGuiToolkit::ButtonToggle( ICON_FA_CHEVRON_CIRCLE_RIGHT, &Settings::application.recentRecordings.load_at_start, "Auto-preload" ) ){
|
||||||
// demonstrate action
|
// demonstrate action
|
||||||
if (Settings::application.recentRecordings.load_at_start
|
if (Settings::application.recentRecordings.load_at_start
|
||||||
&& Settings::application.recentRecordings.filenames.size() > 0) {
|
&& Settings::application.recentRecordings.filenames.size() > 0) {
|
||||||
@@ -4305,8 +4313,6 @@ void Navigator::RenderNewPannel()
|
|||||||
new_source_preview_.setSource( Mixer::manager().createSourceFile(sourceMediaFileCurrent), label);
|
new_source_preview_.setSource( Mixer::manager().createSourceFile(sourceMediaFileCurrent), label);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ImGui::IsItemHovered())
|
|
||||||
ImGuiToolkit::ToolTip("Auto-preload");
|
|
||||||
// come back...
|
// come back...
|
||||||
ImGui::SetCursorPos(pos_bot);
|
ImGui::SetCursorPos(pos_bot);
|
||||||
}
|
}
|
||||||
@@ -4711,14 +4717,12 @@ void Navigator::RenderMainPannelVimix()
|
|||||||
|
|
||||||
ImGui::SetCursorPos( ImVec2( pannel_width_ IMGUI_RIGHT_ALIGN, pos_bot.y - 2.f * ImGui::GetFrameHeightWithSpacing()));
|
ImGui::SetCursorPos( ImVec2( pannel_width_ IMGUI_RIGHT_ALIGN, pos_bot.y - 2.f * ImGui::GetFrameHeightWithSpacing()));
|
||||||
ImGuiToolkit::HelpMarker("Select the history of recently opened files or a folder. "
|
ImGuiToolkit::HelpMarker("Select the history of recently opened files or a folder. "
|
||||||
"Double-clic on a filename to open it.\n\n"
|
"Double-clic on a filename to open the session.\n\n"
|
||||||
ICON_FA_ARROW_CIRCLE_RIGHT " Smooth transition "
|
ICON_FA_ARROW_CIRCLE_RIGHT " Smooth transition "
|
||||||
"performs cross fading to the openned session.");
|
"performs cross fading to the openned session.");
|
||||||
// toggle button for smooth transition
|
// toggle button for smooth transition
|
||||||
ImGui::SetCursorPos( ImVec2( pannel_width_ IMGUI_RIGHT_ALIGN, pos_bot.y - ImGui::GetFrameHeightWithSpacing()) );
|
ImGui::SetCursorPos( ImVec2( pannel_width_ IMGUI_RIGHT_ALIGN, pos_bot.y - ImGui::GetFrameHeightWithSpacing()) );
|
||||||
ImGuiToolkit::ButtonToggle(ICON_FA_ARROW_CIRCLE_RIGHT, &Settings::application.smooth_transition);
|
ImGuiToolkit::ButtonToggle(ICON_FA_ARROW_CIRCLE_RIGHT, &Settings::application.smooth_transition, "Smooth transition");
|
||||||
if (ImGui::IsItemHovered())
|
|
||||||
ImGuiToolkit::ToolTip("Smooth transition");
|
|
||||||
// come back...
|
// come back...
|
||||||
ImGui::SetCursorPos(pos_bot);
|
ImGui::SetCursorPos(pos_bot);
|
||||||
|
|
||||||
@@ -4960,9 +4964,7 @@ void Navigator::RenderMainPannelVimix()
|
|||||||
ImGui::TextDisabled( ICON_FA_REDO );
|
ImGui::TextDisabled( ICON_FA_REDO );
|
||||||
|
|
||||||
ImGui::SetCursorPos( ImVec2( pannel_width_ IMGUI_RIGHT_ALIGN, pos_bot.y - ImGui::GetFrameHeightWithSpacing()) );
|
ImGui::SetCursorPos( ImVec2( pannel_width_ IMGUI_RIGHT_ALIGN, pos_bot.y - ImGui::GetFrameHeightWithSpacing()) );
|
||||||
ImGuiToolkit::ButtonToggle(ICON_FA_MAP_MARKED_ALT, &Settings::application.action_history_follow_view);
|
ImGuiToolkit::ButtonToggle(ICON_FA_MAP_MARKED_ALT, &Settings::application.action_history_follow_view, "Show in view");
|
||||||
if (ImGui::IsItemHovered())
|
|
||||||
ImGuiToolkit::ToolTip("Show in view");
|
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// Current 0. VERSIONS
|
// Current 0. VERSIONS
|
||||||
@@ -5111,9 +5113,7 @@ void Navigator::RenderMainPannelVimix()
|
|||||||
"keeps a version each time a session is saved.");
|
"keeps a version each time a session is saved.");
|
||||||
// toggle button for versioning
|
// toggle button for versioning
|
||||||
ImGui::SetCursorPos( ImVec2( pannel_width_ IMGUI_RIGHT_ALIGN, pos_bot.y - ImGui::GetFrameHeightWithSpacing()) );
|
ImGui::SetCursorPos( ImVec2( pannel_width_ IMGUI_RIGHT_ALIGN, pos_bot.y - ImGui::GetFrameHeightWithSpacing()) );
|
||||||
ImGuiToolkit::ButtonToggle(" " ICON_FA_CODE_BRANCH " ", &Settings::application.save_version_snapshot);
|
ImGuiToolkit::ButtonToggle(" " ICON_FA_CODE_BRANCH " ", &Settings::application.save_version_snapshot,"Iterative saving");
|
||||||
if (ImGui::IsItemHovered())
|
|
||||||
ImGuiToolkit::ToolTip("Iterative saving");
|
|
||||||
|
|
||||||
ImGui::SetCursorPos( pos_bot );
|
ImGui::SetCursorPos( pos_bot );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user