🐞 fix(UI模块): 修复设备类型错误问题

This commit is contained in:
huheng@kylinos.cn 2023-05-12 16:35:53 +08:00
parent e7ae804974
commit 973805495d
4 changed files with 38 additions and 9 deletions

View File

@ -7,17 +7,16 @@
#include <QUuid>
namespace KCommon
{
namespace KCommon {
enum DeviceType {
PC = 0,
Android = 1,
UNKNOWN = 0,
PC = 1,
Phone = 2,
TV = 3,
};
struct DiscoveryDeviceInfo
{
struct DiscoveryDeviceInfo {
QString uuid;
QString ip;
QString port;

29
res/devicetype/tv.svg Normal file
View File

@ -0,0 +1,29 @@
<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M13.2192 41C15.6459 39.9353 19.4975 39.1818 24 39.1818C28.5025 39.1818 32.3541 39.9353 34.7808 41H38.8739L39 40.8772L37.9993 40.1696C35.21 38.1975 29.8648 37 24 37C18.1352 37 12.79 38.1975 10.0007 40.1696L9 40.8772L9.12612 41H13.2192Z" fill="url(#paint0_linear_4327_108251)"/>
<path d="M2 11.8C2 10.1198 2 9.27976 2.32698 8.63803C2.6146 8.07354 3.07354 7.6146 3.63803 7.32698C4.27976 7 5.11984 7 6.8 7H41.2C42.8802 7 43.7202 7 44.362 7.32698C44.9265 7.6146 45.3854 8.07354 45.673 8.63803C46 9.27976 46 10.1198 46 11.8V34.2C46 35.8802 46 36.7202 45.673 37.362C45.3854 37.9265 44.9265 38.3854 44.362 38.673C43.7202 39 42.8802 39 41.2 39H6.8C5.11984 39 4.27976 39 3.63803 38.673C3.07354 38.3854 2.6146 37.9265 2.32698 37.362C2 36.7202 2 35.8802 2 34.2V11.8Z" fill="#61646B"/>
<path d="M2 11.7924C2 10.1173 2 9.27976 2.32698 8.63803C2.6146 8.07354 3.07354 7.6146 3.63803 7.32698C4.27976 7 5.11984 7 6.8 7H8V37L2 37C2 34.6105 2 20.1211 2 11.7924Z" fill="url(#paint1_linear_4327_108251)"/>
<path opacity="0.5" d="M46 11.7924C46 10.1173 46 9.27976 45.673 8.63803C45.3854 8.07354 44.9265 7.6146 44.362 7.32698C43.7202 7 42.8802 7 41.2 7H40V37L46 37C46 34.6105 46 20.1211 46 11.7924Z" fill="url(#paint2_linear_4327_108251)"/>
<path d="M2 11.2C2 10.0799 2 9.51984 2.21799 9.09202C2.40973 8.71569 2.71569 8.40973 3.09202 8.21799C3.51984 8 4.0799 8 5.2 8H42.8C43.9201 8 44.4802 8 44.908 8.21799C45.2843 8.40973 45.5903 8.71569 45.782 9.09202C46 9.51984 46 10.0799 46 11.2V35.8C46 36.9201 46 37.4802 45.782 37.908C45.5903 38.2843 45.2843 38.5903 44.908 38.782C44.4802 39 43.9201 39 42.8 39H5.2C4.07989 39 3.51984 39 3.09202 38.782C2.71569 38.5903 2.40973 38.2843 2.21799 37.908C2 37.4802 2 36.9201 2 35.8V11.2Z" fill="#47494E"/>
<path d="M4 11C4 10.4477 4.44772 10 5 10C17.6667 10 30.3333 10 43 10C43.5523 10 44 10.4477 44 11V36C44 36.5523 43.5523 37 43 37H5C4.44771 37 4 36.5523 4 36V11Z" fill="url(#paint3_linear_4327_108251)"/>
<path opacity="0.2" d="M4 36C4 36.5523 4.44772 37 5 37H30L17 10H5C4.44772 10 4 10.4477 4 11V36Z" fill="white"/>
<defs>
<linearGradient id="paint0_linear_4327_108251" x1="24" y1="39" x2="24" y2="41" gradientUnits="userSpaceOnUse">
<stop stop-color="#3E3E43"/>
<stop offset="1" stop-color="#56565D"/>
</linearGradient>
<linearGradient id="paint1_linear_4327_108251" x1="7.25" y1="8" x2="2" y2="8" gradientUnits="userSpaceOnUse">
<stop stop-color="#61646B" stop-opacity="0"/>
<stop offset="0.526043" stop-color="#94979E"/>
<stop offset="1" stop-color="#61646B" stop-opacity="0"/>
</linearGradient>
<linearGradient id="paint2_linear_4327_108251" x1="40.75" y1="9.82353" x2="46" y2="9.82353" gradientUnits="userSpaceOnUse">
<stop stop-color="#61646B" stop-opacity="0"/>
<stop offset="0.526043" stop-color="#313236"/>
<stop offset="1" stop-color="#61646B" stop-opacity="0"/>
</linearGradient>
<linearGradient id="paint3_linear_4327_108251" x1="5" y1="10" x2="44" y2="37" gradientUnits="userSpaceOnUse">
<stop stop-color="#96F4BD"/>
<stop offset="1" stop-color="#26BD71"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -82,5 +82,6 @@
<file>view/exit-dark-default.svg</file>
<file>view/exit-hover.svg</file>
<file>view/exit-light-default.svg</file>
<file>devicetype/tv.svg</file>
</qresource>
</RCC>

View File

@ -131,7 +131,7 @@ void SearchDeviceWin::setItemInfo(const QMap<QString, KCommon::DiscoveryDeviceIn
QString iconStr = "";
if (it.value().deviceType == KCommon::DeviceType::PC) {
iconStr = QString(":/devicetype/pc.svg");
} else if (it.value().deviceType == KCommon::DeviceType::Android) {
} else if (it.value().deviceType == KCommon::DeviceType::TV) {
iconStr = QString(":/devicetype/tv.svg");
} else if (it.value().deviceType == KCommon::DeviceType::Phone) {
iconStr = QString(":/devicetype/phone.svg");