summaryrefslogtreecommitdiff
path: root/ui/qt/main_welcome.cpp
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2012-07-30 21:36:23 +0000
committerGerald Combs <gerald@wireshark.org>2012-07-30 21:36:23 +0000
commit1475a7a7040c430be0b52f5c554b802c679b2147 (patch)
tree0e285ef67e1e0fe1bbd80ee72354e7d5bbea8018 /ui/qt/main_welcome.cpp
parent3392211002c33ad83b02bb654e5aa0313893ac61 (diff)
downloadwireshark-1475a7a7040c430be0b52f5c554b802c679b2147.tar.gz
Rename "Files" to "Recent Files". Add space between each recent item.
Elide text instead of scrolling horizontally. Add a hover indication. svn path=/trunk/; revision=44143
Diffstat (limited to 'ui/qt/main_welcome.cpp')
-rw-r--r--ui/qt/main_welcome.cpp27
1 files changed, 22 insertions, 5 deletions
diff --git a/ui/qt/main_welcome.cpp b/ui/qt/main_welcome.cpp
index 4321a5dbd4..b06416be22 100644
--- a/ui/qt/main_welcome.cpp
+++ b/ui/qt/main_welcome.cpp
@@ -115,14 +115,30 @@ MainWelcome::MainWelcome(QWidget *parent) :
grid->addLayout(column, 1, 1, Qt::AlignTop);
grid->setColumnStretch(1, 70);
- heading = new QLabel(tr("<h1>Files</h1>"));
+ heading = new QLabel(tr("<h1>Recent Files</h1>"));
column->addWidget(heading);
m_recent_files.setStyleSheet(
"QListWidget {"
" border: 0;"
"}"
+ "QListWidget::item {"
+ " padding-top: 0.1em;"
+ " padding-bottom: 0.1em;"
+ "}"
+ "QListWidget::item::first {"
+ " padding-top: 0;"
+ "}"
+ "QListWidget::item::last {"
+ " padding-bottom: 0;"
+ "}"
+ "QListWidget::item::hover {"
+ " background-color: palette(highlight);"
+ " color: palette(highlighted-text);"
+ "}"
);
+ m_recent_files.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ m_recent_files.setTextElideMode(Qt::ElideLeft);
column->addWidget(&m_recent_files);
connect(wsApp, SIGNAL(updateRecentItemStatus(const QString &, qint64, bool)), this, SLOT(updateRecentFiles()));
connect(&m_recent_files, SIGNAL(itemActivated(QListWidgetItem *)), this, SLOT(openRecentItem(QListWidgetItem *)));
@@ -162,17 +178,18 @@ void MainWelcome::updateRecentFiles() {
itemLabel.append(" (");
if (ri->accessible) {
if (ri->size/1024/1024/1024 > 10) {
- itemLabel.append(QString("%1 GB)").arg(ri->size/1024/1024/1024));
+ itemLabel.append(QString("%1 GB").arg(ri->size/1024/1024/1024));
} else if (ri->size/1024/1024 > 10) {
- itemLabel.append(QString("%1 MB)").arg(ri->size/1024/1024));
+ itemLabel.append(QString("%1 MB").arg(ri->size/1024/1024));
} else if (ri->size/1024 > 10) {
- itemLabel.append(QString("%1 KB)").arg(ri->size/1024));
+ itemLabel.append(QString("%1 KB").arg(ri->size/1024));
} else {
itemLabel.append(QString("%1 Bytes").arg(ri->size));
}
} else {
- itemLabel.append(tr("not found)"));
+ itemLabel.append(tr("not found"));
}
+ itemLabel.append(")");
rfFont.setItalic(!ri->accessible);
rfItem = m_recent_files.item(rfRow);
rfItem->setText(itemLabel);