ENH:add next_button in dailytips
1.add next button in dailytips 2.adjust menuitem position of show tip in menu bar 3.add new tip Change-Id: Idad011b5849d7bddeb36b3a3e7d843aa596023d4
This commit is contained in:
parent
7bcc8c1de8
commit
9795cb8d0e
|
@ -153,6 +153,17 @@ documentation_link= https://wiki.bambulab.com/en/software/bambu-studio/auto-brim
|
||||||
text = Set parameters for multiple objects\nDid you know that you can set slicing parameters for all selected objects at one time?
|
text = Set parameters for multiple objects\nDid you know that you can set slicing parameters for all selected objects at one time?
|
||||||
documentation_link= https://wiki.bambulab.com/en/software/bambu-studio/set-parameters-for-selected-objects
|
documentation_link= https://wiki.bambulab.com/en/software/bambu-studio/set-parameters-for-selected-objects
|
||||||
|
|
||||||
|
[hint:Stack objects]
|
||||||
|
text = Stack objects\nDid you know that you can stack objects as a whole one?
|
||||||
|
documentation_link= https://wiki.bambulab.com/e/en/software/bambu-studio/stacking-objects
|
||||||
|
|
||||||
|
[hint:Flush into support/objects/infill]
|
||||||
|
text = Flush into support/objects/infill\nDid you know that you can save the wasted filament by flushing them into support/objects/infill during filament change?
|
||||||
|
documentation_link= https://wiki.bambulab.com/en/software/bambu-studio/reduce-wasting-during-filament-change
|
||||||
|
|
||||||
|
[hint:Improve strength]
|
||||||
|
text = Improve strength\nDid you know that you can use more wall loops and higher sparse infill density to improve the strength of the model?
|
||||||
|
|
||||||
#[hint:]
|
#[hint:]
|
||||||
#text =
|
#text =
|
||||||
#hypertext =
|
#hypertext =
|
||||||
|
|
|
@ -1,28 +1 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<svg id="minimalize_window" data-name="minimalize window" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><title>1234214</title><circle cx="50" cy="50" r="41" fill="#eee"/><path d="M40.7,80.7a1.75,1.75,0,0,1-1.2-.4,1.79,1.79,0,0,1-.2-2.6L62.8,49.9,36.7,27.6a1.84,1.84,0,0,1,2.4-2.8L66.6,48.3a1.79,1.79,0,0,1,.2,2.6L42.2,80A1.8,1.8,0,0,1,40.7,80.7Z" fill="#00ae42"/></svg>
|
||||||
<!-- Generator: Adobe Illustrator 24.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
||||||
<svg version="1.1" baseProfile="basic"
|
|
||||||
id="Layer_1" inkscape:version="1.0 (4035a4fb49, 2020-05-01)" sodipodi:docname="notification_right.svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg"
|
|
||||||
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 800 800"
|
|
||||||
xml:space="preserve">
|
|
||||||
<sodipodi:namedview bordercolor="#666666" borderopacity="1" gridtolerance="10" guidetolerance="10" id="namedview11" inkscape:current-layer="Layer_1" inkscape:cx="227.47556" inkscape:cy="335.392" inkscape:document-rotation="0" inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-height="2066" inkscape:window-maximized="1" inkscape:window-width="3840" inkscape:window-x="-11" inkscape:window-y="-11" inkscape:zoom="2.52" objecttolerance="10" pagecolor="#ffffff" showgrid="false">
|
|
||||||
</sodipodi:namedview>
|
|
||||||
<path id="path6" fill="#ED6B21" d="M501.1,400.2l-155.3,117V283.4L501.1,400.2 M567.8,400.2c0-6.1-2.7-12.2-8.2-16.2L330.1,211.3
|
|
||||||
c-13.4-10.1-32.6-0.5-32.6,16.2v345.4c0,16.7,19.1,26.3,32.6,16.2l229.5-172.8C565.1,412.3,567.8,406.3,567.8,400.2z"/>
|
|
||||||
<g id="g4" transform="matrix(0.9775,0,0,0.9775,53.547005,53.547755)">
|
|
||||||
<path id="path2" fill="#ED6B21" d="M597.2,701.3H110.6c-57.4,0-104.1-46.7-104.1-104.1V110.6C6.5,53.2,53.2,6.5,110.6,6.5h486.6
|
|
||||||
c57.4,0,104.1,46.7,104.1,104.1v486.6C701.3,654.6,654.6,701.3,597.2,701.3z M110.6,52.4c-32,0-58.2,26-58.2,58.2v486.6
|
|
||||||
c0,32,26,58.2,58.2,58.2h486.6c32,0,58.2-26,58.2-58.2V110.6c0-32-26-58.2-58.2-58.2L110.6,52.4z"/>
|
|
||||||
</g>
|
|
||||||
<path id="path17" fill="#ED6B21" d="M150.7,738.1c-12.5-1.4-26.7-5.9-37.8-12.1c-17.8-9.8-33.8-26.7-42.4-44.7
|
|
||||||
c-6-12.5-8.8-23.4-9.8-38.5c-0.5-6.9-0.6-87.4-0.5-250.6c0.2-222.9,0.3-240.9,1.4-246.6c4.2-22.5,13.7-40.6,29.2-56
|
|
||||||
c14.2-14.1,32-23.4,52.6-27.7c5.9-1.2,14-1.3,256.3-1.3h250.3l7.1,1.6c21.3,4.7,36.9,13.2,52,28.4c14.7,14.8,23.2,30.4,27.8,50.8
|
|
||||||
l1.6,7v251c0,242.7,0,251.2-1.3,257c-9.3,44.7-45.2,77.4-89.8,81.9C638,739.1,158.9,739.1,150.7,738.1L150.7,738.1z M652.9,692.5
|
|
||||||
c19.9-6.2,34.7-21.4,40-41.3l1.5-5.7V399.6V153.7l-1.5-5.7c-5.7-21.3-21.4-36.9-42.2-41.8c-5.6-1.3-7.7-1.3-253.2-1.2L150,105.1
|
|
||||||
l-4.7,1.6c-18.1,6.1-31.7,19.2-37.5,36c-1,3.1-2.2,7.5-2.6,9.9c-0.5,3-0.7,81.9-0.7,247c0,218.1,0.1,243.2,1.1,248.3
|
|
||||||
c4.3,22.6,22.2,40.9,44.8,45.4c3.6,0.7,49.2,0.9,251,0.8l246.6-0.1L652.9,692.5z"/>
|
|
||||||
<path id="path19" fill="#ED6B21" d="M300.2,218.4c2.1-4.1,4.8-6.9,9.4-9.3c3.4-1.8,12.8-1.8,16.5,0.1
|
|
||||||
c3.2,1.6,232.7,174.2,235.8,177.3c3.4,3.4,4.9,7,5.2,12.3c0.3,4.2,0.1,5.3-1.5,8.9c-1,2.2-2.8,5-4,6.1
|
|
||||||
c-4.3,4-232.3,175.3-235.5,176.9c-4.7,2.3-12.1,2.4-16.5,0.1c-3.9-2-7.8-5.7-9.7-9.2l-1.5-2.7l-0.2-178.1l-0.2-178.1L300.2,218.4z
|
|
||||||
M345.8,517.1c1-0.1,155-116.5,155-117.2c0-0.7-154-116.8-155-116.9c-0.3,0-0.5,52.7-0.5,117S345.6,517.1,345.8,517.1L345.8,517.1z"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 380 B |
|
@ -1,27 +1 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<svg id="minimalize_window" data-name="minimalize window" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><title>123124</title><circle cx="50" cy="50" r="47.7" fill="#eee"/><path d="M39.2,85.7a2.39,2.39,0,0,1-1.4-.5,2.32,2.32,0,0,1-.3-3.1L64.9,49.8,34.5,23.9a2.2,2.2,0,1,1,2.9-3.3l32,27.3a2.21,2.21,0,0,1,.2,3.1L40.8,85A2.36,2.36,0,0,1,39.2,85.7Z" fill="#00ae42"/></svg>
|
||||||
<!-- Generator: Adobe Illustrator 24.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
||||||
<svg version="1.1" baseProfile="basic"
|
|
||||||
id="Layer_1" inkscape:version="1.0 (4035a4fb49, 2020-05-01)" sodipodi:docname="notification_right_hover.svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg"
|
|
||||||
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 800 800"
|
|
||||||
xml:space="preserve">
|
|
||||||
<sodipodi:namedview bordercolor="#666666" borderopacity="1" gridtolerance="10" guidetolerance="10" id="namedview11" inkscape:current-layer="Layer_1" inkscape:cx="400" inkscape:cy="396.42857" inkscape:document-rotation="0" inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-height="2066" inkscape:window-maximized="1" inkscape:window-width="3840" inkscape:window-x="-11" inkscape:window-y="-11" inkscape:zoom="1.26" objecttolerance="10" pagecolor="#ffffff" showgrid="false">
|
|
||||||
</sodipodi:namedview>
|
|
||||||
<path id="path6" fill="#ED6B21" d="M460.5,399.9l-93.2,70.2V329.8L460.5,399.9 M500.5,399.9c0-3.7-1.6-7.3-4.9-9.7L357.9,286.6
|
|
||||||
c-8.1-6.1-19.5-0.3-19.5,9.7v207.2c0,10,11.5,15.8,19.5,9.7l137.7-103.7C498.8,407.2,500.5,403.6,500.5,399.9L500.5,399.9z"/>
|
|
||||||
<g id="g4" transform="matrix(0.5865,0,0,0.5865,191.9219,191.92265)">
|
|
||||||
<path id="path2" fill="#ED6B21" d="M597.2,701.3H110.6c-57.4,0-104.1-46.7-104.1-104.1V110.6C6.5,53.2,53.2,6.5,110.6,6.5h486.6
|
|
||||||
c57.4,0,104.1,46.7,104.1,104.1v486.6C701.3,654.6,654.6,701.3,597.2,701.3z M110.6,52.4c-32,0-58.2,26-58.2,58.2v486.6
|
|
||||||
c0,32,26,58.2,58.2,58.2h486.6c32,0,58.2-26,58.2-58.2V110.6c0-32-26-58.2-58.2-58.2L110.6,52.4z"/>
|
|
||||||
</g>
|
|
||||||
<path id="path17" fill="#ED6B21" d="M250.2,602.7c-7.5-0.8-16-3.6-22.7-7.3c-10.7-5.9-20.3-16-25.5-26.8c-3.6-7.5-5.3-14-5.9-23.1
|
|
||||||
c-0.3-4.1-0.4-52.5-0.3-150.4c0.1-133.7,0.2-144.6,0.8-148c2.5-13.5,8.2-24.4,17.5-33.6c8.5-8.4,19.2-14.1,31.6-16.6
|
|
||||||
c3.5-0.7,8.4-0.8,153.8-0.8h150.2l4.3,0.9c12.8,2.8,22.1,7.9,31.2,17c8.8,8.9,13.9,18.2,16.7,30.5l0.9,4.2v150.6
|
|
||||||
c0,145.6,0,150.7-0.8,154.2c-5.6,26.8-27.1,46.5-53.9,49.1C542.6,603.2,255.1,603.2,250.2,602.7L250.2,602.7z M551.5,575.3
|
|
||||||
c12-3.7,20.8-12.9,24-24.8l0.9-3.4V399.5V252l-0.9-3.4c-3.4-12.8-12.8-22.1-25.3-25.1c-3.4-0.8-4.6-0.8-151.9-0.7l-148.5,0.1l-2.8,1
|
|
||||||
c-10.8,3.7-19,11.5-22.5,21.6c-0.6,1.8-1.3,4.5-1.6,6c-0.3,1.8-0.4,49.2-0.4,148.2c0,130.9,0.1,145.9,0.6,149
|
|
||||||
c2.6,13.6,13.3,24.5,26.9,27.3c2.2,0.4,29.5,0.5,150.6,0.5l147.9-0.1L551.5,575.3z"/>
|
|
||||||
<path id="path19" fill="#ED6B21" d="M339.9,290.9c1.2-2.5,2.9-4.1,5.6-5.6c2.1-1.1,7.7-1.1,9.9,0c1.9,1,139.6,104.5,141.5,106.4
|
|
||||||
c2,2,2.9,4.2,3.1,7.4c0.2,2.5,0,3.2-0.9,5.3c-0.6,1.3-1.7,3-2.4,3.6c-2.6,2.4-139.4,105.2-141.3,106.1c-2.8,1.4-7.3,1.4-9.9,0.1
|
|
||||||
c-2.3-1.2-4.7-3.4-5.8-5.5l-0.9-1.6l-0.1-106.9l-0.1-106.9L339.9,290.9z M367.3,470.1c0.6,0,93-69.9,93-70.3
|
|
||||||
c0-0.4-92.4-70.1-93-70.1c-0.2,0-0.3,31.6-0.3,70.2S367.1,470.1,367.3,470.1z"/>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 379 B |
|
@ -1069,8 +1069,9 @@ void GUI_App::post_init()
|
||||||
// BBS: to be checked
|
// BBS: to be checked
|
||||||
#if 1
|
#if 1
|
||||||
// show "Did you know" notification
|
// show "Did you know" notification
|
||||||
if (app_config->get("show_hints") == "true" && ! is_gcode_viewer())
|
if (app_config->get("show_hints") == "true" && !is_gcode_viewer()) {
|
||||||
plater_->get_notification_manager()->push_hint_notification(true);
|
plater_->get_notification_manager()->push_hint_notification(false);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (m_networking_need_update) {
|
if (m_networking_need_update) {
|
||||||
|
|
|
@ -839,7 +839,7 @@ void NotificationManager::HintNotification::render_text(ImGuiWrapper& imgui, con
|
||||||
|
|
||||||
float x_offset = m_left_indentation;
|
float x_offset = m_left_indentation;
|
||||||
int last_end = 0;
|
int last_end = 0;
|
||||||
float starting_y = (m_lines_count < 4 ? m_line_height / 2 * (4 - m_lines_count + 1) : m_line_height / 2);
|
float starting_y = (/*m_lines_count < 4 ? m_line_height / 2 * (4 - m_lines_count + 1) :*/ m_line_height / 2);
|
||||||
float shift_y = m_line_height;
|
float shift_y = m_line_height;
|
||||||
std::string line;
|
std::string line;
|
||||||
|
|
||||||
|
@ -932,41 +932,29 @@ void NotificationManager::HintNotification::render_close_button(ImGuiWrapper& im
|
||||||
std::string button_text;
|
std::string button_text;
|
||||||
button_text = ImGui::CloseNotifButton;
|
button_text = ImGui::CloseNotifButton;
|
||||||
|
|
||||||
if (ImGui::IsMouseHoveringRect(ImVec2(win_pos.x - win_size.x / 10.f, win_pos.y),
|
|
||||||
ImVec2(win_pos.x, win_pos.y + win_size.y - 2 * m_line_height),
|
|
||||||
true))
|
|
||||||
{
|
|
||||||
button_text = ImGui::CloseNotifHoverButton;
|
|
||||||
}
|
|
||||||
ImVec2 button_pic_size = ImGui::CalcTextSize(button_text.c_str());
|
ImVec2 button_pic_size = ImGui::CalcTextSize(button_text.c_str());
|
||||||
ImVec2 button_size(button_pic_size.x * 1.25f, button_pic_size.y * 1.25f);
|
ImVec2 button_size(button_pic_size.x * 1.25f, button_pic_size.y * 1.25f);
|
||||||
m_close_b_w = button_size.y;
|
m_close_b_w = button_size.y;
|
||||||
if (m_lines_count <= 3) {
|
if (ImGui::IsMouseHoveringRect(ImVec2(win_pos.x - win_size.x / 10.f, win_pos.y + win_size.y / 2 - button_pic_size.y),
|
||||||
m_close_b_y = win_size.y / 2 - button_size.y * 1.25f;
|
ImVec2(win_pos.x, win_pos.y + win_size.y / 2 + button_pic_size.y),
|
||||||
ImGui::SetCursorPosX(win_size.x - m_line_height * 2.75f);
|
true))
|
||||||
ImGui::SetCursorPosY(m_close_b_y);
|
{
|
||||||
|
button_text = ImGui::CloseNotifHoverButton;
|
||||||
|
if (ImGui::IsMouseClicked(ImGuiMouseButton_Left))
|
||||||
|
close();
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
ImGui::SetCursorPosX(win_size.x - m_line_height * 2.75f);
|
ImGui::SetCursorPosX(win_size.x - m_line_height * 2.75f);
|
||||||
ImGui::SetCursorPosY(win_size.y / 2 - button_size.y);
|
ImGui::SetCursorPosY(win_size.y / 2 - button_size.y);
|
||||||
}
|
|
||||||
if (imgui.button(button_text.c_str(), button_size.x, button_size.y))
|
if (imgui.button(button_text.c_str(), button_size.x, button_size.y))
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
//invisible large button
|
|
||||||
ImGui::SetCursorPosX(win_size.x - m_line_height * 2.35f);
|
|
||||||
ImGui::SetCursorPosY(0);
|
|
||||||
if (imgui.button(" ", m_line_height * 2.125, win_size.y - 2 * m_line_height))
|
|
||||||
{
|
|
||||||
close();
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui::PopStyleColor(5);
|
ImGui::PopStyleColor(5);
|
||||||
|
|
||||||
|
|
||||||
//render_right_arrow_button(imgui, win_size_x, win_size_y, win_pos_x, win_pos_y);
|
render_right_arrow_button(imgui, win_size_x, win_size_y, win_pos_x, win_pos_y);
|
||||||
//render_logo(imgui, win_size_x, win_size_y, win_pos_x, win_pos_y);
|
//render_logo(imgui, win_size_x, win_size_y, win_pos_x, win_pos_y);
|
||||||
render_preferences_button(imgui, win_pos_x, win_pos_y);
|
render_preferences_button(imgui, win_pos_x, win_pos_y);
|
||||||
if (!m_documentation_link.empty() && wxGetApp().app_config->get("suppress_hyperlinks") != "1")
|
if (!m_documentation_link.empty() && wxGetApp().app_config->get("suppress_hyperlinks") != "1")
|
||||||
|
@ -978,7 +966,7 @@ void NotificationManager::HintNotification::render_close_button(ImGuiWrapper& im
|
||||||
|
|
||||||
void NotificationManager::HintNotification::render_preferences_button(ImGuiWrapper& imgui, const float win_pos_x, const float win_pos_y)
|
void NotificationManager::HintNotification::render_preferences_button(ImGuiWrapper& imgui, const float win_pos_x, const float win_pos_y)
|
||||||
{
|
{
|
||||||
|
auto scale = wxGetApp().plater()->get_current_canvas3D()->get_scale();
|
||||||
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(.0f, .0f, .0f, .0f));
|
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(.0f, .0f, .0f, .0f));
|
||||||
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(.0f, .0f, .0f, .0f));
|
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(.0f, .0f, .0f, .0f));
|
||||||
push_style_color(ImGuiCol_ButtonActive, ImGui::GetStyleColorVec4(ImGuiCol_WindowBg), m_state == EState::FadingOut, m_current_fade_opacity);
|
push_style_color(ImGuiCol_ButtonActive, ImGui::GetStyleColorVec4(ImGuiCol_WindowBg), m_state == EState::FadingOut, m_current_fade_opacity);
|
||||||
|
@ -988,37 +976,28 @@ void NotificationManager::HintNotification::render_preferences_button(ImGuiWrapp
|
||||||
std::string button_text;
|
std::string button_text;
|
||||||
button_text = ImGui::PreferencesButton;
|
button_text = ImGui::PreferencesButton;
|
||||||
//hover
|
//hover
|
||||||
if (ImGui::IsMouseHoveringRect(ImVec2(win_pos_x - m_window_width / 15.f, win_pos_y + m_window_height - 1.75f * m_line_height),
|
if (ImGui::IsMouseHoveringRect(ImVec2(win_pos_x - m_window_width / 15.f, win_pos_y + m_window_height - 1.5f * m_line_height),
|
||||||
ImVec2(win_pos_x, win_pos_y + m_window_height),
|
ImVec2(win_pos_x, win_pos_y + m_window_height),
|
||||||
true)) {
|
true)) {
|
||||||
button_text = ImGui::PreferencesHoverButton;
|
button_text = ImGui::PreferencesHoverButton;
|
||||||
// tooltip
|
// tooltip
|
||||||
long time_now = wxGetLocalTime();
|
|
||||||
if (m_prefe_hover_time > 0 && m_prefe_hover_time < time_now) {
|
|
||||||
ImGui::PushStyleColor(ImGuiCol_PopupBg, ImGuiWrapper::COL_WINDOW_BACKGROUND);
|
ImGui::PushStyleColor(ImGuiCol_PopupBg, ImGuiWrapper::COL_WINDOW_BACKGROUND);
|
||||||
|
ImGui::PushStyleColor(ImGuiCol_Border, { 0,0,0,0 });
|
||||||
|
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, { 8 * scale, 1 * scale });
|
||||||
ImGui::BeginTooltip();
|
ImGui::BeginTooltip();
|
||||||
imgui.text(_u8L("Open Preferences."));
|
imgui.text(_u8L("Open Preferences."));
|
||||||
ImGui::EndTooltip();
|
ImGui::EndTooltip();
|
||||||
ImGui::PopStyleColor();
|
ImGui::PopStyleColor(2);
|
||||||
|
ImGui::PopStyleVar();
|
||||||
}
|
}
|
||||||
if (m_prefe_hover_time == 0)
|
|
||||||
m_prefe_hover_time = time_now;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
m_prefe_hover_time = 0;
|
|
||||||
|
|
||||||
ImVec2 button_pic_size = ImGui::CalcTextSize(button_text.c_str());
|
ImVec2 button_pic_size = ImGui::CalcTextSize(button_text.c_str());
|
||||||
ImVec2 button_size(button_pic_size.x * 1.25f, button_pic_size.y * 1.25f);
|
ImVec2 button_size(button_pic_size.x * 1.25f, button_pic_size.y * 1.25f);
|
||||||
ImGui::SetCursorPosX(m_window_width - m_line_height * 1.75f);
|
ImGui::SetCursorPosX(m_window_width - m_line_height * 1.75f);
|
||||||
if (m_lines_count <= 3) {
|
|
||||||
ImGui::SetCursorPosY(m_close_b_y + m_close_b_w / 4.f * 7.f);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ImGui::SetCursorPosY(m_window_height - button_size.y - m_close_b_w / 4.f);
|
ImGui::SetCursorPosY(m_window_height - button_size.y - m_close_b_w / 4.f);
|
||||||
}
|
|
||||||
if (imgui.button(button_text.c_str(), button_size.x, button_size.y))
|
if (imgui.button(button_text.c_str(), button_size.x, button_size.y))
|
||||||
{
|
{
|
||||||
wxGetApp().open_preferences(1, "GUI");// 1 is to modify
|
wxGetApp().open_preferences();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::PopStyleColor(5);
|
ImGui::PopStyleColor(5);
|
||||||
|
@ -1028,7 +1007,7 @@ void NotificationManager::HintNotification::render_preferences_button(ImGuiWrapp
|
||||||
void NotificationManager::HintNotification::render_right_arrow_button(ImGuiWrapper& imgui, const float win_size_x, const float win_size_y, const float win_pos_x, const float win_pos_y)
|
void NotificationManager::HintNotification::render_right_arrow_button(ImGuiWrapper& imgui, const float win_size_x, const float win_size_y, const float win_pos_x, const float win_pos_y)
|
||||||
{
|
{
|
||||||
// Used for debuging
|
// Used for debuging
|
||||||
|
auto scale = wxGetApp().plater()->get_current_canvas3D()->get_scale();
|
||||||
ImVec2 win_size(win_size_x, win_size_y);
|
ImVec2 win_size(win_size_x, win_size_y);
|
||||||
ImVec2 win_pos(win_pos_x, win_pos_y);
|
ImVec2 win_pos(win_pos_x, win_pos_y);
|
||||||
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(.0f, .0f, .0f, .0f));
|
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(.0f, .0f, .0f, .0f));
|
||||||
|
@ -1042,11 +1021,22 @@ void NotificationManager::HintNotification::render_right_arrow_button(ImGuiWrapp
|
||||||
|
|
||||||
ImVec2 button_pic_size = ImGui::CalcTextSize(button_text.c_str());
|
ImVec2 button_pic_size = ImGui::CalcTextSize(button_text.c_str());
|
||||||
ImVec2 button_size(button_pic_size.x * 1.25f, button_pic_size.y * 1.25f);
|
ImVec2 button_size(button_pic_size.x * 1.25f, button_pic_size.y * 1.25f);
|
||||||
|
if (ImGui::IsMouseHoveringRect(ImVec2(win_pos_x - m_window_width / 7.5f, win_pos_y + m_window_height - 1.5f * m_line_height),
|
||||||
|
ImVec2(win_pos_x - m_window_width / 15.f, win_pos_y + m_window_height),
|
||||||
|
true))
|
||||||
|
{
|
||||||
|
button_text = ImGui::RightArrowHoverButton;
|
||||||
|
// tooltip
|
||||||
|
ImGui::PushStyleColor(ImGuiCol_PopupBg, ImGuiWrapper::COL_WINDOW_BACKGROUND);
|
||||||
|
ImGui::PushStyleColor(ImGuiCol_Border, { 0,0,0,0 });
|
||||||
|
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, { 8 * scale, 1 * scale });
|
||||||
|
ImGui::BeginTooltip();
|
||||||
|
imgui.text(_u8L("Open next tip."));
|
||||||
|
ImGui::EndTooltip();
|
||||||
|
ImGui::PopStyleColor(2);
|
||||||
|
ImGui::PopStyleVar();
|
||||||
|
}
|
||||||
ImGui::SetCursorPosX(m_window_width - m_line_height * 3.f);
|
ImGui::SetCursorPosX(m_window_width - m_line_height * 3.f);
|
||||||
if (m_lines_count <= 3)
|
|
||||||
ImGui::SetCursorPosY(m_close_b_y + m_close_b_w / 4.f * 7.f);
|
|
||||||
else
|
|
||||||
ImGui::SetCursorPosY(m_window_height - button_size.y - m_close_b_w / 4.f);
|
ImGui::SetCursorPosY(m_window_height - button_size.y - m_close_b_w / 4.f);
|
||||||
if (imgui.button(button_text.c_str(), button_size.x * 0.8f, button_size.y * 1.f))
|
if (imgui.button(button_text.c_str(), button_size.x * 0.8f, button_size.y * 1.f))
|
||||||
{
|
{
|
||||||
|
@ -1068,6 +1058,7 @@ void NotificationManager::HintNotification::render_logo(ImGuiWrapper& imgui, con
|
||||||
}
|
}
|
||||||
void NotificationManager::HintNotification::render_documentation_button(ImGuiWrapper& imgui, const float win_size_x, const float win_size_y, const float win_pos_x, const float win_pos_y)
|
void NotificationManager::HintNotification::render_documentation_button(ImGuiWrapper& imgui, const float win_size_x, const float win_size_y, const float win_pos_x, const float win_pos_y)
|
||||||
{
|
{
|
||||||
|
auto scale = wxGetApp().plater()->get_current_canvas3D()->get_scale();
|
||||||
ImVec2 win_size(win_size_x, win_size_y);
|
ImVec2 win_size(win_size_x, win_size_y);
|
||||||
ImVec2 win_pos(win_pos_x, win_pos_y);
|
ImVec2 win_pos(win_pos_x, win_pos_y);
|
||||||
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(.0f, .0f, .0f, .0f));
|
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(.0f, .0f, .0f, .0f));
|
||||||
|
@ -1081,28 +1072,25 @@ void NotificationManager::HintNotification::render_documentation_button(ImGuiWra
|
||||||
std::string placeholder_text;
|
std::string placeholder_text;
|
||||||
placeholder_text = ImGui::EjectButton;
|
placeholder_text = ImGui::EjectButton;
|
||||||
|
|
||||||
if (ImGui::IsMouseHoveringRect(ImVec2(win_pos.x - m_line_height * 5.f, win_pos.y),
|
ImVec2 button_pic_size = ImGui::CalcTextSize(placeholder_text.c_str());
|
||||||
ImVec2(win_pos.x - m_line_height * 2.5f, win_pos.y + win_size.y - 2 * m_line_height),
|
ImVec2 button_size(button_pic_size.x * 1.25f, button_pic_size.y * 1.25f);
|
||||||
|
if (ImGui::IsMouseHoveringRect(ImVec2(win_pos.x - m_line_height * 5.f, win_pos.y + win_size.y / 2 - button_pic_size.y),
|
||||||
|
ImVec2(win_pos.x - m_line_height * 2.5f, win_pos.y + win_size.y / 2 + button_pic_size.y),
|
||||||
true))
|
true))
|
||||||
{
|
{
|
||||||
button_text = ImGui::DocumentationHoverButton;
|
button_text = ImGui::DocumentationHoverButton;
|
||||||
// tooltip
|
// tooltip
|
||||||
long time_now = wxGetLocalTime();
|
|
||||||
if (m_docu_hover_time > 0 && m_docu_hover_time < time_now) {
|
|
||||||
ImGui::PushStyleColor(ImGuiCol_PopupBg, ImGuiWrapper::COL_WINDOW_BACKGROUND);
|
ImGui::PushStyleColor(ImGuiCol_PopupBg, ImGuiWrapper::COL_WINDOW_BACKGROUND);
|
||||||
|
ImGui::PushStyleColor(ImGuiCol_Border, { 0,0,0,0 });
|
||||||
|
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, { 8 * scale, 1 * scale });
|
||||||
ImGui::BeginTooltip();
|
ImGui::BeginTooltip();
|
||||||
imgui.text(_u8L("Open Documentation in web browser."));
|
imgui.text(_u8L("Open Documentation in web browser."));
|
||||||
ImGui::EndTooltip();
|
ImGui::EndTooltip();
|
||||||
ImGui::PopStyleColor();
|
ImGui::PopStyleColor(2);
|
||||||
|
ImGui::PopStyleVar();
|
||||||
|
if (ImGui::IsMouseClicked(ImGuiMouseButton_Left))
|
||||||
|
open_documentation();
|
||||||
}
|
}
|
||||||
if (m_docu_hover_time == 0)
|
|
||||||
m_docu_hover_time = time_now;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
m_docu_hover_time = 0;
|
|
||||||
|
|
||||||
ImVec2 button_pic_size = ImGui::CalcTextSize(placeholder_text.c_str());
|
|
||||||
ImVec2 button_size(button_pic_size.x * 1.25f, button_pic_size.y * 1.25f);
|
|
||||||
ImGui::SetCursorPosX(win_size.x - m_line_height * 5.0f);
|
ImGui::SetCursorPosX(win_size.x - m_line_height * 5.0f);
|
||||||
ImGui::SetCursorPosY(win_size.y / 2 - button_size.y);
|
ImGui::SetCursorPosY(win_size.y / 2 - button_size.y);
|
||||||
if (imgui.button(button_text.c_str(), button_size.x, button_size.y))
|
if (imgui.button(button_text.c_str(), button_size.x, button_size.y))
|
||||||
|
@ -1110,14 +1098,6 @@ void NotificationManager::HintNotification::render_documentation_button(ImGuiWra
|
||||||
open_documentation();
|
open_documentation();
|
||||||
}
|
}
|
||||||
|
|
||||||
//invisible large button
|
|
||||||
ImGui::SetCursorPosX(win_size.x - m_line_height * 4.625f);
|
|
||||||
ImGui::SetCursorPosY(0);
|
|
||||||
if (imgui.button(" ", m_line_height * 2.f, win_size.y - 2 * m_line_height))
|
|
||||||
{
|
|
||||||
open_documentation();
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui::PopStyleColor(5);
|
ImGui::PopStyleColor(5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -88,6 +88,7 @@ protected:
|
||||||
const float win_pos_x, const float win_pos_y) override;
|
const float win_pos_x, const float win_pos_y) override;
|
||||||
virtual void render_minimize_button(ImGuiWrapper& imgui,
|
virtual void render_minimize_button(ImGuiWrapper& imgui,
|
||||||
const float win_pos_x, const float win_pos_y) override {}
|
const float win_pos_x, const float win_pos_y) override {}
|
||||||
|
|
||||||
void render_preferences_button(ImGuiWrapper& imgui,
|
void render_preferences_button(ImGuiWrapper& imgui,
|
||||||
const float win_pos_x, const float win_pos_y);
|
const float win_pos_x, const float win_pos_y);
|
||||||
void render_right_arrow_button(ImGuiWrapper& imgui,
|
void render_right_arrow_button(ImGuiWrapper& imgui,
|
||||||
|
|
|
@ -1804,6 +1804,11 @@ static wxMenu* generate_help_menu()
|
||||||
append_menu_item(helpMenu, wxID_ANY, _L("Show Configuration Folder"), _L("Show Configuration Folder"),
|
append_menu_item(helpMenu, wxID_ANY, _L("Show Configuration Folder"), _L("Show Configuration Folder"),
|
||||||
[](wxCommandEvent&) { Slic3r::GUI::desktop_open_datadir_folder(); });
|
[](wxCommandEvent&) { Slic3r::GUI::desktop_open_datadir_folder(); });
|
||||||
|
|
||||||
|
append_menu_item(helpMenu, wxID_ANY, _L("Show Tip of the Day"), _L("Show Tip of the Day"), [](wxCommandEvent&) {
|
||||||
|
wxGetApp().plater()->get_notification_manager()->push_hint_notification(false);
|
||||||
|
wxGetApp().plater()->get_current_canvas3D()->set_as_dirty();
|
||||||
|
});
|
||||||
|
|
||||||
// Report a bug
|
// Report a bug
|
||||||
//append_menu_item(helpMenu, wxID_ANY, _L("Report Bug(TODO)"), _L("Report a bug of BambuStudio"),
|
//append_menu_item(helpMenu, wxID_ANY, _L("Report Bug(TODO)"), _L("Report a bug of BambuStudio"),
|
||||||
// [](wxCommandEvent&) {
|
// [](wxCommandEvent&) {
|
||||||
|
@ -1823,11 +1828,6 @@ static wxMenu* generate_help_menu()
|
||||||
append_menu_item(helpMenu, wxID_ANY, about_title, about_title,
|
append_menu_item(helpMenu, wxID_ANY, about_title, about_title,
|
||||||
[](wxCommandEvent&) { Slic3r::GUI::about(); });
|
[](wxCommandEvent&) { Slic3r::GUI::about(); });
|
||||||
#endif
|
#endif
|
||||||
append_menu_item(helpMenu, wxID_ANY, _L("Show Tip of the Day"), _L("Show Tip of the Day"), [](wxCommandEvent&) {
|
|
||||||
wxGetApp().plater()->get_notification_manager()->push_hint_notification(false);
|
|
||||||
wxGetApp().plater()->get_current_canvas3D()->set_as_dirty();
|
|
||||||
});
|
|
||||||
|
|
||||||
append_menu_item(helpMenu, wxID_ANY, _L("Open Network Test"), _L("Open Network Test"), [](wxCommandEvent&) {
|
append_menu_item(helpMenu, wxID_ANY, _L("Open Network Test"), _L("Open Network Test"), [](wxCommandEvent&) {
|
||||||
NetworkTestDialog dlg(wxGetApp().mainframe);
|
NetworkTestDialog dlg(wxGetApp().mainframe);
|
||||||
dlg.ShowModal();
|
dlg.ShowModal();
|
||||||
|
|
Loading…
Reference in New Issue