summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2013-11-22 15:07:45 (GMT)
committerKevin Smith <git@kismith.co.uk>2013-11-22 15:07:45 (GMT)
commit58da4ae2358b90a9a178ecebf7f33b7e9e0636ee (patch)
treef90057689b14e8bc74efaa14eb9316ec785076ac
parent66137537276e401adc9f49bcb2910790c85180e9 (diff)
downloadswift-58da4ae2358b90a9a178ecebf7f33b7e9e0636ee.zip
swift-58da4ae2358b90a9a178ecebf7f33b7e9e0636ee.tar.bz2
Use a combobox instead of tabs for mainwindow selection.
I'm told that currently Qt isn't correctly showing which tab is selected over MSAA. By providing a different widget it should make screen readers happier. Change-Id: I1f14967fa2f314418417ac5891e9c79f60ac59ef
-rw-r--r--Swift/QtUI/QtMainWindow.cpp14
-rw-r--r--Swift/QtUI/QtMainWindow.h1
2 files changed, 15 insertions, 0 deletions
diff --git a/Swift/QtUI/QtMainWindow.cpp b/Swift/QtUI/QtMainWindow.cpp
index af38d68..879a54b 100644
--- a/Swift/QtUI/QtMainWindow.cpp
+++ b/Swift/QtUI/QtMainWindow.cpp
@@ -93,6 +93,20 @@ QtMainWindow::QtMainWindow(SettingsProvider* settings, UIEventStream* uiEventStr
connect(tabs_, SIGNAL(currentChanged(int)), this, SLOT(handleTabChanged(int)));
+ tabBarCombo_ = NULL;
+ if (settings_->getSetting(QtUISettingConstants::USE_SCREENREADER)) {
+ tabs_->tabBar()->hide();
+ tabBarCombo_ = new QComboBox(this);
+ tabBarCombo_->setAccessibleName("Current View");
+ tabBarCombo_->addItem(tr("Contacts"));
+ tabBarCombo_->addItem(tr("Chats"));
+ tabBarCombo_->addItem(tr("Notices"));
+ tabBarCombo_->setCurrentIndex(tabs_->currentIndex());
+ mainLayout->addWidget(tabBarCombo_);
+ connect(tabBarCombo_, SIGNAL(currentIndexChanged(int)), tabs_, SLOT(setCurrentIndex(int)));
+ }
+
+
this->setLayout(mainLayout);
QMenu* viewMenu = new QMenu(tr("&View"), this);
diff --git a/Swift/QtUI/QtMainWindow.h b/Swift/QtUI/QtMainWindow.h
index 627cc17..c489a9e 100644
--- a/Swift/QtUI/QtMainWindow.h
+++ b/Swift/QtUI/QtMainWindow.h
@@ -93,6 +93,7 @@ namespace Swift {
QAction* toggleRequestDeliveryReceipts_;
QMenu* serverAdHocMenu_;
QtTabWidget* tabs_;
+ QComboBox* tabBarCombo_;
QWidget* contactsTabWidget_;
QWidget* eventsTabWidget_;
QtEventWindow* eventWindow_;