void AdmTabBar::sTickTock()
{
  if(NULL != m_time && m_time->elapsed() >= 250)
  {
    for(int i = 0; i < m_blinkTabs.count(); ++i)
    {
      if(m_blinkStatus)
        setTabTextColor(m_blinkTabs.at(i),palette().color(QPalette::Link));
      else
        setTabTextColor(m_blinkTabs.at(i),palette().color(QPalette::WindowText));
    }
    m_blinkStatus = !m_blinkStatus;
    m_time->restart();
  }
}
示例#2
0
文件: tabbar.cpp 项目: Arakmar/rekonq
void TabBar::resetTabHighlighted(int index)
{
    if (ReKonfig::animatedTabHighlighting())
        removeAnimation(index);

    setTabTextColor(index, KColorScheme(QPalette::Active, KColorScheme::Window).foreground(KColorScheme::NormalText).color());
}
示例#3
0
文件: tabbar.cpp 项目: Arakmar/rekonq
void TabBar::setTabHighlighted(int index)
{
    const QByteArray propertyName = highlightPropertyName(index);
    const QColor highlightColor = KColorScheme(QPalette::Active, KColorScheme::Window).foreground(KColorScheme::PositiveText).color();

    if (tabTextColor(index) != highlightColor)
    {
        if (ReKonfig::animatedTabHighlighting())
        {
            m_tabHighlightEffect->setEnabled(true);
            m_tabHighlightEffect->setProperty(propertyName, qreal(0.9));
            QPropertyAnimation *anim = new QPropertyAnimation(m_tabHighlightEffect, propertyName);
            m_highlightAnimation.insert(propertyName, anim);

            //setup the animation
            anim->setStartValue(0.9);
            anim->setEndValue(0.0);
            anim->setDuration(500);
            anim->setLoopCount(2);
            anim->start(QAbstractAnimation::DeleteWhenStopped);

            m_animationMapper->setMapping(anim, index);
            connect(anim, SIGNAL(finished()), m_animationMapper, SLOT(map()));
        }

        setTabTextColor(index, highlightColor);
    }
}
示例#4
0
void KateTabBar::slotDocumentChange(KTextEditor::Document *document)
{
    int key = m_keys [document];

    // sets the icon
    setTabIcon(key, KIcon(KIO::pixmapForUrl(document->url(), 0, KIconLoader::Desktop, 16)));

    if(document->isModified()) {
        setTabText(key, document->documentName() + " *");
        setTabTextColor(key, Qt::red);
    }
    else {
        setTabText(key, document->documentName());
        setTabTextColor(key, Qt::black);
    }
}
示例#5
0
文件: tabbar.cpp 项目: 593in/qupzilla
void TabBar::overrideTabTextColor(int index, QColor color)
{
    if (!m_originalTabTextColor.isValid()) {
        m_originalTabTextColor = tabTextColor(index);
    }

    setTabTextColor(index, color);
}
示例#6
0
void MyTabBar::slotToggleActive(int state)
{

	QString buttonName = this->sender()->objectName();
	int index = buttonName.right(1).toInt() - 1;
	QPalette palette = QApplication::palette();
	setTabTextColor(index, state == Qt::Checked ? palette.text().color() : palette.dark().color());
	// setTabEnabled(index, state == Qt::Checked);
	emit toggledEnable(index + 1, state == Qt::Checked);
}
示例#7
0
void pTabBar::dropEvent( QDropEvent* event )
{
    if ( !event->mimeData()->hasUrls() )
    {
        // get drop tab
        int ni = tabAt( event->pos() );
        
        // if get it
        if ( ni != -1 )
        {
            // get original tab infos
            int oi = event->mimeData()->data( "x-tabindex" ).toInt();
            QVariant otd = tabData( oi );
            QIcon oti = tabIcon( oi );
            QString ott = tabText( oi );
            QColor ottc = tabTextColor( oi );
            QString ottt = tabToolTip( oi );
            QString otwt = tabWhatsThis( oi );
            
            // remove original tab
            removeTab( oi );
            
            // insert new one with correct infos
            int i = insertTab( ni, oti, ott );
            setTabData( i, otd );
            setTabTextColor( i, ottc );
            setTabToolTip( i, ottt );
            setTabWhatsThis( i, otwt );
            
            //accept
            event->acceptProposedAction();
            
            // emit signal
            emit tabDropped( oi, i );
            
            // set new current index
            setCurrentIndex( i );
        }
    }
    else
        emit urlsDropped( event->mimeData()->urls () );
    
    // default event
    QTabBar::dropEvent( event );
}
void AdmTabBar::delBlinkingTab(int tabIndex)
{
  if(m_blinkTabs.contains(tabIndex))
  {
    m_timer->blockSignals(true);
    m_blinkTabs.removeOne(tabIndex);
    setTabTextColor(tabIndex,palette().color(QPalette::WindowText));
    m_timer->blockSignals(false);
  }

  if(m_blinkTabs.count() == 0)
  {
    disconnect(m_timer, SIGNAL(timeout()), 
               this,    SLOT(sTickTock()));
    delete m_timer;
    m_timer = NULL;
    delete m_time;
    m_time = NULL;
  }
}
示例#9
0
/*!
    \details Redo the tabs color
*/
void pTabBar::resetTabsColor()
{
    for ( int i = 0; i < count(); i++ )
        setTabTextColor( i, i == currentIndex() ? currentTabColor() : tabsColor() );
}
示例#10
0
文件: tabbar.cpp 项目: 593in/qupzilla
void TabBar::restoreTabTextColor(int index)
{
    setTabTextColor(index, m_originalTabTextColor);
}