Ignore:
Timestamp:
Jun 28, 2015, 2:18:06 PM (6 years ago)
Author:
mikedld
Message:

Some look-and-feel improvements for Mac and GTK+ styles (Qt client)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/qt/IconToolButton.cc

    r14537 r14547  
    88 */
    99
     10#include <QStyle>
    1011#include <QStyleOption>
    1112#include <QStyleOptionToolButton>
     
    1920}
    2021
     22QSize
     23IconToolButton::sizeHint () const
     24{
     25  QStyleOptionToolButton option;
     26  initStyleOption (&option);
     27  option.features = QStyleOptionToolButton::None;
     28  option.toolButtonStyle = Qt::ToolButtonIconOnly;
     29  const QSize size = style ()->sizeFromContents (QStyle::CT_ToolButton, &option, iconSize (), this);
     30
     31  return size.expandedTo (iconSize () + QSize (8, 8));
     32}
     33
    2134void IconToolButton::paintEvent (QPaintEvent * /*event*/)
    2235{
     
    2437  QStyleOptionToolButton option;
    2538  initStyleOption (&option);
    26   option.features &= ~QStyleOptionToolButton::HasMenu;
     39  option.features = QStyleOptionToolButton::None;
     40  option.toolButtonStyle = Qt::ToolButtonIconOnly;
    2741  painter.drawComplexControl(QStyle::CC_ToolButton, option);
    2842}
Note: See TracChangeset for help on using the changeset viewer.