standardpanel.cpp 17.9 KB
Newer Older
1 2 3
/*****************************************************************************
 * standardpanel.cpp : The "standard" playlist panel : just a treeview
 ****************************************************************************
4
 * Copyright (C) 2000-2009 VideoLAN
5
 * $Id$
6 7
 *
 * Authors: Clément Stenac <zorglub@videolan.org>
8
 *          JB Kempf <jb@videolan.org>
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 *****************************************************************************/
24

25 26 27
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
28

29
#include "dialogs_provider.hpp"
30

31
#include "components/playlist/playlist_model.hpp"
32
#include "components/playlist/standardpanel.hpp"
33
#include "components/playlist/icon_view.hpp"
Clément Stenac's avatar
Clément Stenac committed
34
#include "util/customwidgets.hpp"
35
#include "menus.hpp"
Clément Stenac's avatar
Clément Stenac committed
36

37 38
#include <vlc_intf_strings.h>

Clément Stenac's avatar
Clément Stenac committed
39
#include <QPushButton>
40
#include <QHeaderView>
Clément Stenac's avatar
Clément Stenac committed
41 42
#include <QKeyEvent>
#include <QModelIndexList>
Clément Stenac's avatar
Clément Stenac committed
43
#include <QLabel>
44
#include <QMenu>
45
#include <QSignalMapper>
46
#include <QWheelEvent>
47 48
#include <QToolButton>
#include <QFontMetrics>
49
#include <QPainter>
50

Clément Stenac's avatar
Clément Stenac committed
51
#include <assert.h>
Clément Stenac's avatar
Clément Stenac committed
52

Rafaël Carré's avatar
Rafaël Carré committed
53 54
#include "sorting.h"

Jakob Leben's avatar
Jakob Leben committed
55 56 57 58
static const QString viewNames[] = { qtr( "Detailed View" ),
                                     qtr( "Icon View" ),
                                     qtr( "List View" ) };

59
StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
60
                                  intf_thread_t *_p_intf,
Clément Stenac's avatar
Clément Stenac committed
61
                                  playlist_t *p_playlist,
Clément Stenac's avatar
Clément Stenac committed
62
                                  playlist_item_t *p_root ):
63
                                  QWidget( _parent ), p_intf( _p_intf )
64
{
65
    layout = new QGridLayout( this );
66
    layout->setSpacing( 0 ); layout->setMargin( 0 );
67
    setMinimumWidth( 300 );
68

69
    iconView = NULL;
70
    treeView = NULL;
Jakob Leben's avatar
Jakob Leben committed
71
    listView = NULL;
72

73
    model = new PLModel( p_playlist, p_intf, p_root, this );
74
    currentRootId = -1;
75 76
    currentRootIndexId = -1;
    lastActivatedId = -1;
Clément Stenac's avatar
Clément Stenac committed
77

78
    locationBar = new LocationBar( model );
79 80 81 82 83
    locationBar->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Preferred );
    layout->addWidget( locationBar, 0, 1 );
    layout->setColumnStretch( 1, 100 );
    CONNECT( locationBar, invoked( const QModelIndex & ),
             this, browseInto( const QModelIndex & ) );
84

85
    layout->setColumnStretch( 2, 1 );
86

87 88 89 90 91
    searchEdit = new SearchLineEdit( this );
    searchEdit->setMaximumWidth( 250 );
    searchEdit->setMinimumWidth( 80 );
    layout->addWidget( searchEdit, 0, 3 );
    CONNECT( searchEdit, textChanged( const QString& ),
92
             this, search( const QString& ) );
93
    layout->setColumnStretch( 3, 50 );
94

95
    /* Add item to the playlist button */
96
    addButton = new QToolButton;
97
    addButton->setIcon( QIcon( ":/buttons/playlist/playlist_add" ) );
98
    addButton->setMaximumWidth( 30 );
99
    BUTTONACT( addButton, popupAdd() );
100
    layout->addWidget( addButton, 0, 0 );
101

102
    /* Button to switch views */
103
    QToolButton *viewButton = new QToolButton( this );
104
    viewButton->setIcon( style()->standardIcon( QStyle::SP_FileDialogDetailedView ) );
105
    layout->addWidget( viewButton, 0, 4 );
106 107

    /* View selection menu */
108
    viewSelectionMapper = new QSignalMapper( this );
109 110 111 112
    CONNECT( viewSelectionMapper, mapped( int ), this, showView( int ) );

    QActionGroup *actionGroup = new QActionGroup( this );

Jakob Leben's avatar
Jakob Leben committed
113 114 115 116 117 118 119
    for( int i = 0; i < VIEW_COUNT; i++ )
    {
        viewActions[i] = actionGroup->addAction( viewNames[i] );
        viewActions[i]->setCheckable( true );
        viewSelectionMapper->setMapping( viewActions[i], i );
        CONNECT( viewActions[i], triggered(), viewSelectionMapper, map() );
    }
120

121
    BUTTONACT( viewButton, cycleViews() );
122 123 124 125
    QMenu *viewMenu = new QMenu( this );
    viewMenu->addActions( actionGroup->actions() );

    viewButton->setMenu( viewMenu );
126 127 128 129 130

    /* Saved Settings */
    getSettings()->beginGroup("Playlist");

    int i_viewMode = getSettings()->value( "view-mode", TREE_VIEW ).toInt();
131
    showView( i_viewMode );
132 133

    getSettings()->endGroup();
134

135 136
    CONNECT( THEMIM, leafBecameParent( input_item_t *),
             this, browseInto( input_item_t * ) );
137 138 139

    CONNECT( model, currentChanged( const QModelIndex& ),
             this, handleExpansion( const QModelIndex& ) );
140
    CONNECT( model, rootChanged(), this, handleRootChange() );
141 142
}

143 144 145
StandardPLPanel::~StandardPLPanel()
{
    getSettings()->beginGroup("Playlist");
146 147
    if( treeView )
        getSettings()->setValue( "headerStateV2", treeView->header()->saveState() );
Jakob Leben's avatar
Jakob Leben committed
148 149 150 151 152 153
    if( currentView == treeView )
        getSettings()->setValue( "view-mode", TREE_VIEW );
    else if( currentView == listView )
        getSettings()->setValue( "view-mode", LIST_VIEW );
    else if( currentView == iconView )
        getSettings()->setValue( "view-mode", ICON_VIEW );
154 155 156
    getSettings()->endGroup();
}

157
/* Unused anymore, but might be useful, like in right-click menu */
158 159
void StandardPLPanel::gotoPlayingItem()
{
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
160
    currentView->scrollTo( model->currentIndex() );
161 162
}

163
void StandardPLPanel::handleExpansion( const QModelIndex& index )
Clément Stenac's avatar
Qt4:  
Clément Stenac committed
164
{
Ilkka Ollakka's avatar
Ilkka Ollakka committed
165
    assert( currentView );
166
    currentView->scrollTo( index );
Clément Stenac's avatar
Qt4:  
Clément Stenac committed
167 168
}

169 170 171 172 173 174
void StandardPLPanel::handleRootChange()
{
    /* needed for popupAdd() */
    PLItem *root = model->getItem( QModelIndex() );
    currentRootId = root->id();

175
    browseInto();
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192

    /* enable/disable adding */
    if( currentRootId == THEPL->p_playing->i_id )
    {
        addButton->setEnabled( true );
        addButton->setToolTip( qtr(I_PL_ADDPL) );
    }
    else if( THEPL->p_media_library &&
             currentRootId == THEPL->p_media_library->i_id )
    {
        addButton->setEnabled( true );
        addButton->setToolTip( qtr(I_PL_ADDML) );
    }
    else
        addButton->setEnabled( false );
}

193
/* PopupAdd Menu for the Add Menu */
194
void StandardPLPanel::popupAdd()
195
{
196
    QMenu popup;
197
    if( currentRootId == THEPL->p_playing->i_id )
198
    {
199
        popup.addAction( qtr(I_PL_ADDF), THEDP, SLOT( simplePLAppendDialog()) );
200
        popup.addAction( qtr(I_PL_ADDDIR), THEDP, SLOT( PLAppendDir()) );
201
        popup.addAction( qtr(I_OP_ADVOP), THEDP, SLOT( PLAppendDialog()) );
202
    }
203 204
    else if( THEPL->p_media_library &&
                currentRootId == THEPL->p_media_library->i_id )
205
    {
206
        popup.addAction( qtr(I_PL_ADDF), THEDP, SLOT( simpleMLAppendDialog()) );
207
        popup.addAction( qtr(I_PL_ADDDIR), THEDP, SLOT( MLAppendDir() ) );
208
        popup.addAction( qtr(I_OP_ADVOP), THEDP, SLOT( MLAppendDialog() ) );
209
    }
210

211 212
    popup.exec( QCursor::pos() - addButton->mapFromGlobal( QCursor::pos() )
                        + QPoint( 0, addButton->height() ) );
213 214
}

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
215 216 217 218
void StandardPLPanel::popupPlView( const QPoint &point )
{
    QModelIndex index = currentView->indexAt( point );
    QPoint globalPoint = currentView->viewport()->mapToGlobal( point );
219 220 221 222 223 224 225 226 227
    if( !index.isValid() ){
        QVLCMenu::PopupMenu( p_intf, true );
    }
    else
    {
        QItemSelectionModel *selection = currentView->selectionModel();
        QModelIndexList list = selection->selectedIndexes();
        model->popup( index, globalPoint, list );
    }
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
228 229
}

230
void StandardPLPanel::popupSelectColumn( QPoint pos )
231
{
232
    QMenu menu;
233
    assert( treeView );
234

235 236
    /* We do not offer the option to hide index 0 column, or
    * QTreeView will behave weird */
237
    int i, j;
238
    for( i = 1 << 1, j = 1; i < COLUMN_END; i <<= 1, j++ )
239
    {
240 241 242
        QAction* option = menu.addAction(
            qfu( psz_column_title( i ) ) );
        option->setCheckable( true );
243
        option->setChecked( !treeView->isColumnHidden( j ) );
244 245
        selectColumnsSigMapper->setMapping( option, j );
        CONNECT( option, triggered(), selectColumnsSigMapper, map() );
246
    }
247
    menu.exec( QCursor::pos() );
248 249
}

250
void StandardPLPanel::toggleColumnShown( int i )
251
{
252
    treeView->setColumnHidden( i, !treeView->isColumnHidden( i ) );
253
}
254

255
/* Search in the playlist */
256
void StandardPLPanel::search( const QString& searchText )
Clément Stenac's avatar
Clément Stenac committed
257
{
258 259 260 261
    bool flat = currentView == iconView || currentView == listView;
    model->search( searchText,
                   flat ? currentView->rootIndex() : QModelIndex(),
                   !flat );
Clément Stenac's avatar
Clément Stenac committed
262 263
}

264 265
/* Set the root of the new Playlist */
/* This activated by the selector selection */
266 267
void StandardPLPanel::setRoot( playlist_item_t *p_item )
{
Clément Stenac's avatar
Clément Stenac committed
268
    model->rebuild( p_item );
269 270
}

271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290
void StandardPLPanel::browseInto( const QModelIndex &index )
{
    if( currentView == iconView || currentView == listView )
    {
        currentRootIndexId = model->itemId( index );;
        currentView->setRootIndex( index );
    }

    locationBar->setIndex( index );
    model->search( QString(), index, false );
    searchEdit->clear();
}

void StandardPLPanel::browseInto( )
{
    browseInto( currentRootIndexId != -1 && currentView != treeView ?
                model->index( currentRootIndexId, 0 ) :
                QModelIndex() );
}

291
void StandardPLPanel::wheelEvent( QWheelEvent *e )
Clément Stenac's avatar
Clément Stenac committed
292
{
293 294 295 296 297 298 299
    // Accept this event in order to prevent unwanted volume up/down changes
    e->accept();
}

bool StandardPLPanel::eventFilter ( QObject * watched, QEvent * event )
{
    if (event->type() == QEvent::KeyPress)
Clément Stenac's avatar
Clément Stenac committed
300
    {
301 302 303 304 305 306 307
        QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
        if( keyEvent->key() == Qt::Key_Delete ||
            keyEvent->key() == Qt::Key_Back )
        {
            deleteSelection();
            return true;
        }
Clément Stenac's avatar
Clément Stenac committed
308
    }
309
    return false;
Clément Stenac's avatar
Clément Stenac committed
310 311 312 313
}

void StandardPLPanel::deleteSelection()
{
314
    QItemSelectionModel *selection = currentView->selectionModel();
Clément Stenac's avatar
Clément Stenac committed
315 316 317 318
    QModelIndexList list = selection->selectedIndexes();
    model->doDelete( list );
}

319 320 321 322 323 324
void StandardPLPanel::createIconView()
{
    iconView = new PlIconView( model, this );
    iconView->setContextMenuPolicy( Qt::CustomContextMenu );
    CONNECT( iconView, customContextMenuRequested( const QPoint & ),
             this, popupPlView( const QPoint & ) );
325 326
    CONNECT( iconView, activated( const QModelIndex & ),
             this, activate( const QModelIndex & ) );
327
    iconView->installEventFilter( this );
328 329 330
    layout->addWidget( iconView, 1, 0, 1, -1 );
}

Jakob Leben's avatar
Jakob Leben committed
331 332 333 334 335 336 337 338
void StandardPLPanel::createListView()
{
    listView = new PlListView( model, this );
    listView->setContextMenuPolicy( Qt::CustomContextMenu );
    CONNECT( listView, customContextMenuRequested( const QPoint & ),
             this, popupPlView( const QPoint & ) );
    CONNECT( listView, activated( const QModelIndex & ),
             this, activate( const QModelIndex & ) );
339
    listView->installEventFilter( this );
Jakob Leben's avatar
Jakob Leben committed
340 341 342 343
    layout->addWidget( listView, 1, 0, 1, -1 );
}


344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365
void StandardPLPanel::createTreeView()
{
    /* Create and configure the QTreeView */
    treeView = new QTreeView;

    treeView->setIconSize( QSize( 20, 20 ) );
    treeView->setAlternatingRowColors( true );
    treeView->setAnimated( true );
    treeView->setUniformRowHeights( true );
    treeView->setSortingEnabled( true );
    treeView->header()->setSortIndicator( -1 , Qt::AscendingOrder );
    treeView->header()->setSortIndicatorShown( true );
    treeView->header()->setClickable( true );
    treeView->header()->setContextMenuPolicy( Qt::CustomContextMenu );

    treeView->setSelectionBehavior( QAbstractItemView::SelectRows );
    treeView->setSelectionMode( QAbstractItemView::ExtendedSelection );
    treeView->setDragEnabled( true );
    treeView->setAcceptDrops( true );
    treeView->setDropIndicatorShown( true );
    treeView->setContextMenuPolicy( Qt::CustomContextMenu );

366 367 368
    /* setModel after setSortingEnabled(true), or the model will sort immediately! */
    treeView->setModel( model );

369 370 371 372 373 374 375 376 377
    if( getSettings()->contains( "headerStateV2" ) )
    {
        treeView->header()->restoreState(
                getSettings()->value( "headerStateV2" ).toByteArray() );
    }
    else
    {
        for( int m = 1, c = 0; m != COLUMN_END; m <<= 1, c++ )
        {
378
            treeView->setColumnHidden( c, !( m & COLUMN_DEFAULT ) );
379 380 381 382 383 384 385
            if( m == COLUMN_TITLE ) treeView->header()->resizeSection( c, 200 );
            else if( m == COLUMN_DURATION ) treeView->header()->resizeSection( c, 80 );
        }
    }

    /* Connections for the TreeView */
    CONNECT( treeView, activated( const QModelIndex& ),
386
             this, activate( const QModelIndex& ) );
387 388 389 390
    CONNECT( treeView->header(), customContextMenuRequested( const QPoint & ),
             this, popupSelectColumn( QPoint ) );
    CONNECT( treeView, customContextMenuRequested( const QPoint & ),
             this, popupPlView( const QPoint & ) );
391
    treeView->installEventFilter( this );
392 393 394 395 396 397 398 399 400 401

    /* SignalMapper for columns */
    selectColumnsSigMapper = new QSignalMapper( this );
    CONNECT( selectColumnsSigMapper, mapped( int ),
             this, toggleColumnShown( int ) );

    /* Finish the layout */
    layout->addWidget( treeView, 1, 0, 1, -1 );
}

402
void StandardPLPanel::showView( int i_view )
403
{
404 405 406 407 408 409 410
    switch( i_view )
    {
    case TREE_VIEW:
    {
        if( treeView == NULL )
            createTreeView();
        if( iconView ) iconView->hide();
Jakob Leben's avatar
Jakob Leben committed
411
        if( listView ) listView->hide();
412 413
        treeView->show();
        currentView = treeView;
Jakob Leben's avatar
Jakob Leben committed
414
        viewActions[i_view]->setChecked( true );
415 416 417
        break;
    }
    case ICON_VIEW:
418
    {
419
        if( iconView == NULL )
420 421
            createIconView();

422
        if( treeView ) treeView->hide();
423
        if( listView ) listView->hide();
424
        iconView->show();
425
        currentView = iconView;
Jakob Leben's avatar
Jakob Leben committed
426 427 428 429 430 431 432 433 434
        viewActions[i_view]->setChecked( true );
        break;
    }
    case LIST_VIEW:
    {
        if( listView == NULL )
            createListView();

        if( treeView ) treeView->hide();
435
        if( iconView ) iconView->hide();
Jakob Leben's avatar
Jakob Leben committed
436 437 438
        listView->show();
        currentView = listView;
        viewActions[i_view]->setChecked( true );
439
        break;
440
    }
441
    default: return;
442
    }
443 444

    browseInto();
445
}
446

447 448 449 450 451
void StandardPLPanel::cycleViews()
{
    if( currentView == iconView )
        showView( TREE_VIEW );
    else if( currentView == treeView )
Jakob Leben's avatar
Jakob Leben committed
452 453
        showView( LIST_VIEW );
    else if( currentView == listView )
454 455 456 457 458
        showView( ICON_VIEW );
    else
        assert( 0 );
}

459 460
void StandardPLPanel::activate( const QModelIndex &index )
{
461
    if( model->hasChildren( index ) )
462
    {
463 464
        if( currentView != treeView )
            browseInto( index );
465 466 467
    }
    else
    {
468 469 470
        playlist_Lock( THEPL );
        playlist_item_t *p_item = playlist_ItemGetById( THEPL, model->itemId( index ) );
        p_item->i_flags |= PLAYLIST_SUBITEM_STOP_FLAG;
471
        lastActivatedId = p_item->p_input->i_id;
472
        playlist_Unlock( THEPL );
473 474 475
        model->activateItem( index );
    }
}
476

477
void StandardPLPanel::browseInto( input_item_t *p_input )
478
{
Jakob Leben's avatar
Jakob Leben committed
479

480
    if( p_input->i_id != lastActivatedId ) return;
481 482 483

    playlist_Lock( THEPL );

484
    playlist_item_t *p_item = playlist_ItemGetByInput( THEPL, p_input );
485 486 487 488 489
    if( !p_item )
    {
        playlist_Unlock( THEPL );
        return;
    }
490

491
    QModelIndex index = model->index( p_item->i_id, 0 );
492 493 494

    playlist_Unlock( THEPL );

495
    if( currentView == treeView )
496
        treeView->setExpanded( index, true );
497 498
    else
        browseInto( index );
499

500
    lastActivatedId = -1;
501

502

503
}
504 505 506

LocationBar::LocationBar( PLModel *m )
{
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
507 508 509
    model = m;
    mapper = new QSignalMapper( this );
    CONNECT( mapper, mapped( int ), this, invoke( int ) );
510 511 512

    box = new QHBoxLayout;
    box->setSpacing( 0 );
Jakob Leben's avatar
Jakob Leben committed
513
    box->setContentsMargins( 0, 0, 0, 0 );
514
    setLayout( box );
515 516 517 518
}

void LocationBar::setIndex( const QModelIndex &index )
{
519 520
    qDeleteAll( buttons );
    buttons.clear();
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
521
    QModelIndex i = index;
522
    bool bold = true;
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
523 524 525 526 527 528 529
    while( true )
    {
        PLItem *item = model->getItem( i );

        char *fb_name = input_item_GetTitleFbName( item->inputItem() );
        QString text = qfu(fb_name);
        free(fb_name);
530
        QAbstractButton *btn = new LocationButton( text, bold, i.isValid() );
531
        btn->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Fixed );
532
        box->insertWidget( 0, btn, bold ? 1 : 0 );
533
        buttons.append( btn );
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
534 535 536 537

        mapper->setMapping( btn, item->id() );
        CONNECT( btn, clicked( ), mapper, map( ) );

538
        bold = false;
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
539 540 541 542

        if( i.isValid() ) i = i.parent();
        else break;
    }
543 544
}

545 546 547 548 549
void LocationBar::setRootIndex()
{
    setIndex( QModelIndex() );
}

550 551
void LocationBar::invoke( int i_id )
{
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
552 553
    QModelIndex index = model->index( i_id, 0 );
    emit invoked ( index );
554
}
555

556 557
LocationButton::LocationButton( const QString &text, bool bold, bool arrow )
  : b_arrow( arrow )
558 559 560 561
{
    QFont font;
    font.setBold( bold );
    setFont( font );
562
    setText( text );
563 564
}

Jakob Leben's avatar
Jakob Leben committed
565 566
#define PADDING 4

567 568 569 570 571 572
void LocationButton::paintEvent ( QPaintEvent * event )
{
    QStyleOptionButton option;
    option.initFrom( this );
    option.state |= QStyle::State_Enabled;
    QPainter p( this );
Jakob Leben's avatar
Jakob Leben committed
573

574 575
    if( underMouse() )
        style()->drawControl( QStyle::CE_PushButtonBevel, &option, &p );
Jakob Leben's avatar
Jakob Leben committed
576 577 578 579 580 581 582

    int margin = style()->pixelMetric(QStyle::PM_DefaultFrameWidth,0,this) + PADDING;

    QRect rect = option.rect.adjusted( b_arrow ? 15 + margin : margin, 0, margin * -1, 0 );
    p.drawText( rect, Qt::AlignVCenter,
                fontMetrics().elidedText( text(), Qt::ElideRight, rect.width() ) );

583 584
    if( b_arrow )
    {
Jakob Leben's avatar
Jakob Leben committed
585 586
        option.rect.setX( margin );
        option.rect.setWidth( 8 );
587 588
        style()->drawPrimitive( QStyle::PE_IndicatorArrowRight, &option, &p );
    }
589 590 591 592
}

QSize LocationButton::sizeHint() const
{
Jakob Leben's avatar
Jakob Leben committed
593
    int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth,0,this);
594
    QSize s( fontMetrics().boundingRect( text() ).size() );
Jakob Leben's avatar
Jakob Leben committed
595 596
    s.setWidth( s.width() + ( 2 * frameWidth ) + ( 2 * PADDING ) + ( b_arrow ? 15 : 0 ) );
    s.setHeight( QPushButton::sizeHint().height() );
597 598
    return s;
}
Jakob Leben's avatar
Jakob Leben committed
599 600

#undef PADDING