comparison ui/mainwindow.cpp @ 653:39f03316f675 trustbridge-refactor

Change button text when toggling details and select the first list item.
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 25 Jun 2014 14:56:19 +0200
parents f65503c1833b
children 129e611eaf50
comparison
equal deleted inserted replaced
652:f65503c1833b 653:39f03316f675
996 return; 996 return;
997 } 997 }
998 998
999 void MainWindow::toggleUpdatesNew() { 999 void MainWindow::toggleUpdatesNew() {
1000 if (!mUpdatesNew->isVisible()) { 1000 if (!mUpdatesNew->isVisible()) {
1001 mUpdatesDetailsNew->setText(tr("Hide Details"));
1001 mUpdatesNew->show(); 1002 mUpdatesNew->show();
1002 if (mUpdatesNewSize == 0) { 1003 mUpdatesNew->setSelected(0);
1003 mUpdatesNewSize = mUpdatesNew->height();
1004 }
1005 mUpdatesWidget->resize(old.width(), old.height() + mUpdatesNewSize);
1006 } 1004 }
1007 else { 1005 else {
1006 mUpdatesNew->hide();
1007 mUpdatesDetailsNew->setText(tr("Show Details"));
1008 QSize old = mUpdatesWidget->size();
1008 mUpdatesWidget->resize(old.width(), old.height() - mUpdatesNew->height()); 1009 mUpdatesWidget->resize(old.width(), old.height() - mUpdatesNew->height());
1009 mUpdatesNew->hide();
1010 } 1010 }
1011 } 1011 }
1012 1012
1013 void MainWindow::toggleUpdatesRemove() { 1013 void MainWindow::toggleUpdatesRemove() {
1014 QSize old = mUpdatesWidget->size();
1015 if (!mUpdatesRemove->isVisible()) { 1014 if (!mUpdatesRemove->isVisible()) {
1015 mUpdatesDetailsRemove->setText(tr("Hide Details"));
1016 mUpdatesRemove->show(); 1016 mUpdatesRemove->show();
1017 if (mUpdatesRemoveSize == 0) { 1017 mUpdatesRemove->setSelected(0);
1018 mUpdatesRemoveSize = mUpdatesRemove->height();
1019 }
1020 mUpdatesWidget->resize(old.width(), old.height() + mUpdatesRemoveSize);
1021 } 1018 }
1022 else { 1019 else {
1020 mUpdatesRemove->hide();
1021 mUpdatesDetailsRemove->setText(tr("Show Details"));
1022 QSize old = mUpdatesWidget->size();
1023 mUpdatesWidget->resize(old.width(), old.height() - mUpdatesRemove->height()); 1023 mUpdatesWidget->resize(old.width(), old.height() - mUpdatesRemove->height());
1024 mUpdatesRemove->hide();
1025 } 1024 }
1026 } 1025 }
1027 1026
1028 void MainWindow::toggleUpdatesManual() { 1027 void MainWindow::toggleUpdatesManual() {
1029 QSize old = mUpdatesWidget->size();
1030 if (!mUpdatesManual->isVisible()) { 1028 if (!mUpdatesManual->isVisible()) {
1029 mUpdatesDetailsManual->setText(tr("Hide Details"));
1031 mUpdatesManual->show(); 1030 mUpdatesManual->show();
1032 if (mUpdatesManualSize == 0) { 1031 mUpdatesManual->setSelected(0);
1033 mUpdatesManualSize = mUpdatesManual->height();
1034 }
1035 mUpdatesWidget->resize(old.width(), old.height() + mUpdatesManualSize);
1036 } 1032 }
1037 else { 1033 else {
1034 mUpdatesDetailsManual->setText(tr("Show Details"));
1035 mUpdatesManual->hide();
1036 QSize old = mUpdatesWidget->size();
1038 mUpdatesWidget->resize(old.width(), old.height() - mUpdatesManual->height()); 1037 mUpdatesWidget->resize(old.width(), old.height() - mUpdatesManual->height());
1039 mUpdatesManual->hide(); 1038 }
1040 } 1039 }
1041 }

http://wald.intevation.org/projects/trustbridge/