From 0005049927364f542ef291ac6517febb868a0af3 Mon Sep 17 00:00:00 2001 From: YuSanka <yusanka@gmail.com> Date: Thu, 28 Nov 2019 15:37:47 +0100 Subject: [PATCH] Updated icons for DoubleSlider --- resources/icons/colorchange_add.svg | 16 +++++++++++ resources/icons/colorchange_add_f.svg | 16 +++++++++++ resources/icons/colorchange_add_m.svg | 20 ++++++++++++++ resources/icons/colorchange_del.svg | 16 +++++++++++ resources/icons/colorchange_del_f.svg | 16 +++++++++++ resources/icons/thumb_down.svg | 10 +++++++ resources/icons/thumb_up.svg | 10 +++++++ src/slic3r/GUI/wxExtensions.cpp | 40 ++++++++++----------------- 8 files changed, 118 insertions(+), 26 deletions(-) create mode 100644 resources/icons/colorchange_add.svg create mode 100644 resources/icons/colorchange_add_f.svg create mode 100644 resources/icons/colorchange_add_m.svg create mode 100644 resources/icons/colorchange_del.svg create mode 100644 resources/icons/colorchange_del_f.svg create mode 100644 resources/icons/thumb_down.svg create mode 100644 resources/icons/thumb_up.svg diff --git a/resources/icons/colorchange_add.svg b/resources/icons/colorchange_add.svg new file mode 100644 index 000000000..b72fddb0e --- /dev/null +++ b/resources/icons/colorchange_add.svg @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve"> +<g id="hex_x5F_plus"> + <g> + <polygon fill="#ED6B21" points="8,1 2,5 2,7 2,11 8,15 14,11 14,7 14,5 "/> + </g> + <g id="plus_1_"> + + <line fill="none" stroke="#FFFFFF" stroke-width="1.5" stroke-linecap="round" stroke-miterlimit="10" x1="8" y1="5" x2="8" y2="11"/> + + <line fill="none" stroke="#FFFFFF" stroke-width="1.5" stroke-linecap="round" stroke-miterlimit="10" x1="11" y1="8" x2="5" y2="8"/> + </g> +</g> +</svg> diff --git a/resources/icons/colorchange_add_f.svg b/resources/icons/colorchange_add_f.svg new file mode 100644 index 000000000..a96a62443 --- /dev/null +++ b/resources/icons/colorchange_add_f.svg @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve"> +<g id="hex_x5F_plus"> + <g> + <polygon fill="#ED6B21" points="8,1 2,5 2,7 2,11 8,15 14,11 14,7 14,5 "/> + </g> + <g id="plus_1_"> + + <line fill="none" stroke="#FFFFFF" stroke-width="2.126" stroke-linecap="round" stroke-miterlimit="10" x1="8" y1="5" x2="8" y2="11"/> + + <line fill="none" stroke="#FFFFFF" stroke-width="2.126" stroke-linecap="round" stroke-miterlimit="10" x1="11" y1="8" x2="5" y2="8"/> + </g> +</g> +</svg> diff --git a/resources/icons/colorchange_add_m.svg b/resources/icons/colorchange_add_m.svg new file mode 100644 index 000000000..82cd1e5f4 --- /dev/null +++ b/resources/icons/colorchange_add_m.svg @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve"> +<g id="hex_x5F_plus"> + <g> + <path fill="#808080" d="M8,1.85l5.29,3.53V7v3.62L8,14.15l-5.29-3.53V7V5.38L8,1.85 M8,1L2,5v2v4l6,4l6-4V7V5L8,1L8,1z"/> + </g> + <g id="plus_1_"> + <g> + <path fill="#ED6B21" d="M8,11.71c-0.39,0-0.71-0.32-0.71-0.71V5c0-0.39,0.32-0.71,0.71-0.71S8.71,4.61,8.71,5v6 + C8.71,11.39,8.39,11.71,8,11.71z"/> + </g> + <g> + <path fill="#ED6B21" d="M11,8.71H5C4.61,8.71,4.29,8.39,4.29,8S4.61,7.29,5,7.29h6c0.39,0,0.71,0.32,0.71,0.71 + S11.39,8.71,11,8.71z"/> + </g> + </g> +</g> +</svg> diff --git a/resources/icons/colorchange_del.svg b/resources/icons/colorchange_del.svg new file mode 100644 index 000000000..0bd9e0667 --- /dev/null +++ b/resources/icons/colorchange_del.svg @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve"> +<g id="hex_x5F_X"> + <g> + <polygon fill="#808080" points="8,1 2,5 2,7 2,11 8,15 14,11 14,7 14,5 "/> + </g> + <g id="plus_2_"> + + <line fill="none" stroke="#FFFFFF" stroke-width="1.5" stroke-linecap="round" stroke-miterlimit="10" x1="10.12" y1="5.88" x2="5.88" y2="10.12"/> + + <line fill="none" stroke="#FFFFFF" stroke-width="1.5" stroke-linecap="round" stroke-miterlimit="10" x1="10.12" y1="10.12" x2="5.88" y2="5.88"/> + </g> +</g> +</svg> diff --git a/resources/icons/colorchange_del_f.svg b/resources/icons/colorchange_del_f.svg new file mode 100644 index 000000000..a54452e1f --- /dev/null +++ b/resources/icons/colorchange_del_f.svg @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve"> +<g id="hex_x5F_X"> + <g> + <polygon fill="#808080" points="8,1 2,5 2,7 2,11 8,15 14,11 14,7 14,5 "/> + </g> + <g id="plus_2_"> + + <line fill="none" stroke="#FFFFFF" stroke-width="2.126" stroke-linecap="round" stroke-miterlimit="10" x1="10.12" y1="5.88" x2="5.88" y2="10.12"/> + + <line fill="none" stroke="#FFFFFF" stroke-width="2.126" stroke-linecap="round" stroke-miterlimit="10" x1="10.12" y1="10.12" x2="5.88" y2="5.88"/> + </g> +</g> +</svg> diff --git a/resources/icons/thumb_down.svg b/resources/icons/thumb_down.svg new file mode 100644 index 000000000..0499cea41 --- /dev/null +++ b/resources/icons/thumb_down.svg @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve"> +<g id="hex_x5F_plus"> + <g> + <polygon fill="#ED6B21" points="2,8 2,11 8,15 14,11 14,8 "/> + </g> +</g> +</svg> diff --git a/resources/icons/thumb_up.svg b/resources/icons/thumb_up.svg new file mode 100644 index 000000000..c9045929b --- /dev/null +++ b/resources/icons/thumb_up.svg @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve"> +<g id="hex_x5F_plus"> + <g> + <polygon fill="#ED6B21" points="8,1 2,5 2,7 2,8 14,8 14,7 14,5 "/> + </g> +</g> +</svg> diff --git a/src/slic3r/GUI/wxExtensions.cpp b/src/slic3r/GUI/wxExtensions.cpp index 90cfe6824..4a3f05bc1 100644 --- a/src/slic3r/GUI/wxExtensions.cpp +++ b/src/slic3r/GUI/wxExtensions.cpp @@ -2300,15 +2300,15 @@ DoubleSlider::DoubleSlider( wxWindow *parent, const float scale_factor = get_svg_scale_factor(this); - m_bmp_thumb_higher = (style == wxSL_HORIZONTAL ? ScalableBitmap(this, "right_half_circle.png") : ScalableBitmap(this, "up_half_circle.png", 16, true)); - m_bmp_thumb_lower = (style == wxSL_HORIZONTAL ? ScalableBitmap(this, "left_half_circle.png" ) : ScalableBitmap(this, "down_half_circle.png", 16, true)); + m_bmp_thumb_higher = (style == wxSL_HORIZONTAL ? ScalableBitmap(this, "right_half_circle.png") : ScalableBitmap(this, "thumb_up")); + m_bmp_thumb_lower = (style == wxSL_HORIZONTAL ? ScalableBitmap(this, "left_half_circle.png" ) : ScalableBitmap(this, "thumb_down")); m_thumb_size = m_bmp_thumb_lower.bmp().GetSize(); - m_bmp_add_tick_on = ScalableBitmap(this, "colorchange_add_on.png"); - m_bmp_add_tick_off = ScalableBitmap(this, "colorchange_add_off.png"); - m_bmp_del_tick_on = ScalableBitmap(this, "colorchange_delete_on.png"); - m_bmp_del_tick_off = ScalableBitmap(this, "colorchange_delete_off.png"); - m_tick_icon_dim = m_bmp_add_tick_on.bmp().GetSize().x; + m_bmp_add_tick_on = ScalableBitmap(this, "colorchange_add"); + m_bmp_add_tick_off = ScalableBitmap(this, "colorchange_add_f"); + m_bmp_del_tick_on = ScalableBitmap(this, "colorchange_del"); + m_bmp_del_tick_off = ScalableBitmap(this, "colorchange_del_f"); + m_tick_icon_dim = int((float)m_bmp_add_tick_on.bmp().GetSize().x / scale_factor); m_bmp_one_layer_lock_on = ScalableBitmap(this, "lock_closed"); m_bmp_one_layer_lock_off = ScalableBitmap(this, "lock_closed_f"); @@ -2341,7 +2341,7 @@ DoubleSlider::DoubleSlider( wxWindow *parent, // control's view variables SLIDER_MARGIN = 4 + Slic3r::GUI::wxGetApp().em_unit(); - DARK_ORANGE_PEN = wxPen(wxColour(253, 84, 2)); + DARK_ORANGE_PEN = wxPen(wxColour(237, 107, 33)); ORANGE_PEN = wxPen(wxColour(253, 126, 66)); LIGHT_ORANGE_PEN = wxPen(wxColour(254, 177, 139)); @@ -2716,7 +2716,7 @@ void DoubleSlider::draw_thumb_item(wxDC& dc, const wxPoint& pos, const SelectedS } else { x_draw = pos.x - int(0.5*m_thumb_size.x); - y_draw = pos.y+1; + y_draw = pos.y - int(0.5*m_thumb_size.y); } } else{ @@ -2726,7 +2726,7 @@ void DoubleSlider::draw_thumb_item(wxDC& dc, const wxPoint& pos, const SelectedS } else { x_draw = pos.x - int(0.5*m_thumb_size.x); - y_draw = pos.y - m_thumb_size.y; + y_draw = pos.y - int(0.5*m_thumb_size.y); } } dc.DrawBitmap(selection == ssLower ? m_bmp_thumb_lower.bmp() : m_bmp_thumb_higher.bmp(), x_draw, y_draw); @@ -2918,7 +2918,7 @@ void DoubleSlider::draw_cog_icon(wxDC& dc) void DoubleSlider::update_thumb_rect(const wxCoord& begin_x, const wxCoord& begin_y, const SelectedSlider& selection) { - const wxRect& rect = wxRect(begin_x, begin_y, m_thumb_size.x, m_thumb_size.y); + const wxRect& rect = wxRect(begin_x, begin_y, m_thumb_size.x, int(m_thumb_size.y*0.5)); if (selection == ssLower) m_rect_lower_thumb = rect; else @@ -3166,18 +3166,6 @@ void DoubleSlider::OnLeftUp(wxMouseEvent& event) const int extruders_cnt = Slic3r::GUI::wxGetApp().extruders_edited_cnt(); if (extruders_cnt > 1) { - /* - wxMenu* add_color_change_menu = new wxMenu(); - - for (int i = 1; i <= extruders_cnt; i++) - append_menu_item(add_color_change_menu, wxID_ANY, wxString::Format(_(L("Extruder %d")), i), "", - [this, i](wxCommandEvent&) { add_code(Slic3r::ColorChangeCode, i); }, "", &menu); - - const wxString menu_name = from_u8((boost::format(_utf8(L("Add color change (%1%) for:"))) % Slic3r::ColorChangeCode).str()); - wxMenuItem* add_color_change_menu_item = menu.AppendSubMenu(add_color_change_menu, menu_name, ""); - add_color_change_menu_item->SetBitmap(create_scaled_bitmap(nullptr, "colorchange_add_off.png")); - */ - const int initial_extruder = get_extruder_for_tick(m_selection == ssLower ? m_lower_value : m_higher_value); wxMenu* change_extruder_menu = new wxMenu(); @@ -3450,12 +3438,12 @@ void DoubleSlider::OnRightUp(wxMouseEvent& event) const wxString menu_name = from_u8((boost::format(_utf8(L("Add color change (%1%) for:"))) % Slic3r::ColorChangeCode).str()); wxMenuItem* add_color_change_menu_item = menu.AppendSubMenu(add_color_change_menu, menu_name, ""); - add_color_change_menu_item->SetBitmap(create_scaled_bitmap(nullptr, "colorchange_add_off.png")); + add_color_change_menu_item->SetBitmap(create_scaled_bitmap(nullptr, "colorchange_add_m")); } } else append_menu_item(&menu, wxID_ANY, _(L("Add color change")) + " (M600)", "", - [this](wxCommandEvent&) { add_code(Slic3r::ColorChangeCode); }, "colorchange_add_off.png", &menu); + [this](wxCommandEvent&) { add_code(Slic3r::ColorChangeCode); }, "colorchange_add_m", &menu); append_menu_item(&menu, wxID_ANY, _(L("Add pause print")) + " (M601)", "", [this](wxCommandEvent&) { add_code(Slic3r::PausePrintCode); }, "pause_print", &menu); @@ -3481,7 +3469,7 @@ void DoubleSlider::OnRightUp(wxMouseEvent& event) append_menu_item(&menu, wxID_ANY, it->gcode == Slic3r::ColorChangeCode ? _(L("Delete color change")) : it->gcode == Slic3r::PausePrintCode ? _(L("Delete pause print")) : _(L("Delete custom G-code")), "", - [this](wxCommandEvent&) { action_tick(taDel); }, "colorchange_delete_off.png", &menu); + [this](wxCommandEvent&) { action_tick(taDel); }, "colorchange_del_f", &menu); Slic3r::GUI::wxGetApp().plater()->PopupMenu(&menu);