Commit b0ef4d54 authored by Marcus Nordenberg's avatar Marcus Nordenberg Committed by Claes Sjöfors

rt_xtt_qt: change placement of operator window in accordance to opplace object

parent d16e5a1a
......@@ -154,7 +154,6 @@ OpQt::OpQt(void* op_parent_ctx, char* opplace, pwr_tStatus* status)
toplevel->setWindowFlags(Qt::CustomizeWindowHint);
CoWowQt::SetWindowIcon(toplevel);
QRect xtt_monitor_geometry = QApplication::desktop()->screenGeometry();
for (int i = 0; i < 5; i++) {
aalarm_active[i] = new_image_label(toplevel, "$pwr_exe/xtt_alarm_active.png");
......@@ -378,11 +377,11 @@ OpQt::OpQt(void* op_parent_ctx, char* opplace, pwr_tStatus* status)
if (sup_vect.size() > 10) {
padding1 = 0;
padding2 = 0;
buttonwidth = (xtt_monitor_geometry.width() - 350) / sup_vect.size();
buttonwidth = (monitor_geometry.width() - 350) / sup_vect.size();
} else if (sup_vect.size() > 6) {
padding1 = 8;
padding2 = 5;
buttonwidth = (xtt_monitor_geometry.width() - 350) / sup_vect.size()
buttonwidth = (monitor_geometry.width() - 350) / sup_vect.size()
- 2 * padding2;
} else {
padding1 = 8;
......@@ -476,8 +475,8 @@ OpQt::OpQt(void* op_parent_ctx, char* opplace, pwr_tStatus* status)
toplevel->activate_aalarm_decr();
}
toplevel->resize(xtt_monitor_geometry.width(), OP_HEIGHT_MIN + OP_HEIGHT_STATUSBAR);
toplevel->move(0, 0);
toplevel->resize(monitor_geometry.width(), OP_HEIGHT_MIN + OP_HEIGHT_STATUSBAR);
toplevel->move(monitor_geometry.x(), 0);
wow = new CoWowQt(toplevel);
sup_timerid = wow->timer_new();
......@@ -819,6 +818,16 @@ int OpQt::configure(char* opplace_str)
start_jop = 1;
}
int numberOfMonitors = QApplication::desktop()->screenCount();
int monitor = opplace_p->Monitor;
if (monitor > numberOfMonitors || monitor < 0) monitor = 0;
if (monitor == 0) monitor = QApplication::desktop()->primaryScreen();
else monitor = opplace_p->Monitor - 1;
monitor_geometry = QApplication::desktop()->screenGeometry(monitor);
// Examine Graph objects
for (i = 0;
i < sizeof(opplace_p->FastAvail) / sizeof(opplace_p->FastAvail[0]);
......
......@@ -100,6 +100,7 @@ public:
char a_alarm_moretext[5][256];
char b_alarm_moretext[256];
int text_size;
QRect monitor_geometry;
CoWowFocusTimerQt poptimer;
std::vector<OpCmd> cmd_vect;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment