Detect if the entry is hidden and don't draw it in that case

This commit is contained in:
Ray Strode 2008-08-05 17:21:47 -04:00
parent 334300f89d
commit 2e3974e86a
3 changed files with 26 additions and 2 deletions

View file

@ -67,6 +67,8 @@ struct _ply_entry
int number_of_bullets;
int max_number_of_visible_bullets;
uint32_t is_hidden : 1;
};
ply_entry_t *
@ -89,6 +91,8 @@ ply_entry_new (const char *image_dir)
entry->bullet_image = ply_image_new (image_path);
free (image_path);
entry->is_hidden = true;
return entry;
}
@ -145,6 +149,9 @@ ply_entry_draw (ply_entry_t *entry)
uint32_t *text_field_data, *bullet_data;
int i, number_of_visible_bullets;
if (entry->is_hidden)
return;
ply_frame_buffer_pause_updates (entry->frame_buffer);
text_field_data = ply_image_get_data (entry->text_field_image);
@ -219,6 +226,8 @@ ply_entry_show (ply_entry_t *entry,
entry->area.x = x;
entry->area.y = y;
entry->is_hidden = false;
ply_entry_draw (entry);
}
@ -229,6 +238,15 @@ ply_entry_hide (ply_entry_t *entry)
entry->frame_buffer = NULL;
entry->window = NULL;
entry->loop = NULL;
entry->is_hidden = true;
}
bool
ply_entry_is_hidden (ply_entry_t *entry)
{
return entry->is_hidden;
}
long

View file

@ -44,6 +44,7 @@ void ply_entry_show (ply_entry_t *entry,
long y);
void ply_entry_hide (ply_entry_t *entry);
void ply_entry_draw (ply_entry_t *entry);
bool ply_entry_is_hidden (ply_entry_t *entry);
long ply_entry_get_width (ply_entry_t *entry);
long ply_entry_get_height (ply_entry_t *entry);

View file

@ -449,8 +449,13 @@ ask_for_password (ply_boot_splash_plugin_t *plugin,
{
plugin->pending_password_answer = answer;
stop_animation (plugin);
show_password_entry (plugin);
if (ply_entry_is_hidden (plugin->entry))
{
stop_animation (plugin);
show_password_entry (plugin);
}
else
ply_entry_draw (plugin->entry);
}
ply_boot_splash_plugin_interface_t *