Emboss open by context menu only

This commit is contained in:
Filip Sykala 2021-09-14 10:02:01 +02:00
parent 34026a15e8
commit 8226f74413
5 changed files with 12 additions and 70 deletions

View File

@ -1,63 +0,0 @@
<?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="Layer_1"
x="0px"
y="0px"
viewBox="0 0 128 128"
enable-background="new 0 0 128 128"
xml:space="preserve"
sodipodi:docname="emboss.svg"
inkscape:version="1.0.2 (e86c870879, 2021-01-15, custom)"><metadata
id="metadata22"><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="defs20">
</defs><sodipodi:namedview
pagecolor="#525252"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1137"
id="namedview18"
showgrid="false"
inkscape:pagecheckerboard="false"
inkscape:zoom="4"
inkscape:cx="60.351067"
inkscape:cy="55.536651"
inkscape:window-x="1912"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="Layer_1" />
<path
id="path875"
style="fill:#ed6b21;fill-opacity:1"
d="m 67.232422,8.3691406 c -1.93,0 -2.759957,1.7175194 -3.5,3.5000004 L 19.669922,118 h 3 l 13.09375,-31.537109 v -0.002 L 35.904297,86.123 c 0.09199,-0.09707 0.219473,-0.160156 0.359375,-0.160156 h 64.306638 c 0.16155,0 0.30232,0.08696 0.39453,0.210937 L 112.38281,118 h 3 L 77.304688,11.869141 c -0.651791,-1.81661 -1.57,-3.5000004 -3.5,-3.5000004 z m 0,3.0000004 h 6.572266 c 0.269998,0 0.40882,0.245862 0.5,0.5 L 99.8125,82.962891 H 37.216797 l 29.515625,-71.09375 c 0.103529,-0.249363 0.23,-0.5 0.5,-0.5 z" /><path
id="path6"
style="fill:#ffffff"
d="M 63.732422 6.6191406 C 61.802422 6.6191406 60.972465 8.3366596 60.232422 10.119141 L 16.169922 116.25 L 19.169922 116.25 L 32.263672 84.712891 L 32.263672 84.710938 L 32.404297 84.373047 C 32.496288 84.275976 32.62377 84.212891 32.763672 84.212891 L 97.070312 84.212891 C 97.231859 84.212891 97.372632 84.299851 97.464844 84.423828 L 108.88281 116.25 L 111.88281 116.25 L 73.804688 10.119141 C 73.152897 8.3025307 72.234688 6.6191406 70.304688 6.6191406 L 63.732422 6.6191406 z M 63.732422 9.6191406 L 70.304688 9.6191406 C 70.574686 9.6191406 70.713508 9.865003 70.804688 10.119141 L 96.3125 81.212891 L 33.716797 81.212891 L 63.232422 10.119141 C 63.335951 9.8697776 63.462422 9.6191406 63.732422 9.6191406 z " />
<g
aria-label="A"
id="text856"
style="font-size:158.738px;line-height:1.25;font-family:sans-serif;fill:#ffffff;stroke:none;stroke-width:8.505;stroke-miterlimit:4;stroke-dasharray:none" /></svg>

Before

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -39,10 +39,8 @@ public:
using namespace Slic3r;
using namespace Slic3r::GUI;
GLGizmoEmboss::GLGizmoEmboss(GLCanvas3D & parent,
const std::string &icon_filename,
unsigned int sprite_id)
: GLGizmoBase(parent, icon_filename, sprite_id)
GLGizmoEmboss::GLGizmoEmboss(GLCanvas3D &parent)
: GLGizmoBase(parent, M_ICON_FILENAME, -2)
, m_font_list({
{"NotoSans Regular", Slic3r::resources_dir() + "/fonts/NotoSans-Regular.ttf"},
{"NotoSans CJK", Slic3r::resources_dir() + "/fonts/NotoSansCJK-Regular.ttc"}})
@ -528,3 +526,6 @@ std::string GLGizmoEmboss::create_volume_name()
text = text.substr(0, max_len - 3) + " ..";
return _u8L("Text") + ": " + text;
}
// any existing icon filename to not influence GUI
const std::string GLGizmoEmboss::M_ICON_FILENAME = "cut.svg";

View File

@ -19,7 +19,7 @@ namespace Slic3r::GUI {
class GLGizmoEmboss : public GLGizmoBase
{
public:
GLGizmoEmboss(GLCanvas3D& parent, const std::string& icon_filename, unsigned int sprite_id);
GLGizmoEmboss(GLCanvas3D& parent);
virtual ~GLGizmoEmboss();
void set_volume_type(ModelVolumeType volume_type) { m_volume_type = volume_type; }
@ -33,7 +33,7 @@ protected:
virtual void on_render_for_picking() override;
virtual void on_render_input_window(float x, float y, float bottom_limit) override;
virtual bool on_is_activable() const override;
virtual bool on_is_selectable() const override { return true; }
virtual bool on_is_selectable() const override { return false; }
virtual void on_set_state() override;
private:
@ -81,6 +81,9 @@ private:
// actual volume
ModelVolume *m_volume;
ModelVolumeType m_volume_type;
// only temporary solution
static const std::string M_ICON_FILENAME;
};
} // namespace Slic3r::GUI

View File

@ -101,6 +101,7 @@ private:
const std::string tr_detail_level;
const std::string tr_decimate_ratio;
// only temporary solution
static const std::string M_ICON_FILENAME;
};

View File

@ -106,7 +106,7 @@ bool GLGizmosManager::init()
m_gizmos.emplace_back(new GLGizmoFdmSupports(m_parent, "fdm_supports.svg", 7));
m_gizmos.emplace_back(new GLGizmoSeam(m_parent, "seam.svg", 8));
m_gizmos.emplace_back(new GLGizmoMmuSegmentation(m_parent, "mmu_segmentation.svg", 9));
m_gizmos.emplace_back(new GLGizmoEmboss(m_parent, "emboss.svg", 10)); // TODO: fix icon
m_gizmos.emplace_back(new GLGizmoEmboss(m_parent));
m_gizmos.emplace_back(new GLGizmoSimplify(m_parent));
m_common_gizmos_data.reset(new CommonGizmosDataPool(&m_parent));