Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/controls/tabbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -862,8 +862,8 @@ QSize Tabbar::tabSizeHint(int index) const
if (index >= 0) {
int total = this->width();
// 计算每个tab宽度:标签数未溢出时使用固定最大宽度,溢出时等分
const int maxTabWidth = 160;
const int minTabWidth = 110;
const int maxTabWidth = 200;
const int minTabWidth = (index == currentIndex()) ? 160 : 110;
int tabCount = DTabBar::count();
int tabWidth = maxTabWidth;

Expand Down Expand Up @@ -898,9 +898,9 @@ QSize Tabbar::maximumTabSizeHint(int index) const
qDebug() << "Enter maximumTabSizeHint, index:" << index;
Q_UNUSED(index)
#ifdef DTKWIDGET_CLASS_DSizeMode
return QSize(160, DGuiApplicationHelper::isCompactMode() ? s_TabbarHeightCompact : s_TabbarHeight);
return QSize(200, DGuiApplicationHelper::isCompactMode() ? s_TabbarHeightCompact : s_TabbarHeight);
#else
return QSize(160, 40);
return QSize(200, 40);
#endif
qDebug() << "Exit maximumTabSizeHint";
}
Expand Down
3 changes: 1 addition & 2 deletions tests/src/controls/ut_tabbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ TEST(UT_Tabbar_maximumTabSizeHint, UT_Tabbar_maximumTabSizeHint)
Tabbar * tab = new Tabbar();
tab->addTab("/.cache/deepin/deepin-editor","aa");

EXPECT_EQ(tab->maximumTabSizeHint(0),QSize(160, 40));
EXPECT_EQ(tab->maximumTabSizeHint(0),QSize(200, 40));

EXPECT_NE(tab,nullptr);

Expand Down Expand Up @@ -813,4 +813,3 @@ TEST(UT_Tabbar_tr, UT_Tabbar_tr)
EXPECT_FALSE(tab->tr("Close other tabs").isEmpty());
tab->deleteLater();
}

Loading