mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 13:57:57 -07:00
20 lines
571 B
C++
20 lines
571 B
C++
|
// Copyright 2021 Dolphin Emulator Project
|
||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||
|
|
||
|
#include "DolphinQt/QtUtils/PartiallyClosableTabWidget.h"
|
||
|
|
||
|
#include <QStyle>
|
||
|
#include <QTabBar>
|
||
|
|
||
|
PartiallyClosableTabWidget::PartiallyClosableTabWidget(QWidget* parent) : QTabWidget(parent)
|
||
|
{
|
||
|
setTabsClosable(true);
|
||
|
}
|
||
|
|
||
|
void PartiallyClosableTabWidget::setTabUnclosable(int index)
|
||
|
{
|
||
|
QTabBar::ButtonPosition closeSide = (QTabBar::ButtonPosition)style()->styleHint(
|
||
|
QStyle::SH_TabBar_CloseButtonPosition, nullptr, this);
|
||
|
tabBar()->setTabButton(index, closeSide, nullptr);
|
||
|
}
|