Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnrico Turri <enricoturri@seznam.cz>2019-01-16 13:10:24 +0300
committerEnrico Turri <enricoturri@seznam.cz>2019-01-16 13:10:24 +0300
commit52493e17397cac76e79d66ff0d8651863a6468f2 (patch)
treea143bde039f99817cc41830456a72d12f87186f4 /src/slic3r/GUI/GLToolbar.cpp
parent02a22ba991b5516c2ec749e7fd920046e1722744 (diff)
Show gizmos and toolbars tooltips when hovering on a disabled item
Diffstat (limited to 'src/slic3r/GUI/GLToolbar.cpp')
-rw-r--r--src/slic3r/GUI/GLToolbar.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/slic3r/GUI/GLToolbar.cpp b/src/slic3r/GUI/GLToolbar.cpp
index 0efc19dee..8a9c12f26 100644
--- a/src/slic3r/GUI/GLToolbar.cpp
+++ b/src/slic3r/GUI/GLToolbar.cpp
@@ -530,6 +530,8 @@ std::string GLToolbar::update_hover_state_horizontal(const Vec2d& mouse_pos, GLC
GLToolbarItem::EState state = item->get_state();
bool inside = (left <= (float)scaled_mouse_pos(0)) && ((float)scaled_mouse_pos(0) <= right) && (bottom <= (float)scaled_mouse_pos(1)) && ((float)scaled_mouse_pos(1) <= top);
+ if (inside)
+ tooltip = item->get_tooltip();
switch (state)
{
@@ -545,9 +547,7 @@ std::string GLToolbar::update_hover_state_horizontal(const Vec2d& mouse_pos, GLC
}
case GLToolbarItem::Hover:
{
- if (inside)
- tooltip = item->get_tooltip();
- else
+ if (!inside)
{
item->set_state(GLToolbarItem::Normal);
parent.set_as_dirty();
@@ -567,9 +567,7 @@ std::string GLToolbar::update_hover_state_horizontal(const Vec2d& mouse_pos, GLC
}
case GLToolbarItem::HoverPressed:
{
- if (inside)
- tooltip = item->get_tooltip();
- else
+ if (!inside)
{
item->set_state(GLToolbarItem::Pressed);
parent.set_as_dirty();
@@ -623,6 +621,8 @@ std::string GLToolbar::update_hover_state_vertical(const Vec2d& mouse_pos, GLCan
GLToolbarItem::EState state = item->get_state();
bool inside = (left <= (float)scaled_mouse_pos(0)) && ((float)scaled_mouse_pos(0) <= right) && (bottom <= (float)scaled_mouse_pos(1)) && ((float)scaled_mouse_pos(1) <= top);
+ if (inside)
+ tooltip = item->get_tooltip();
switch (state)
{
@@ -638,9 +638,7 @@ std::string GLToolbar::update_hover_state_vertical(const Vec2d& mouse_pos, GLCan
}
case GLToolbarItem::Hover:
{
- if (inside)
- tooltip = item->get_tooltip();
- else
+ if (!inside)
{
item->set_state(GLToolbarItem::Normal);
parent.set_as_dirty();
@@ -660,9 +658,7 @@ std::string GLToolbar::update_hover_state_vertical(const Vec2d& mouse_pos, GLCan
}
case GLToolbarItem::HoverPressed:
{
- if (inside)
- tooltip = item->get_tooltip();
- else
+ if (!inside)
{
item->set_state(GLToolbarItem::Pressed);
parent.set_as_dirty();