Skip to content

Commit 2df60b4

Browse files
18202781743deepin-bot[bot]
authored andcommitted
refactor: update display mode icons and logic
1. Changed icon names from 'osd_display_*' to 'osd_multi_screen_*' for better consistency 2. Modified display mode logic to support more than 2 screens by: - Always sorting output names (not just for 2 screens) - Using 'osd_multi_screen_only_more' icon when more than 2 screens exist 3. Removed old icon files and added new ones with updated naming scheme refactor: 更新显示模式图标和逻辑 1. 将图标名称从'osd_display_*'改为'osd_multi_screen_*'以提高一致性 2. 修改显示模式逻辑以支持超过2个屏幕: - 始终排序输出名称(不仅限于2个屏幕时) - 当存在超过2个屏幕时使用'osd_multi_screen_only_more'图标 3. 删除旧图标文件并添加具有更新命名方案的新图标 pms: BUG-315934
1 parent 739ef93 commit 2df60b4

10 files changed

+5
-4
lines changed

panels/notification/osd/displaymode/displaymodeapplet.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,14 @@ void DisPlayModeApplet::fetchPlanItems()
165165
m_planItems.clear();
166166
m_currentPlanItem = nullptr;
167167

168-
m_planItems << new DPItem(tr("Duplicate"), "osd_display_copy", DPItem::Merge, this);
169-
m_planItems << new DPItem(tr("Extend"), "osd_display_expansion", DPItem::Extend, this);
170-
if (outputNames.size() == 2) {
168+
m_planItems << new DPItem(tr("Duplicate"), "osd_multi_screen_copy", DPItem::Merge, this);
169+
m_planItems << new DPItem(tr("Extend"), "osd_multi_screen_extension", DPItem::Extend, this);
170+
if (outputNames.size() >= 2) {
171171
std::sort(outputNames.begin(), outputNames.end(), std::greater<QString>());
172172
for (int i = 0; i < outputNames.size(); i++) {
173173
const auto item = outputNames[i];
174-
m_planItems << new DPItem(tr("Only on %1").arg(item), item, QString("osd_display_custom%1").arg(i + 1), DPItem::Single, this);
174+
const QString iconName = i < 2 ? QString("osd_multi_screen_only%1").arg(i + 1) : "osd_multi_screen_only_more";
175+
m_planItems << new DPItem(tr("Only on %1").arg(item), item, iconName, DPItem::Single, this);
175176
}
176177
}
177178
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)