save on exit message, * symbol on unsaved docs, saved status on history
This commit is contained in:
@@ -135,10 +135,13 @@ void ui::Canvas::clear(const glm::vec4& c/*={0,0,0,1}*/)
|
||||
{
|
||||
snap_history({ 0, 1, 2, 3, 4, 5 });
|
||||
m_layers[m_current_layer_idx].clear(c);
|
||||
m_unsaved = true;
|
||||
App::I.title_update();
|
||||
}
|
||||
void ui::Canvas::snap_history(const std::vector<int>& planes)
|
||||
{
|
||||
auto action = new ActionStroke;
|
||||
action->was_saved = !m_unsaved;
|
||||
for (auto i : planes)
|
||||
{
|
||||
if (!m_layers[m_current_layer_idx].m_dirty_face[i])
|
||||
@@ -462,7 +465,7 @@ void ui::Canvas::stroke_commit()
|
||||
{
|
||||
if (!m_dirty || m_layers.empty())
|
||||
return;
|
||||
m_unsaved = true;
|
||||
|
||||
m_dirty = false;
|
||||
m_dirty_stroke = true; // new stroke ready for timelapse capture
|
||||
App::I.redraw = true;
|
||||
@@ -476,7 +479,11 @@ void ui::Canvas::stroke_commit()
|
||||
|
||||
// allocate action to add to history
|
||||
auto action = new ActionStroke;
|
||||
|
||||
action->was_saved = !m_unsaved;
|
||||
|
||||
m_unsaved = true;
|
||||
App::I.title_update();
|
||||
|
||||
// prepare common states
|
||||
glViewport(0, 0, m_width, m_height);
|
||||
glDisable(GL_BLEND);
|
||||
@@ -854,6 +861,7 @@ void ui::Canvas::import_equirectangular_thread(std::string file_path)
|
||||
gl_state gl;
|
||||
gl.save();
|
||||
snap_history({0,1,2,3,4,5});
|
||||
m_unsaved = true;
|
||||
|
||||
Image img;
|
||||
img.load_file(file_path);
|
||||
|
||||
Reference in New Issue
Block a user