Просмотр исходного кода

app: dont color emoji glyphs for nicks in chatview

darkfi 1 год назад
Родитель
Сommit
49039bff1c
2 измененных файлов с 8 добавлено и 4 удалено
  1. 2 2
      bin/app/Makefile
  2. 6 2
      bin/app/src/ui/chatview/page.rs

+ 2 - 2
bin/app/Makefile

@@ -43,10 +43,10 @@ win-debug: $(SRC) fonts
 	$(CARGO) build $(DEBUG_FEATURES)
 	$(CARGO) build $(DEBUG_FEATURES)
 	-mv target/debug/darkfi-app.exe .
 	-mv target/debug/darkfi-app.exe .
 android-release: $(SRC) fonts
 android-release: $(SRC) fonts
-	podman run -v $(shell pwd)/../../:/root/darkfi -w /root/darkfi/bin/app/ -t apk $(CARGO) quad-apk build --release $(RELEASE_FEATURES)
+	podman run -v $(shell pwd)/../../:/root/darkfi -w /root/darkfi/bin/app/ -t apk cargo quad-apk build --release $(RELEASE_FEATURES)
 	-mv $(RELEASE_APK) darkfi-app.apk
 	-mv $(RELEASE_APK) darkfi-app.apk
 android-debug: $(SRC) fonts
 android-debug: $(SRC) fonts
-	podman run -v $(shell pwd)/../../:/root/darkfi -w /root/darkfi/bin/app/ -t apk $(CARGO) quad-apk build $(DEBUG_FEATURES)
+	podman run -v $(shell pwd)/../../:/root/darkfi -w /root/darkfi/bin/app/ -t apk cargo quad-apk build $(DEBUG_FEATURES)
 	-mv $(DEBUG_APK) darkfi-app_debug.apk
 	-mv $(DEBUG_APK) darkfi-app_debug.apk
 
 
 build-release: $(SRC) fonts
 build-release: $(SRC) fonts

+ 6 - 2
bin/app/src/ui/chatview/page.rs

@@ -34,7 +34,7 @@ use crate::{
         GfxBufferId, GfxDrawCall, GfxDrawInstruction, GfxDrawMesh, GfxTextureId,
         GfxBufferId, GfxDrawCall, GfxDrawInstruction, GfxDrawMesh, GfxTextureId,
         GraphicsEventPublisherPtr, ManagedTexturePtr, Point, Rectangle, RenderApi,
         GraphicsEventPublisherPtr, ManagedTexturePtr, Point, Rectangle, RenderApi,
     },
     },
-    mesh::{Color, MeshBuilder, COLOR_BLUE, COLOR_GREEN, COLOR_PINK},
+    mesh::{Color, MeshBuilder, COLOR_BLUE, COLOR_GREEN, COLOR_PINK, COLOR_WHITE},
     prop::{PropertyBool, PropertyColor, PropertyFloat32, PropertyPtr, PropertyUint32, Role},
     prop::{PropertyBool, PropertyColor, PropertyFloat32, PropertyPtr, PropertyUint32, Role},
     pubsub::Subscription,
     pubsub::Subscription,
     scene::{SceneNodePtr, SceneNodeWeak},
     scene::{SceneNodePtr, SceneNodeWeak},
@@ -281,7 +281,7 @@ impl PrivMessage {
             glyph_rect.x += off_x;
             glyph_rect.x += off_x;
             glyph_rect.y -= off_y;
             glyph_rect.y -= off_y;
 
 
-            let color = match section {
+            let mut color = match section {
                 0 => nick_color,
                 0 => nick_color,
                 _ => {
                 _ => {
                     if self.confirmed {
                     if self.confirmed {
@@ -296,6 +296,10 @@ impl PrivMessage {
             //    mesh.draw_outline(&glyph_rect, COLOR_BLUE, 2.);
             //    mesh.draw_outline(&glyph_rect, COLOR_BLUE, 2.);
             //}
             //}
 
 
+            if glyph.sprite.has_color {
+                color = COLOR_WHITE;
+            }
+
             mesh.draw_box(&glyph_rect, color, uv_rect);
             mesh.draw_box(&glyph_rect, color, uv_rect);
 
 
             if is_last && section < 1 && is_whitespace(&glyph.substr) {
             if is_last && section < 1 && is_whitespace(&glyph.substr) {