Skip to content

Commit

Permalink
display: Preserve checkbox status when re-creating them
Browse files Browse the repository at this point in the history
Makes the 'skip animation' checkbox retain its value when redrawing the window.

Fixes #2176.
  • Loading branch information
jostephd authored and GregoryLundberg committed Nov 30, 2017
1 parent 0f4cabc commit 94571b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/display.cpp
Expand Up @@ -932,7 +932,12 @@ void display::create_buttons()
}

std::shared_ptr<gui::button> b_prev = find_action_button(b->id());
if(b_prev) b->enable(b_prev->enabled());
if(b_prev) {
b->enable(b_prev->enabled());
if (b_prev->get_type() == gui::button::TYPE_CHECK) {
b->set_check(b_prev->checked());
}
}

action_work.push_back(b);
}
Expand Down
1 change: 1 addition & 0 deletions src/widgets/button.hpp
Expand Up @@ -31,6 +31,7 @@ class button : public widget
};

enum TYPE { TYPE_PRESS, TYPE_CHECK, TYPE_TURBO, TYPE_IMAGE, TYPE_RADIO };
TYPE get_type() const { return type_; };

enum SPACE_CONSUMPTION { DEFAULT_SPACE, MINIMUM_SPACE };

Expand Down

0 comments on commit 94571b5

Please sign in to comment.