notifiactions: new icons + deleting old warnings&errors

This commit is contained in:
David Kocik 2020-08-24 13:53:18 +02:00
parent acb5a9bc8d
commit 2455df4017
10 changed files with 329 additions and 24 deletions

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.2.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.0" id="close_window" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
y="0px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve">
<g>
<path fill="#ED6B21" d="M80,92.83H20c-7.08,0-12.83-5.76-12.83-12.84V20c0-7.08,5.76-12.83,12.83-12.83h60
c7.08,0,12.84,5.76,12.84,12.83v60C92.83,87.08,87.08,92.83,80,92.83z M20,12.83c-3.95,0-7.17,3.21-7.17,7.17v60
c0,3.95,3.21,7.17,7.17,7.17h60c3.95,0,7.17-3.21,7.17-7.17V20c0-3.95-3.21-7.17-7.17-7.17H20z"/>
</g>
<g>
<path fill="#ED6B21" d="M70,75.67c-1.45,0-2.9-0.55-4.01-1.66l-40-40c-2.21-2.21-2.21-5.8,0-8.02s5.8-2.21,8.02,0l40,40
c2.21,2.21,2.21,5.8,0,8.02C72.9,75.12,71.45,75.67,70,75.67z"/>
</g>
<g>
<path fill="#ED6B21" d="M30,75.67c-1.45,0-2.9-0.55-4.01-1.66c-2.21-2.21-2.21-5.8,0-8.02l40-40c2.21-2.21,5.8-2.21,8.02,0
c2.21,2.21,2.21,5.8,0,8.02l-40,40C32.9,75.12,31.45,75.67,30,75.67z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
inkscape:version="1.0 (4035a4fb49, 2020-05-01)"
sodipodi:docname="notification_close_hover.svg"
xml:space="preserve"
enable-background="new 0 0 100 100"
viewBox="0 0 100 100"
y="0px"
x="0px"
id="close_window"
version="1.0"><metadata
id="metadata19"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
id="defs17" /><sodipodi:namedview
inkscape:current-layer="close_window"
inkscape:window-maximized="1"
inkscape:window-y="-8"
inkscape:window-x="-8"
inkscape:cy="50"
inkscape:cx="50"
inkscape:zoom="10.08"
showgrid="false"
id="namedview15"
inkscape:window-height="1377"
inkscape:window-width="2560"
inkscape:pageshadow="2"
inkscape:pageopacity="0"
guidetolerance="10"
gridtolerance="10"
objecttolerance="10"
borderopacity="1"
bordercolor="#666666"
pagecolor="#ffffff" />
<g
transform="matrix(1.15,0,0,1.15,-7.50075,-7.5)"
id="g4">
<path
id="path2"
d="M 80,92.83 H 20 C 12.92,92.83 7.17,87.07 7.17,79.99 V 20 C 7.17,12.92 12.93,7.17 20,7.17 h 60 c 7.08,0 12.84,5.76 12.84,12.83 V 80 C 92.83,87.08 87.08,92.83 80,92.83 Z m -60,-80 c -3.95,0 -7.17,3.21 -7.17,7.17 v 60 c 0,3.95 3.21,7.17 7.17,7.17 h 60 c 3.95,0 7.17,-3.21 7.17,-7.17 V 20 c 0,-3.95 -3.21,-7.17 -7.17,-7.17 z"
fill="#ED6B21" />
</g>
<g
transform="matrix(1.15,0,0,1.15,-7.50075,-7.5)"
id="g8">
<path
id="path6"
d="m 70,75.67 c -1.45,0 -2.9,-0.55 -4.01,-1.66 l -40,-40 c -2.21,-2.21 -2.21,-5.8 0,-8.02 2.21,-2.22 5.8,-2.21 8.02,0 l 40,40 c 2.21,2.21 2.21,5.8 0,8.02 -1.11,1.11 -2.56,1.66 -4.01,1.66 z"
fill="#ED6B21" />
</g>
<g
transform="matrix(1.15,0,0,1.15,-7.50075,-7.5)"
id="g12">
<path
id="path10"
d="m 30,75.67 c -1.45,0 -2.9,-0.55 -4.01,-1.66 -2.21,-2.21 -2.21,-5.8 0,-8.02 l 40,-40 c 2.21,-2.21 5.8,-2.21 8.02,0 2.21,2.21 2.21,5.8 0,8.02 l -40,40 C 32.9,75.12 31.45,75.67 30,75.67 Z"
fill="#ED6B21" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.0"
id="error"
x="0px"
y="0px"
viewBox="0 0 200 200"
enable-background="new 0 0 100 100"
xml:space="preserve"
sodipodi:docname="notification_error.svg"
width="200"
height="200"
inkscape:version="1.0 (4035a4fb49, 2020-05-01)"><metadata
id="metadata19"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs17" /><sodipodi:namedview
inkscape:document-rotation="0"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="2560"
inkscape:window-height="1377"
id="namedview15"
showgrid="false"
inkscape:zoom="5.04"
inkscape:cx="117.17146"
inkscape:cy="98.609664"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="error" />
<g
id="g4"
transform="matrix(2.52,0,0,2.52,-26,-26)">
<path
fill="#ed6b21"
d="m 50,54.25 c -2.35,0 -4.25,-1.9 -4.25,-4.25 V 35 c 0,-2.35 1.9,-4.25 4.25,-4.25 2.35,0 4.25,1.9 4.25,4.25 v 15 c 0,2.35 -1.9,4.25 -4.25,4.25 z"
id="path2" />
</g>
<g
id="g8"
transform="matrix(2.52,0,0,2.52,-26,-26)">
<circle
fill="#ed6b21"
cx="50"
cy="65"
r="5"
id="circle6" />
</g>
<g
id="g12"
transform="matrix(2.52,0,0,2.52,-26,-26)">
<path
fill="#ed6b21"
d="M 50,89.25 C 28.36,89.25 10.75,71.64 10.75,50 10.75,28.36 28.36,10.75 50,10.75 71.64,10.75 89.25,28.36 89.25,50 89.25,71.64 71.64,89.25 50,89.25 Z m 0,-70 C 33.05,19.25 19.25,33.04 19.25,50 19.25,66.95 33.04,80.75 50,80.75 66.95,80.75 80.75,66.96 80.75,50 80.75,33.05 66.95,19.25 50,19.25 Z"
id="path10" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.2.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.0" id="minimalize_window" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
y="0px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve">
<g>
<path fill="#ED6B21" d="M80,92.83H20c-7.08,0-12.83-5.76-12.83-12.84V20c0-7.08,5.76-12.83,12.83-12.83h60
c7.08,0,12.84,5.76,12.84,12.83v60C92.83,87.08,87.08,92.83,80,92.83z M20,12.83c-3.95,0-7.17,3.21-7.17,7.17v60
c0,3.95,3.21,7.17,7.17,7.17h60c3.95,0,7.17-3.21,7.17-7.17V20c0-3.95-3.21-7.17-7.17-7.17H20z"/>
</g>
<g>
<path fill="#ED6B21" d="M70,75.67H30c-3.13,0-5.67-2.54-5.67-5.67v-5c0-3.13,2.54-5.67,5.67-5.67h40c3.13,0,5.67,2.54,5.67,5.67v5
C75.67,73.13,73.13,75.67,70,75.67z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 858 B

View File

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
inkscape:version="1.0 (4035a4fb49, 2020-05-01)"
sodipodi:docname="notification_minimalize.svg"
xml:space="preserve"
enable-background="new 0 0 100 100"
viewBox="0 0 100 100"
y="0px"
x="0px"
id="minimalize_window"
version="1.0"><metadata
id="metadata15"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
id="defs13" /><sodipodi:namedview
inkscape:current-layer="minimalize_window"
inkscape:window-maximized="1"
inkscape:window-y="-8"
inkscape:window-x="-8"
inkscape:cy="50"
inkscape:cx="50"
inkscape:zoom="10.08"
showgrid="false"
id="namedview11"
inkscape:window-height="1377"
inkscape:window-width="2560"
inkscape:pageshadow="2"
inkscape:pageopacity="0"
guidetolerance="10"
gridtolerance="10"
objecttolerance="10"
borderopacity="1"
bordercolor="#666666"
pagecolor="#ffffff" />
<g
transform="matrix(1.15,0,0,1.15,-7.50075,-7.5)"
id="g4">
<path
id="path2"
d="M 80,92.83 H 20 C 12.92,92.83 7.17,87.07 7.17,79.99 V 20 C 7.17,12.92 12.93,7.17 20,7.17 h 60 c 7.08,0 12.84,5.76 12.84,12.83 V 80 C 92.83,87.08 87.08,92.83 80,92.83 Z m -60,-80 c -3.95,0 -7.17,3.21 -7.17,7.17 v 60 c 0,3.95 3.21,7.17 7.17,7.17 h 60 c 3.95,0 7.17,-3.21 7.17,-7.17 V 20 c 0,-3.95 -3.21,-7.17 -7.17,-7.17 z"
fill="#ed6b21" />
</g>
<g
transform="matrix(1.15,0,0,1.15,-7.50075,-7.5)"
id="g8">
<path
id="path6"
d="M 70,75.67 H 30 c -3.13,0 -5.67,-2.54 -5.67,-5.67 v -5 c 0,-3.13 2.54,-5.67 5.67,-5.67 h 40 c 3.13,0 5.67,2.54 5.67,5.67 v 5 c 0,3.13 -2.54,5.67 -5.67,5.67 z"
fill="#ed6b21" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
inkscape:version="1.0 (4035a4fb49, 2020-05-01)"
height="200"
width="200"
sodipodi:docname="notification_warning.svg"
xml:space="preserve"
enable-background="new 0 0 100 100"
viewBox="0 0 200 200"
y="0px"
x="0px"
id="warning"
version="1.0"><metadata
id="metadata19"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs17" /><sodipodi:namedview
inkscape:current-layer="warning"
inkscape:window-maximized="1"
inkscape:window-y="-8"
inkscape:window-x="-8"
inkscape:cy="71.071558"
inkscape:cx="34.775892"
inkscape:zoom="3.5638182"
showgrid="false"
id="namedview15"
inkscape:window-height="1377"
inkscape:window-width="2560"
inkscape:pageshadow="2"
inkscape:pageopacity="0"
guidetolerance="10"
gridtolerance="10"
objecttolerance="10"
borderopacity="1"
bordercolor="#666666"
pagecolor="#ffffff" />
<g
transform="matrix(2.2,0,0,2.2,-9.9977389,-10)"
id="g4">
<path
id="path2"
d="M 90,89.25 H 10 C 8.48,89.25 7.08,88.44 6.32,87.13 5.56,85.82 5.55,84.2 6.31,82.89 l 40,-70 c 0.76,-1.33 2.17,-2.14 3.69,-2.14 1.53,0 2.93,0.82 3.69,2.14 l 40,70 c 0.75,1.32 0.75,2.93 -0.01,4.24 -0.76,1.32 -2.16,2.12 -3.68,2.12 z M 17.33,80.75 H 82.68 L 50,23.57 Z"
fill="#ed6b21" />
</g>
<g
transform="matrix(2.2,0,0,2.2,-9.9977389,-10)"
id="g8">
<path
id="path6"
d="m 50,59.25 c -2.35,0 -4.25,-1.9 -4.25,-4.25 V 40 c 0,-2.35 1.9,-4.25 4.25,-4.25 2.35,0 4.25,1.9 4.25,4.25 v 15 c 0,2.35 -1.9,4.25 -4.25,4.25 z"
fill="#ed6b21" />
</g>
<g
transform="matrix(2.2,0,0,2.2,-9.9977389,-10)"
id="g12">
<circle
id="circle10"
r="5"
cy="70"
cx="50"
fill="#ed6b21" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -108,17 +108,19 @@ namespace ImGui
const char ColorMarkerEnd = 0x3; // ETX
// Special ASCII characters are used here as an ikons markers
const char PrintIconMarker = 0x4;
const char PrinterIconMarker = 0x5;
const char PrinterSlaIconMarker = 0x6;
const char FilamentIconMarker = 0x7;
const char MaterialIconMarker = 0x8;
const char CloseIconMarker = 0xB;
const char CloseIconHoverMarker = 0xC;
const char TimerDotMarker = 0xE;
const char TimerDotEmptyMarker = 0xF;
const char WarningMarker = 0x10;
const char ErrorMarker = 0x11;
const char PrintIconMarker = 0x4;
const char PrinterIconMarker = 0x5;
const char PrinterSlaIconMarker = 0x6;
const char FilamentIconMarker = 0x7;
const char MaterialIconMarker = 0x8;
const char CloseIconMarker = 0xB;
const char CloseIconHoverMarker = 0xC;
// const char TimerDotMarker = 0xE;
// const char TimerDotEmptyMarker = 0xF;
const char MinimalizeMarker = 0xE;
const char MinimalizeHoverMarker = 0xF;
const char WarningMarker = 0x10;
const char ErrorMarker = 0x11;
// void MyFunction(const char* name, const MyMatrix44& v);
}

View File

@ -37,17 +37,19 @@ namespace GUI {
static const std::map<const char, std::string> font_icons = {
{ImGui::PrintIconMarker , "cog" },
{ImGui::PrinterIconMarker , "printer" },
{ImGui::PrinterSlaIconMarker, "sla_printer" },
{ImGui::FilamentIconMarker , "spool" },
{ImGui::MaterialIconMarker , "resin" },
{ImGui::CloseIconMarker , "cross" },
{ImGui::CloseIconHoverMarker, "cross_focus_large" },
{ImGui::TimerDotMarker , "timer_dot" },
{ImGui::TimerDotEmptyMarker , "timer_dot_empty" },
{ImGui::WarningMarker , "flag_green" },
{ImGui::ErrorMarker , "flag_red" }
{ImGui::PrintIconMarker , "cog" },
{ImGui::PrinterIconMarker , "printer" },
{ImGui::PrinterSlaIconMarker , "sla_printer" },
{ImGui::FilamentIconMarker , "spool" },
{ImGui::MaterialIconMarker , "resin" },
{ImGui::CloseIconMarker , "notification_close" },
{ImGui::CloseIconHoverMarker , "notification_close_hover" },
//{ImGui::TimerDotMarker , "timer_dot" },
//{ImGui::TimerDotEmptyMarker , "timer_dot_empty" },
{ImGui::MinimalizeMarker , "notification_minimalize" },
{ImGui::MinimalizeHoverMarker , "notification_minimalize_hover" },
{ImGui::WarningMarker , "notification_warning" },
{ImGui::ErrorMarker , "notification_error" }
};
const ImVec4 ImGuiWrapper::COL_GREY_DARK = { 0.333f, 0.333f, 0.333f, 1.0f };

View File

@ -492,12 +492,12 @@ void NotificationManager::PopNotification::render_minimize_button(ImGuiWrapper&
//button - if part if treggered
std::string button_text;
button_text = ImGui::CloseIconMarker;
button_text = ImGui::MinimalizeMarker;
if (ImGui::IsMouseHoveringRect(ImVec2(win_pos_x - m_window_width / 10.f, win_pos_y + m_window_height - 2 * m_line_height + 1),
ImVec2(win_pos_x, win_pos_y + m_window_height),
true))
{
button_text = ImGui::CloseIconHoverMarker;
button_text = ImGui::MinimalizeHoverMarker;
}
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);

View File

@ -3481,6 +3481,10 @@ void Plater::priv::add_warning(const Slic3r::PrintStateBase::Warning& warning, s
}
void Plater::priv::actualizate_warnings(const Model& model, size_t print_oid)
{
if (model.objects.size() == 0) {
clear_warnings();
return;
}
std::vector<size_t> living_oids;
living_oids.push_back(model.id().id);
living_oids.push_back(print_oid);