Commit 3189c753 authored by Marcus Nordenberg's avatar Marcus Nordenberg

rt_xtt_qt: show all available application buttons as default

parent 88ec2e2a
...@@ -145,7 +145,7 @@ void ClickableFrame::mousePressEvent(QMouseEvent* event) { ...@@ -145,7 +145,7 @@ void ClickableFrame::mousePressEvent(QMouseEvent* event) {
} }
OpQt::OpQt(void* op_parent_ctx, char* opplace, pwr_tStatus* status) 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) text_size(12)
{ {
pwr_tStatus sts; pwr_tStatus sts;
...@@ -464,21 +464,13 @@ OpQt::OpQt(void* op_parent_ctx, char* opplace, pwr_tStatus* status) ...@@ -464,21 +464,13 @@ OpQt::OpQt(void* op_parent_ctx, char* opplace, pwr_tStatus* status)
aalarm_box[3]->setVisible(false); aalarm_box[3]->setVisible(false);
aalarm_box[4]->setVisible(false); aalarm_box[4]->setVisible(false);
balarm_box->setVisible(false); balarm_box->setVisible(false);
decr_button->setVisible(false); //decr_button->setVisible(false);
if (layout_mask & pwr_mOpWindLayoutMask_HideCloseButton) { if (layout_mask & pwr_mOpWindLayoutMask_HideCloseButton) {
tools_close->setVisible(false); tools_close->setVisible(false);
functions_close->setVisible(false); functions_close->setVisible(false);
} }
if (a_height == 5) { toplevel->resize(monitor_geometry.width(), OP_HEIGHT_MIN + OP_HEIGHT_STATUSBAR + (a_height - 3) * OP_HEIGHT_INC);
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->move(monitor_geometry.x(), 0); toplevel->move(monitor_geometry.x(), 0);
wow = new CoWowQt(toplevel); wow = new CoWowQt(toplevel);
...@@ -894,6 +886,7 @@ int OpQt::configure(char* opplace_str) ...@@ -894,6 +886,7 @@ int OpQt::configure(char* opplace_str)
} }
// Create the application buttons // Create the application buttons
int showRow[5] = {1, 1, 1, 0, 0};
for (i = 0; for (i = 0;
i < sizeof(opplace_p->FastAvail) / sizeof(opplace_p->FastAvail[0]); i < sizeof(opplace_p->FastAvail) / sizeof(opplace_p->FastAvail[0]);
i++) { i++) {
...@@ -911,21 +904,29 @@ int OpQt::configure(char* opplace_str) ...@@ -911,21 +904,29 @@ int OpQt::configure(char* opplace_str)
for (i = 0; for (i = 0;
i < sizeof(opplace_p->FastAvail) / sizeof(opplace_p->FastAvail[0]); i < sizeof(opplace_p->FastAvail) / sizeof(opplace_p->FastAvail[0]);
i++) { i++) {
if ((i == 0) || ((i + 1) % 5 == 0)) { if (i % 5 == 0) {
funcbox[(i + 1) / 5] = layout_to_widget(new QHBoxLayout()); funcbox[i / 5] = layout_to_widget(new QHBoxLayout());
appl_form->addWidget(funcbox[(i + 1) / 5]); appl_form->addWidget(funcbox[i / 5]);
} }
if (cdh_ObjidIsNotNull(button_aref[i].Objid)) { if (cdh_ObjidIsNotNull(button_aref[i].Objid)) {
int i2 = (int)(i / 5); showRow[i / 5] = 1;
add_expanding(funcbox[i2]->layout(), appl_buttons[i]); add_expanding(funcbox[i / 5]->layout(), appl_buttons[i]);
if (i >= 15) {
a_height = i2 + 1;
}
} }
} }
appl_form->addStretch(1); 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; return XNAV__SUCCESS;
} }
...@@ -982,13 +983,18 @@ void OpQtWidget::activate_aalarm_incr() ...@@ -982,13 +983,18 @@ void OpQtWidget::activate_aalarm_incr()
+ ((op->layout_mask & pwr_mOpWindLayoutMask_HideStatusBar) ? 0 : 1) + ((op->layout_mask & pwr_mOpWindLayoutMask_HideStatusBar) ? 0 : 1)
* OP_HEIGHT_STATUSBAR; * OP_HEIGHT_STATUSBAR;
if (op->a_height == 3) { if (op->a_height >= 3) {
op->decr_button->setVisible(true); op->decr_button->setVisible(true);
} else if (op->a_height == 4) { }
if (op->a_height >= 4) {
op->funcbox[3]->setVisible(true); op->funcbox[3]->setVisible(true);
} else if (op->a_height == 5) { }
if (op->a_height >= 5) {
op->funcbox[4]->setVisible(true); op->funcbox[4]->setVisible(true);
} }
for (int i = 2; i < 5; i++) { for (int i = 2; i < 5; i++) {
if (i < op->a_height) { if (i < op->a_height) {
if (op->a_exist[i]) { if (op->a_exist[i]) {
...@@ -997,6 +1003,8 @@ void OpQtWidget::activate_aalarm_incr() ...@@ -997,6 +1003,8 @@ void OpQtWidget::activate_aalarm_incr()
} }
} }
} }
resize(width, height); resize(width, height);
} }
...@@ -1014,13 +1022,22 @@ void OpQtWidget::activate_aalarm_decr() ...@@ -1014,13 +1022,22 @@ void OpQtWidget::activate_aalarm_decr()
+ ((op->layout_mask & pwr_mOpWindLayoutMask_HideStatusBar) ? 0 : 1) + ((op->layout_mask & pwr_mOpWindLayoutMask_HideStatusBar) ? 0 : 1)
* OP_HEIGHT_STATUSBAR; * OP_HEIGHT_STATUSBAR;
if (op->a_height == 2) { if (op->a_height <= 2) {
op->decr_button->setVisible(false); 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); op->funcbox[3]->setVisible(false);
} else if (op->a_height == 4) { }
if (op->a_height <= 4) {
op->funcbox[4]->setVisible(false); op->funcbox[4]->setVisible(false);
} }
for (int i = 2; i < 5; i++) { for (int i = 2; i < 5; i++) {
if (i >= op->a_height) { if (i >= op->a_height) {
if (op->a_exist[i]) { 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