menu widgets: reimplement screenshot widget

This commit is contained in:
natinusala 2019-04-08 16:39:50 +02:00
parent e1838b4908
commit 3d52f2bf8f

View File

@ -43,6 +43,10 @@
#define IMG_EXT "bmp"
#endif
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
#include "../../menu/widgets/menu_widgets.h"
#endif
#include "../defaults.h"
#include "../command.h"
#include "../configuration.h"
@ -126,6 +130,11 @@ static bool screenshot_dump_direct(screenshot_task_state_t *state)
bmp_type);
#endif
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
if (!state->silence)
menu_widgets_screenshot_taken(state->shotname, state->filename);
#endif
return ret;
}
@ -290,6 +299,11 @@ static bool screenshot_dump(
if (use_thread)
{
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
if (video_driver_has_widgets())
task_free_title(task);
else
#endif
if (!savestate)
task->title = strdup(msg_hash_to_str(MSG_TAKING_SCREENSHOT));
@ -444,6 +458,11 @@ bool take_screenshot(const char *name_base, bool silence, bool has_valid_framebu
bool is_perfcnt_enable = false;
bool ret = false;
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
if (!silence)
menu_widgets_take_screenshot();
#endif
runloop_get_status(&is_paused, &is_idle, &is_slowmotion, &is_perfcnt_enable);
ret = take_screenshot_choice(name_base, silence, is_paused, is_idle,