mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
Removal of tabs from plater -> Fixed buttons update when switching between views using keyboard
This commit is contained in:
parent
c908a4674a
commit
8d78b23c78
5 changed files with 22 additions and 8 deletions
|
@ -939,7 +939,7 @@ int GLRadioToolbar::contains_mouse(const Vec2d& mouse_pos, const GLCanvas3D& par
|
|||
return -1;
|
||||
}
|
||||
|
||||
std::string GLRadioToolbar::update_hover_state(const Vec2d& mouse_pos, const GLCanvas3D& parent)
|
||||
std::string GLRadioToolbar::update_hover_state(const Vec2d& mouse_pos, GLCanvas3D& parent)
|
||||
{
|
||||
float zoom = parent.get_camera_zoom();
|
||||
float inv_zoom = (zoom != 0.0f) ? 1.0f / zoom : 0.0f;
|
||||
|
@ -967,7 +967,10 @@ std::string GLRadioToolbar::update_hover_state(const Vec2d& mouse_pos, const GLC
|
|||
case GLRadioToolbarItem::Normal:
|
||||
{
|
||||
if (inside)
|
||||
{
|
||||
item->set_state(GLRadioToolbarItem::Hover);
|
||||
parent.set_as_dirty();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -976,14 +979,20 @@ std::string GLRadioToolbar::update_hover_state(const Vec2d& mouse_pos, const GLC
|
|||
if (inside)
|
||||
tooltip = item->get_tooltip();
|
||||
else
|
||||
{
|
||||
item->set_state(GLRadioToolbarItem::Normal);
|
||||
parent.set_as_dirty();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case GLRadioToolbarItem::Pressed:
|
||||
{
|
||||
if (inside)
|
||||
{
|
||||
item->set_state(GLRadioToolbarItem::HoverPressed);
|
||||
parent.set_as_dirty();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -992,7 +1001,10 @@ std::string GLRadioToolbar::update_hover_state(const Vec2d& mouse_pos, const GLC
|
|||
if (inside)
|
||||
tooltip = item->get_tooltip();
|
||||
else
|
||||
{
|
||||
item->set_state(GLRadioToolbarItem::Pressed);
|
||||
parent.set_as_dirty();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -268,7 +268,7 @@ public:
|
|||
// returns the id of the item under the given mouse position or -1 if none
|
||||
int contains_mouse(const Vec2d& mouse_pos, const GLCanvas3D& parent) const;
|
||||
|
||||
std::string update_hover_state(const Vec2d& mouse_pos, const GLCanvas3D& parent);
|
||||
std::string update_hover_state(const Vec2d& mouse_pos, GLCanvas3D& parent);
|
||||
|
||||
void do_action(unsigned int item_id, GLCanvas3D& parent);
|
||||
|
||||
|
|
|
@ -1295,6 +1295,8 @@ void Plater::priv::select_view_3D(const std::string& name)
|
|||
set_current_panel(view3D);
|
||||
else if (name == "Preview")
|
||||
set_current_panel(preview);
|
||||
|
||||
view_toolbar.set_selection(name);
|
||||
}
|
||||
#else
|
||||
void Plater::priv::select_view(const std::string& direction)
|
||||
|
@ -2482,14 +2484,14 @@ void Plater::priv::init_view_toolbar()
|
|||
|
||||
GLRadioToolbarItem::Data item;
|
||||
|
||||
item.name = "3d";
|
||||
item.name = "3D";
|
||||
item.tooltip = GUI::L_str("3D editor view");
|
||||
item.sprite_id = 0;
|
||||
item.action_event = EVT_GLVIEWTOOLBAR_3D;
|
||||
if (!view_toolbar.add_item(item))
|
||||
return;
|
||||
|
||||
item.name = "preview";
|
||||
item.name = "Preview";
|
||||
item.tooltip = GUI::L_str("Preview");
|
||||
item.sprite_id = 1;
|
||||
item.action_event = EVT_GLVIEWTOOLBAR_PREVIEW;
|
||||
|
@ -2499,7 +2501,7 @@ void Plater::priv::init_view_toolbar()
|
|||
view3D->set_view_toolbar(&view_toolbar);
|
||||
preview->set_view_toolbar(&view_toolbar);
|
||||
|
||||
view_toolbar.set_selection("3d");
|
||||
view_toolbar.set_selection("3D");
|
||||
}
|
||||
#endif // ENABLE_REMOVE_TABS_FROM_PLATER
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue