コード例 #1
0
ファイル: tabbar.cpp プロジェクト: char101/qupzilla
void TabBar::tabRemoved(int index)
{
    Q_UNUSED(index)

    showCloseButton(currentIndex());
    setVisible(!(count() == 1 && m_hideTabBarWithOneTab));
}
コード例 #2
0
ファイル: tabbar.cpp プロジェクト: solodyagin/qupzilla
void TabBar::updatePinnedTabCloseButton(int index)
{
    if (!validIndex(index)) {
        return;
    }

    WebTab* webTab = qobject_cast<WebTab*>(m_tabWidget->widget(index));
    QAbstractButton* button = qobject_cast<QAbstractButton*>(tabButton(index, closeButtonPosition()));

    bool pinned = webTab && webTab->isPinned();

    if (pinned) {
        if (button) {
            button->hide();
        }
    }
    else {
        if (button) {
            button->show();
        }
        else {
            showCloseButton(index);
        }
    }
}
コード例 #3
0
ファイル: tabbar.cpp プロジェクト: solodyagin/qupzilla
void TabBar::overflowChanged(bool overflowed)
{
    // Make sure close buttons on inactive tabs are hidden
    // This is needed for when leaving fullscreen from non-overflowed to overflowed state
    if (overflowed && m_showCloseOnInactive != 1) {
        setTabsClosable(false);
        showCloseButton(currentIndex());
    }
}
コード例 #4
0
ファイル: tabbar.cpp プロジェクト: ff2000/qupzilla
void TabBar::currentTabChanged(int index)
{
    if (!validIndex(index)) {
        return;
    }

    hideTabPreview(false);

    showCloseButton(index);
    hideCloseButton(m_tabWidget->lastTabIndex());
}
コード例 #5
0
ファイル: tabbar.cpp プロジェクト: 593in/qupzilla
void TabBar::tabRemoved(int index)
{
    Q_UNUSED(index)

    showCloseButton(currentIndex());
    setVisible(!(count() == 1 && m_hideTabBarWithOneTab));

    // Make sure to move add tab button to correct position when there are no normal tabs
    if (normalTabsCount() == 0) {
        int xForAddTabButton = cornerWidth(Qt::TopLeftCorner) + pinTabBarWidth();
        if (QApplication::layoutDirection() == Qt::RightToLeft)
            xForAddTabButton = width() - xForAddTabButton;
        emit moveAddTabButton(xForAddTabButton);
    }
}
コード例 #6
0
ファイル: tabbar.cpp プロジェクト: gnikandrov/qupzilla
void TabBar::currentTabChanged(int index)
{
    if (!validIndex(index)) {
        return;
    }

    // Don't hide close buttons when dragging tabs
    if (m_dragStartPosition.isNull()) {
        showCloseButton(index);
        hideCloseButton(m_tabWidget->lastTabIndex());

        ensureVisible(index);
    }

    m_tabWidget->currentTabChanged(index);
}
コード例 #7
0
ファイル: tabbar.cpp プロジェクト: solodyagin/qupzilla
void TabBar::currentTabChanged(int index)
{
    if (!validIndex(index)) {
        return;
    }

    // Don't hide close buttons when dragging tabs
    if (m_dragStartPosition.isNull()) {
        showCloseButton(index);
        if (m_lastTab) {
            hideCloseButton(m_lastTab->tabIndex());
        }
        QTimer::singleShot(100, this, [this]() { ensureVisible(); });
    }

    m_lastTab = webTab(index);
    m_tabWidget->currentTabChanged(index);
}
コード例 #8
0
ファイル: tabbar.cpp プロジェクト: ff2000/qupzilla
void TabBar::tabRemoved(int index)
{
    Q_UNUSED(index)

    showCloseButton(currentIndex());
}