From cf88f0b6739f7491f15315453380e1f473dc2597 Mon Sep 17 00:00:00 2001 From: xiaoming <2014500726@smail.xtu.edu.cn> Date: Wed, 11 Sep 2024 15:07:04 +0800 Subject: [PATCH] Improve the appearance of the session tabs Signed-off-by: xiaoming <2014500726@smail.xtu.edu.cn> --- CHANGELOG.md | 2 ++ docs/changelog.md | 1 + src/sessiontab/sessiontab.cpp | 5 +++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8eab9b17..bcf09583 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ en-US: - Add system beep support - Add record script feature - Improve the default path of recording logs, etc. to the last saved path +- Improve the appearance of the session tabs - Fix the small probability memory leak problem zh-CN: @@ -18,6 +19,7 @@ zh-CN: - 增加系统响铃支持 - 增加记录脚本功能 - 改进记录日志等默认路径为上次保存路径 +- 改进会话标签外观 - 修复可能存在的小概率内存泄漏问题 ## [[V0.5.0](https://github.com/QQxiaoming/quardCRT/releases/tag/V0.5.0)] - 2024-08-26 diff --git a/docs/changelog.md b/docs/changelog.md index abcf6e7c..5f76d583 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -9,6 +9,7 @@ - Add system beep support - Add record script feature - Improve the default path of recording logs, etc. to the last saved path +- Improve the appearance of the session tabs - Fix the small probability memory leak problem ## [[V0.5.0](https://github.com/QQxiaoming/quardCRT/releases/tag/V0.5.0)] - 2024-08-26 diff --git a/src/sessiontab/sessiontab.cpp b/src/sessiontab/sessiontab.cpp index e824c80a..87363f02 100644 --- a/src/sessiontab/sessiontab.cpp +++ b/src/sessiontab/sessiontab.cpp @@ -146,6 +146,7 @@ SessionTabBar::SessionTabBar(QWidget *parent) : QTabBar(parent) { tabBarInstances << this; setAttribute(Qt::WA_Hover, true); + setExpanding(false); preview = new SessionTabBarPreviewWidget; preview->hide(); preview->window()->lower(); @@ -463,9 +464,9 @@ void SessionTab::setTabStaticText(TitleScrollMode mode, int index, QString title } } txt = txt + "..."; - title = txt + QString(titleWidth - CharWidth::string_unicode_width(txt),' '); + title = txt + QString(titleWidth - CharWidth::string_unicode_width(txt),QChar(0x00A0)); } else { - title = title + QString(titleWidth - CharWidth::string_unicode_width(title),' '); + title = title + QString(titleWidth - CharWidth::string_unicode_width(title),QChar(0x00A0)); } FancyTabWidget::setTabText(index,title); }