Browse Source

:bug: fix https://github.com/siyuan-note/siyuan/issues/5819

Vanessa 2 năm trước cách đây
mục cha
commit
c2ed8dc893

+ 3 - 2
app/src/assets/scss/_layout.scss

@@ -180,9 +180,10 @@
           & > img,
           & > svg {
             float: left;
-            height: 22px;
-            width: 22px;
+            height: 18px;
+            width: 18px;
             border-radius: 2px;
+            margin-top: 1px;
           }
         }
 

+ 10 - 1
app/src/assets/scss/_list.scss

@@ -179,7 +179,16 @@
       border: 0;
       padding: 0;
       color: var(--b3-theme-on-background);
-      @include text-clamp(1)
+      @include text-clamp(1);
+
+      // 搜索列表中自定义图标
+      & > img,
+      & > .custom-icon {
+        height: 14px;
+        width: 14px;
+        float: left;
+        margin-top: 7px;
+      }
     }
 
     &__showall {

+ 4 - 1
app/src/assets/scss/_menu.scss

@@ -108,7 +108,10 @@
     margin-right: 8px;
     color: var(--b3-theme-on-surface);
 
-    & > svg {
+    // 分屏下拉的页签列表
+    & > svg,
+    & > img {
+      float: left;
       height: 14px;
       width: 14px;
     }

+ 0 - 7
app/src/assets/scss/_search.scss

@@ -36,13 +36,6 @@
     top: 20px;
   }
 
-  &__list .custom-icon {
-    height: 16px;
-    width: 16px;
-    float: left;
-    margin-top: 6px;
-  }
-
   &__label {
     cursor: pointer;
     flex: 1;

+ 2 - 1
app/src/search/index.ts

@@ -10,6 +10,7 @@ import {fetchPost} from "../util/fetch";
 import {onGet} from "../protyle/util/onGet";
 import {openFileById} from "../editor/util";
 import {addLoading} from "../protyle/ui/initUI";
+import {unicode2Emoji} from "../emoji";
 
 export class Search extends Model {
     public text: string;
@@ -277,7 +278,7 @@ export class Search extends Model {
             const title = escapeHtml(getNotebookName(item.box)) + getDisplayName(item.hPath, false);
             resultHTML += `<div data-type="search-item" class="b3-list-item${index === 0 ? " b3-list-item--focus" : ""}" data-url="${item.box}" data-path="${item.path}" data-node-id="${item.id}">
     <svg class="b3-list-item__graphic"><use xlink:href="#${getIconByType(item.type)}"></use></svg>
-    <span class="b3-list-item__text">${item.content}</span>
+    <span class="b3-list-item__text">${unicode2Emoji(item.ial.icon)}${item.ial.icon ? "&nbsp;" : ""}${item.content}</span>
     <span class="b3-list-item__meta b3-list-item__meta--ellipsis" title="${Lute.EscapeHTMLStr(title)}">${Lute.EscapeHTMLStr(title)}</span>
 </div>`;
         });