Пример #1
0
void
BrowserBar::polish()
{
    DEBUG_FUNC_INFO

    QWidget::polish();

    uint M = 0;
    foreachType( BrowserList, m_browsers ) {
        const uint m = (*it)->minimumWidth();
        if( m > M ) M = m;
    }

    KConfig* const config = amaroK::config( "BrowserBar" );
    const int index = indexForName( config->readEntry( "CurrentPane" ) );
    const int width = config->readNumEntry( "Width", browser( index )->sizeHint().width() );

    if( M > 250 ) {
        warning() << "Some browsers are insisting on a silly minimum size! " << M << endl;
        M = 250;
    }

    m_browserBox->setMinimumWidth( M );
    m_browserBox->resize( width, height() );

    if( index != -1 )
        // if we did it for -1 it ruins the browserBox size
        showHideBrowser( index );
}
Пример #2
0
int
BrowserBar::restoreWidth()
{
    const int index = indexForName( Amarok::config( "BrowserBar" )->readEntry( "CurrentPane" ) );
    const int width = Amarok::config( "BrowserBar" )->readNumEntry( "Width", browser( index )->sizeHint().width() );

    m_browserBox->resize( width, height() );
    m_pos = m_browserBox->width() + m_tabBar->width();

    return index;
}