This commit is contained in:
bubnikv 2018-12-12 12:01:00 +01:00
commit ce3eced0c4
2 changed files with 15 additions and 9 deletions

View File

@ -68,8 +68,10 @@ static const float UNIT_MATRIX[] = { 1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f, 0.0f,
0.0f, 0.0f, 0.0f, 1.0f };
static const float DEFAULT_BG_COLOR[3] = { 10.0f / 255.0f, 98.0f / 255.0f, 144.0f / 255.0f };
static const float ERROR_BG_COLOR[3] = { 144.0f / 255.0f, 49.0f / 255.0f, 10.0f / 255.0f };
static const float DEFAULT_BG_DARK_COLOR[3] = { 0.478f, 0.478f, 0.478f };
static const float DEFAULT_BG_LIGHT_COLOR[3] = { 0.753f, 0.753f, 0.753f };
static const float ERROR_BG_DARK_COLOR[3] = { 0.478f, 0.192f, 0.039f };
static const float ERROR_BG_LIGHT_COLOR[3] = { 0.753f, 0.192f, 0.039f };
namespace Slic3r {
namespace GUI {
@ -579,7 +581,7 @@ void GLCanvas3D::Bed::_render_custom() const
::glEnableClientState(GL_VERTEX_ARRAY);
::glColor4f(0.8f, 0.6f, 0.5f, 0.4f);
::glColor4f(0.35f, 0.35f, 0.35f, 0.4f);
::glNormal3d(0.0f, 0.0f, 1.0f);
::glVertexPointer(3, GL_FLOAT, 0, (GLvoid*)m_triangles.get_vertices());
::glDrawArrays(GL_TRIANGLES, 0, (GLsizei)triangles_vcount);
@ -5810,14 +5812,18 @@ void GLCanvas3D::_render_background() const
::glDisable(GL_DEPTH_TEST);
::glBegin(GL_QUADS);
::glColor3f(0.0f, 0.0f, 0.0f);
if (m_dynamic_background_enabled && _is_any_volume_outside())
::glColor3fv(ERROR_BG_DARK_COLOR);
else
::glColor3fv(DEFAULT_BG_DARK_COLOR);
::glVertex2f(-1.0f, -1.0f);
::glVertex2f(1.0f, -1.0f);
if (m_dynamic_background_enabled && _is_any_volume_outside())
::glColor3fv(ERROR_BG_COLOR);
::glColor3fv(ERROR_BG_LIGHT_COLOR);
else
::glColor3fv(DEFAULT_BG_COLOR);
::glColor3fv(DEFAULT_BG_LIGHT_COLOR);
::glVertex2f(1.0f, 1.0f);
::glVertex2f(-1.0f, 1.0f);

View File

@ -337,7 +337,7 @@ void ObjectList::selection_changed()
void ObjectList::OnChar(wxKeyEvent& event)
{
printf("KeyDown event\n");
// printf("KeyDown event\n");
if (event.GetKeyCode() == WXK_BACK){
printf("WXK_BACK\n");
remove();
@ -427,10 +427,10 @@ void ObjectList::key_event(wxKeyEvent& event)
void ObjectList::OnBeginDrag(wxDataViewEvent &event)
{
wxDataViewItem item(event.GetItem());
const wxDataViewItem item(event.GetItem());
// only allow drags for item, not containers
if (multiple_selection() ||
if (multiple_selection() || GetSelection()!=item ||
m_objects_model->GetParent(item) == wxDataViewItem(0) ||
m_objects_model->GetItemType(item) != itVolume ) {
event.Veto();