mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-16 20:31:14 +00:00
Use a keyboard icon for the shortcut button and fix unreadable guide tooltips (#16515)
* Fix unreadable text in wiki and video guide tooltips * Use a keyboard icon for the gizmo shortcut button * Fix blank tooltips on the Move and Scale gizmo combo boxes
This commit is contained in:
@@ -83,11 +83,13 @@ namespace Slic3r::GUI::GLGizmoUtils {
|
||||
bool clicked = toolbar_circular_button(icon, "##wiki_guide_btn", scale);
|
||||
if (url && *url && clicked)
|
||||
wxLaunchDefaultBrowser(wxString::FromUTF8(url));
|
||||
// ImGuiWrapper::tooltip keeps the text readable on the dark tooltip background whatever text colour the
|
||||
// host window pushed; a negative wrap position keeps the URL on one line.
|
||||
if (ImGui::IsItemHovered()){
|
||||
if(url && *url)
|
||||
ImGui::SetTooltip("%s\n%s", _u8L("Wiki Guide").c_str(), url);
|
||||
wxGetApp().imgui()->tooltip(_u8L("Wiki Guide") + "\n" + url, -1.f);
|
||||
else
|
||||
ImGui::SetTooltip("%s", _u8L("Wiki Guide").c_str());
|
||||
wxGetApp().imgui()->tooltip(_u8L("Wiki Guide"), -1.f);
|
||||
}
|
||||
return clicked; // for dynamically generated links
|
||||
}
|
||||
@@ -101,9 +103,9 @@ namespace Slic3r::GUI::GLGizmoUtils {
|
||||
wxLaunchDefaultBrowser(wxString::FromUTF8(url));
|
||||
if (ImGui::IsItemHovered()){
|
||||
if(url && *url)
|
||||
ImGui::SetTooltip("%s\n%s", _u8L("Video Guide").c_str(), url);
|
||||
wxGetApp().imgui()->tooltip(_u8L("Video Guide") + "\n" + url, -1.f);
|
||||
else
|
||||
ImGui::SetTooltip("%s", _u8L("Video Guide").c_str());
|
||||
wxGetApp().imgui()->tooltip(_u8L("Video Guide"), -1.f);
|
||||
}
|
||||
return clicked; // for dynamically generated links
|
||||
}
|
||||
|
||||
@@ -857,11 +857,12 @@ void GizmoObjectManipulation::do_render_move_window(ImGuiWrapper *imgui_wrapper,
|
||||
if (render_combo(imgui_wrapper, "", modes, selection_idx, 0, coord_combo_width)) {
|
||||
combox_changed = true;
|
||||
}
|
||||
ImGuiWrapper::pop_combo_style();
|
||||
// After pop_combo_style(): its light popup background would hide the tooltip's white text.
|
||||
if (ImGui::IsItemHovered()) {
|
||||
auto tooltip_str = _L("Coordinate system used for transform actions.");
|
||||
imgui_wrapper->tooltip(tooltip_str, imgui_wrapper->calc_text_size(tooltip_str).x + 3 * space_size);
|
||||
}
|
||||
ImGuiWrapper::pop_combo_style();
|
||||
|
||||
// ORCA use TextColored to match axes color
|
||||
float offset_to_center = (unit_size - ImGui::CalcTextSize("O").x) / 2;
|
||||
@@ -964,11 +965,12 @@ void GizmoObjectManipulation::do_render_move_window(ImGuiWrapper *imgui_wrapper,
|
||||
if (render_combo(imgui_wrapper, "", align_modes, align_mode_idx, 0, coord_combo_width))
|
||||
m_align_to_parent = align_mode_idx + 1 == align_modes.size();
|
||||
ImGui::PopID();
|
||||
ImGuiWrapper::pop_combo_style();
|
||||
// After pop_combo_style(): its light popup background would hide the tooltip's white text.
|
||||
if (ImGui::IsItemHovered()) {
|
||||
wxString tooltip_str = _L("Reference for alignment");
|
||||
imgui_wrapper->tooltip(tooltip_str, imgui_wrapper->calc_text_size(tooltip_str).x + 3 * space_size);
|
||||
}
|
||||
ImGuiWrapper::pop_combo_style();
|
||||
|
||||
const bool dark_mode = wxGetApp().dark_mode();
|
||||
int current_axis = -1;
|
||||
@@ -1377,11 +1379,12 @@ void GizmoObjectManipulation::do_render_scale_input_window(ImGuiWrapper* imgui_w
|
||||
if (render_combo(imgui_wrapper, "", modes, selection_idx, 0, coord_combo_width)) {
|
||||
combox_changed = true;
|
||||
}
|
||||
ImGuiWrapper::pop_combo_style();
|
||||
// After pop_combo_style(): its light popup background would hide the tooltip's white text.
|
||||
if (ImGui::IsItemHovered()) {
|
||||
auto tooltip_str = _L("Coordinate system used for transform actions.");
|
||||
imgui_wrapper->tooltip(tooltip_str, imgui_wrapper->calc_text_size(tooltip_str).x + 3 * space_size);
|
||||
}
|
||||
ImGuiWrapper::pop_combo_style();
|
||||
|
||||
// ORCA use TextColored to match axes color
|
||||
float offset_to_center = (unit_size - ImGui::CalcTextSize("O").x) / 2;
|
||||
|
||||
Reference in New Issue
Block a user