ENH:add a tooltip
Change-Id: Id4180bb06d1b89a461697be7a7655f3aa9c3873e
This commit is contained in:
parent
c000ab2d8a
commit
407a863a6f
1 changed files with 9 additions and 13 deletions
|
@ -839,6 +839,7 @@ void NotificationManager::ExportFinishedNotification::render_close_button(ImGuiW
|
||||||
|
|
||||||
void NotificationManager::ExportFinishedNotification::render_eject_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::ExportFinishedNotification::render_eject_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));
|
||||||
|
@ -856,20 +857,15 @@ void NotificationManager::ExportFinishedNotification::render_eject_button(ImGuiW
|
||||||
{
|
{
|
||||||
button_text = ImGui::EjectHoverButton;
|
button_text = ImGui::EjectHoverButton;
|
||||||
//tooltip
|
//tooltip
|
||||||
|
ImGui::PushStyleColor(ImGuiCol_PopupBg, ImGuiWrapper::COL_WINDOW_BACKGROUND);
|
||||||
long time_now = wxGetLocalTime();
|
ImGui::PushStyleColor(ImGuiCol_Border, { 0,0,0,0 });
|
||||||
if (m_hover_time > 0 && m_hover_time < time_now) {
|
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, { 8 * scale, 1 * scale });
|
||||||
ImGui::PushStyleColor(ImGuiCol_PopupBg, ImGuiWrapper::COL_WINDOW_BACKGROUND);
|
ImGui::BeginTooltip();
|
||||||
//ImGui::BeginTooltip();
|
imgui.text(_u8L("Safely remove hardware."));
|
||||||
//imgui.text(_u8L("Eject drive") + " " + GUI::shortkey_ctrl_prefix() + "T");
|
ImGui::EndTooltip();
|
||||||
//ImGui::EndTooltip();
|
ImGui::PopStyleColor(2);
|
||||||
ImGui::PopStyleColor();
|
ImGui::PopStyleVar();
|
||||||
}
|
|
||||||
if (m_hover_time == 0)
|
|
||||||
m_hover_time = time_now;
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
m_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);
|
||||||
|
|
Loading…
Reference in a new issue