Skip to content
Snippets Groups Projects
Commit c12e9336 authored by Daniel Teske's avatar Daniel Teske
Browse files

Android: Tweak device list view


Make the incompatible device node expand by default and disable
hopefully all ways a use can collpase. Also remove the arrow from the
title entriues, since it can't be collapsed anymore.

Change-Id: I012c3d9663ac496083f8c16d24eed4cd660d8cd0
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent 7f8edfb4
No related branches found
No related tags found
No related merge requests found
......@@ -141,12 +141,7 @@ public:
textColor = palette.text().color();
painter->setPen(textColor);
if (!node->displayName().isEmpty()) {
QIcon icon(QLatin1String(":/core/images/darkarrowdown.png"));
int size = opt.rect.bottom() - opt.rect.top();
QPixmap pixmap = icon.pixmap(size, size);
painter->drawPixmap((size - pixmap.width()) / 2, opt.rect.top() + (size - pixmap.height()) / 2, pixmap);
if (!node->displayName().isEmpty()) { // Title
// We have a top level node
QFont font = opt.font;
font.setPointSizeF(font.pointSizeF() * 1.2);
......@@ -155,7 +150,7 @@ public:
QFontMetrics fm(font);
painter->setFont(font);
int top = (opt.rect.bottom() + opt.rect.top() - fm.height()) / 2 + fm.ascent();
painter->drawText(size, top, node->displayName());
painter->drawText(6, top, node->displayName());
} else {
QIcon icon(device.type == AndroidDeviceInfo::Hardware ? QLatin1String(":/projectexplorer/images/MaemoDevice.png")
: QLatin1String(":/projectexplorer/images/Simulator.png"));
......@@ -384,6 +379,7 @@ AndroidDeviceDialog::AndroidDeviceDialog(int apiLevel, const QString &abi, QWidg
m_ui->deviceView->setHeaderHidden(true);
m_ui->deviceView->setRootIsDecorated(false);
m_ui->deviceView->setUniformRowHeights(true);
m_ui->deviceView->setExpandsOnDoubleClick(false);
m_ui->defaultDeviceCheckBox->setText(tr("Always use this device for architecture %1").arg(abi));
......@@ -434,6 +430,8 @@ void AndroidDeviceDialog::refreshDeviceList()
m_model->setDevices(devices);
m_ui->deviceView->expand(m_model->index(0, 0));
if (m_model->rowCount() > 1) // we have a incompatible device node
m_ui->deviceView->expand(m_model->index(1, 0));
// Smartly select a index
QModelIndex newIndex;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment