This commit is contained in:
mwalker33 2020-04-11 17:26:43 +10:00
commit 1900f6b16a
4 changed files with 33 additions and 5 deletions

View file

@ -210,10 +210,14 @@ ProxWidget::ProxWidget(QWidget *parent, ProxGuiQT *master) : QWidget(parent) {
// shows plot window on the screen. // shows plot window on the screen.
show(); show();
// Move controller widget below plot if (session.settings_loaded)
controlWidget->move(x(), y() + frameSize().height()); controlWidget->setGeometry (session.window_overlay_xpos,session.window_overlay_ypos,session.window_overlay_wsize,session.window_overlay_hsize);
controlWidget->resize(size().width(), 200); else {
// Move controller widget below plot
controlWidget->move(x(), y() + frameSize().height());
controlWidget->resize(size().width(), 200);
}
// Olverlays / slider window title // Olverlays / slider window title
QString ct = QString("[*]Slider [ %1 ]").arg((char *)gui_serial_port_name); QString ct = QString("[*]Slider [ %1 ]").arg((char *)gui_serial_port_name);
controlWidget->setWindowTitle(ct); controlWidget->setWindowTitle(ct);

View file

@ -30,7 +30,7 @@
#include "settings.h" #include "settings.h"
// Used to enable/disable use of settings json file // Used to enable/disable use of settings json file
// #define USE_SETTING_FILE #define USE_SETTING_FILE
static void showBanner(void) { static void showBanner(void) {

View file

@ -64,6 +64,10 @@ int settings_load (void) {
session.window_plot_ypos = 30; session.window_plot_ypos = 30;
session.window_plot_hsize = 400; session.window_plot_hsize = 400;
session.window_plot_wsize = 800; 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.emoji_mode = ALIAS;
session.show_hints = false; session.show_hints = false;
session.supports_colors = 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.hsize",session.window_plot_hsize);
JsonSaveInt (root,"window.plot.wsize",session.window_plot_wsize); 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 // Emoji
switch (session.emoji_mode) { switch (session.emoji_mode) {
case ALIAS: JsonSaveStr (root,"show.emoji","alias"); break; 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) if (json_unpack_ex(root,&up_error, 0, "{s:i}","window.plot.wsize",&i1) == 0)
session.window_plot_wsize = i1; 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 // show options
if (json_unpack_ex(root,&up_error, 0, "{s:s}","show.emoji",&s1) == 0) { if (json_unpack_ex(root,&up_error, 0, "{s:s}","show.emoji",&s1) == 0) {
strncpy (tempStr,s1,sizeof(tempStr)-1); strncpy (tempStr,s1,sizeof(tempStr)-1);

View file

@ -34,6 +34,10 @@ typedef struct {
int window_plot_ypos; int window_plot_ypos;
int window_plot_hsize; int window_plot_hsize;
int window_plot_wsize; 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; clientdebugLevel_t client_debug_level;
} session_arg_t; } session_arg_t;