diff --git a/client/proxguiqt.cpp b/client/proxguiqt.cpp index dd5fd3f24..4e2c9299f 100644 --- a/client/proxguiqt.cpp +++ b/client/proxguiqt.cpp @@ -210,10 +210,14 @@ ProxWidget::ProxWidget(QWidget *parent, ProxGuiQT *master) : QWidget(parent) { // shows plot window on the screen. show(); - // Move controller widget below plot - controlWidget->move(x(), y() + frameSize().height()); - controlWidget->resize(size().width(), 200); - + if (session.settings_loaded) + controlWidget->setGeometry (session.window_overlay_xpos,session.window_overlay_ypos,session.window_overlay_wsize,session.window_overlay_hsize); + else { + // Move controller widget below plot + controlWidget->move(x(), y() + frameSize().height()); + controlWidget->resize(size().width(), 200); + } + // Olverlays / slider window title QString ct = QString("[*]Slider [ %1 ]").arg((char *)gui_serial_port_name); controlWidget->setWindowTitle(ct); diff --git a/client/proxmark3.c b/client/proxmark3.c index 4d36c490b..c5176dd64 100644 --- a/client/proxmark3.c +++ b/client/proxmark3.c @@ -30,7 +30,7 @@ #include "settings.h" // Used to enable/disable use of settings json file -// #define USE_SETTING_FILE +#define USE_SETTING_FILE static void showBanner(void) { diff --git a/client/settings.c b/client/settings.c index c3cb02ad6..4d59382e2 100644 --- a/client/settings.c +++ b/client/settings.c @@ -64,6 +64,10 @@ int settings_load (void) { session.window_plot_ypos = 30; session.window_plot_hsize = 400; session.window_plot_wsize = 800; + session.window_overlay_xpos = session.window_plot_xpos; + session.window_overlay_ypos = 20+session.window_plot_ypos + session.window_plot_hsize; + session.window_overlay_hsize = 200; + session.window_overlay_wsize = session.window_plot_wsize; session.emoji_mode = ALIAS; session.show_hints = false; session.supports_colors = false; @@ -131,6 +135,12 @@ void settings_save_callback (json_t *root) { JsonSaveInt (root,"window.plot.hsize",session.window_plot_hsize); JsonSaveInt (root,"window.plot.wsize",session.window_plot_wsize); + // Overlay/Slider window + JsonSaveInt (root,"window.overlay.xpos",session.window_overlay_xpos); + JsonSaveInt (root,"window.overlay.ypos",session.window_overlay_ypos); + JsonSaveInt (root,"window.overlay.hsize",session.window_overlay_hsize); + JsonSaveInt (root,"window.overlay.wsize",session.window_overlay_wsize); + // Emoji switch (session.emoji_mode) { case ALIAS: JsonSaveStr (root,"show.emoji","alias"); break; @@ -172,6 +182,16 @@ void settings_load_callback (json_t *root) { if (json_unpack_ex(root,&up_error, 0, "{s:i}","window.plot.wsize",&i1) == 0) session.window_plot_wsize = i1; + // overlay/slider plot + if (json_unpack_ex(root,&up_error, 0, "{s:i}","window.overlay.xpos",&i1) == 0) + session.window_overlay_xpos = i1; + if (json_unpack_ex(root,&up_error, 0, "{s:i}","window.overlay.ypos",&i1) == 0) + session.window_overlay_ypos = i1; + if (json_unpack_ex(root,&up_error, 0, "{s:i}","window.overlay.hsize",&i1) == 0) + session.window_overlay_hsize = i1; + if (json_unpack_ex(root,&up_error, 0, "{s:i}","window.overlay.wsize",&i1) == 0) + session.window_overlay_wsize = i1; + // show options if (json_unpack_ex(root,&up_error, 0, "{s:s}","show.emoji",&s1) == 0) { strncpy (tempStr,s1,sizeof(tempStr)-1); diff --git a/client/ui.h b/client/ui.h index 343b55c1f..e5048e751 100644 --- a/client/ui.h +++ b/client/ui.h @@ -34,6 +34,10 @@ typedef struct { int window_plot_ypos; int window_plot_hsize; int window_plot_wsize; + int window_overlay_xpos; + int window_overlay_ypos; + int window_overlay_hsize; + int window_overlay_wsize; clientdebugLevel_t client_debug_level; } session_arg_t;