Qt: Start adjusting icon sizes dynamically.

In the main toolbar get our initial icon size using the PM_SmallIconSize
pixel metric. On Windows this varies directly with the system text
magnification setting.

Pinging bug 11675 since we still need to adjust the icon sizes in the
filter edits, progress frame, status bar, and likely other places.

Ping-Bug: 11675
Change-Id: I53a78627ce850bd6dbd4628da481badee63a1208
Reviewed-on: https://code.wireshark.org/review/11605
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
This commit is contained in:
Gerald Combs 2015-11-06 09:32:39 -08:00
parent 1e87ff4727
commit 47172e7d51
1 changed files with 7 additions and 5 deletions

View File

@ -1620,13 +1620,15 @@ void MainWindow::captureStop() {
void MainWindow::initMainToolbarIcons()
{
#if defined(Q_OS_WIN)
// Current GTK+ and other Windows app behavior.
main_ui_->mainToolBar->setIconSize(QSize(16, 16));
#else
// Normally 16 px. Reflects current GTK+ behavior and other Windows apps.
int icon_size = style()->pixelMetric(QStyle::PM_SmallIconSize);
#if !defined(Q_OS_WIN)
// Force icons to 24x24 for now, otherwise actionFileOpen looks wonky.
main_ui_->mainToolBar->setIconSize(QSize(24, 24));
// The OS X HIG specifies 32-pixel icons but they're a little too
// large IMHO.
icon_size = icon_size * 3 / 2;
#endif
main_ui_->mainToolBar->setIconSize(QSize(icon_size, icon_size));
// Toolbar actions. The GNOME HIG says that we should have a menu icon for each
// toolbar item but that clutters up our menu. Set menu icons sparingly.