fix location palette buttons showing in other palettes.
This commit is contained in:
parent
d3f71cec74
commit
5870074ab9
2 changed files with 18 additions and 11 deletions
|
@ -181,9 +181,25 @@ sdl_handler_vector location_palette::handler_members()
|
|||
for (gui::widget& b : buttons_) {
|
||||
h.push_back(&b);
|
||||
}
|
||||
if (button_add_) { h.push_back(button_add_.get()); }
|
||||
if (button_delete_) { h.push_back(button_delete_.get()); }
|
||||
if (button_goto_) { h.push_back(button_goto_.get()); }
|
||||
return h;
|
||||
}
|
||||
|
||||
void location_palette::hide(bool hidden) {
|
||||
widget::hide(hidden);
|
||||
if (!hidden) {
|
||||
help_handle_ = gui_.video().set_help_string(get_help_string());
|
||||
}
|
||||
else {
|
||||
gui_.video().clear_help_string(help_handle_);
|
||||
}
|
||||
for (auto& w : handler_members()) {
|
||||
static_cast<gui::widget&>(*w).hide(hidden);
|
||||
}
|
||||
}
|
||||
|
||||
bool location_palette::scroll_up()
|
||||
{
|
||||
int decrement = 1;
|
||||
|
@ -343,15 +359,6 @@ void location_palette::draw_contents()
|
|||
update_rect(location());
|
||||
}
|
||||
|
||||
void location_palette::hide(bool hidden) {
|
||||
widget::hide(hidden);
|
||||
if (!hidden)
|
||||
help_handle_ = gui_.video().set_help_string(get_help_string());
|
||||
else gui_.video().clear_help_string(help_handle_);
|
||||
for (gui::widget& w : buttons_) {
|
||||
w.hide(hidden);
|
||||
}
|
||||
}
|
||||
std::vector<std::string> location_palette::action_pressed() const
|
||||
{
|
||||
std::vector<std::string> res;
|
||||
|
|
|
@ -74,6 +74,8 @@ public:
|
|||
virtual std::vector<std::string> action_pressed() const override;
|
||||
void add_item(const std::string& id);
|
||||
~location_palette();
|
||||
void hide(bool hidden) override;
|
||||
|
||||
private:
|
||||
|
||||
/** Scroll the editor-palette to the top. */
|
||||
|
@ -88,8 +90,6 @@ private:
|
|||
int num_items();
|
||||
/** Return the maximum number of items shown at the same time. */
|
||||
int num_visible_items();
|
||||
|
||||
void hide(bool hidden) override;
|
||||
protected:
|
||||
|
||||
editor_display &gui_;
|
||||
|
|
Loading…
Add table
Reference in a new issue