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

rt_xtt_qt: show all available application buttons as default

parent 71cc522b
......@@ -135,7 +135,7 @@ void ClickableFrame::mousePressEvent(QMouseEvent* event) {
}
OpQt::OpQt(void* op_parent_ctx, char* opplace, pwr_tStatus* status)
: Op(op_parent_ctx, opplace, status), title_label(0), a_height(2),
: Op(op_parent_ctx, opplace, status), title_label(0), a_height(5),
text_size(12)
{
pwr_tStatus sts;
......@@ -461,21 +461,13 @@ OpQt::OpQt(void* op_parent_ctx, char* opplace, pwr_tStatus* status)
aalarm_box[3]->setVisible(false);
aalarm_box[4]->setVisible(false);
balarm_box->setVisible(false);
decr_button->setVisible(false);
//decr_button->setVisible(false);
if (layout_mask & pwr_mOpWindLayoutMask_HideCloseButton) {
tools_close->setVisible(false);
functions_close->setVisible(false);
}
if (a_height == 5) {
toplevel->activate_aalarm_decr();
}
if (a_height == 4) {
toplevel->activate_aalarm_decr();
toplevel->activate_aalarm_decr();
}
toplevel->resize(monitor_geometry.width(), OP_HEIGHT_MIN + OP_HEIGHT_STATUSBAR);
toplevel->resize(monitor_geometry.width(), OP_HEIGHT_MIN + OP_HEIGHT_STATUSBAR + (a_height - 3) * OP_HEIGHT_INC);
toplevel->move(monitor_geometry.x(), 0);
wow = new CoWowQt(toplevel);
......@@ -903,6 +895,7 @@ int OpQt::configure(char* opplace_str)
}
// Create the application buttons
int showRow[5] = {1, 1, 1, 0, 0};
for (i = 0;
i < sizeof(opplace_p->FastAvail) / sizeof(opplace_p->FastAvail[0]);
i++) {
......@@ -920,21 +913,29 @@ int OpQt::configure(char* opplace_str)
for (i = 0;
i < sizeof(opplace_p->FastAvail) / sizeof(opplace_p->FastAvail[0]);
i++) {
if ((i == 0) || ((i + 1) % 5 == 0)) {
funcbox[(i + 1) / 5] = layout_to_widget(new QHBoxLayout());
appl_form->addWidget(funcbox[(i + 1) / 5]);
if (i % 5 == 0) {
funcbox[i / 5] = layout_to_widget(new QHBoxLayout());
appl_form->addWidget(funcbox[i / 5]);
}
if (cdh_ObjidIsNotNull(button_aref[i].Objid)) {
int i2 = (int)(i / 5);
add_expanding(funcbox[i2]->layout(), appl_buttons[i]);
if (i >= 15) {
a_height = i2 + 1;
}
showRow[i / 5] = 1;
add_expanding(funcbox[i / 5]->layout(), appl_buttons[i]);
}
}
appl_form->addStretch(1);
// Start checking at the last row
for (int row = (sizeof(showRow) / sizeof(showRow[0])) - 1; row >= 0; row--)
{
if (showRow[row])
{
for (int height = a_height - 1; height > row; height--)
toplevel->activate_aalarm_decr();
break;
}
}
return XNAV__SUCCESS;
}
......@@ -991,13 +992,18 @@ void OpQtWidget::activate_aalarm_incr()
+ ((op->layout_mask & pwr_mOpWindLayoutMask_HideStatusBar) ? 0 : 1)
* OP_HEIGHT_STATUSBAR;
if (op->a_height == 3) {
if (op->a_height >= 3) {
op->decr_button->setVisible(true);
} else if (op->a_height == 4) {
}
if (op->a_height >= 4) {
op->funcbox[3]->setVisible(true);
} else if (op->a_height == 5) {
}
if (op->a_height >= 5) {
op->funcbox[4]->setVisible(true);
}
for (int i = 2; i < 5; i++) {
if (i < op->a_height) {
if (op->a_exist[i]) {
......@@ -1010,6 +1016,8 @@ void OpQtWidget::activate_aalarm_incr()
}
}
}
resize(width, height);
}
......@@ -1027,13 +1035,22 @@ void OpQtWidget::activate_aalarm_decr()
+ ((op->layout_mask & pwr_mOpWindLayoutMask_HideStatusBar) ? 0 : 1)
* OP_HEIGHT_STATUSBAR;
if (op->a_height == 2) {
if (op->a_height <= 2) {
op->decr_button->setVisible(false);
} else if (op->a_height == 3) {
}
else
{
op->decr_button->setVisible(true);
}
if (op->a_height <= 3) {
op->funcbox[3]->setVisible(false);
} else if (op->a_height == 4) {
}
if (op->a_height <= 4) {
op->funcbox[4]->setVisible(false);
}
for (int i = 2; i < 5; i++) {
if (i >= op->a_height) {
if (op->a_exist[i]) {
......
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