source: trunk/qt/tricontoolbutton.cc @ 14389

Last change on this file since 14389 was 14389, checked in by mikedld, 8 years ago

Move status bar creation to mainwin.ui

Among other things,

  • fix turtle icons size (20x14 -> 16x16)
  • use QIcon states instead of changing the turtle icon ourselves each time (unchecked - off, checked - on)
  • make speed limit action in tray menu checkable
  • simplify status bar buttons drawing and use QToolButton instead of QPushButton
  • Property svn:keywords set to Date Rev Author Id
File size: 662 bytes
Line 
1/*
2 * This file Copyright (C) 2009-2014 Mnemosyne LLC
3 *
4 * It may be used under the GNU Public License v2 or v3 licenses,
5 * or any future license endorsed by Mnemosyne LLC.
6 *
7 * $Id: tricontoolbutton.cc 14389 2014-12-18 01:30:50Z mikedld $
8 */
9
10#include <QStyleOption>
11#include <QStyleOptionToolButton>
12#include <QStylePainter>
13
14#include "tricontoolbutton.h"
15
16TrIconToolButton::TrIconToolButton (QWidget * parent):
17  QToolButton (parent)
18{
19}
20
21void TrIconToolButton::paintEvent (QPaintEvent * /*event*/)
22{
23  QStylePainter painter(this);
24  QStyleOptionToolButton option;
25  initStyleOption (&option);
26  option.features &= ~QStyleOptionToolButton::HasMenu;
27  painter.drawComplexControl(QStyle::CC_ToolButton, option);
28}
Note: See TracBrowser for help on using the repository browser.