*/}}
YimingWu vor 3 Monaten
Ursprung
Commit
a2daa82333
4 geänderte Dateien mit 10 neuen und 1 gelöschten Zeilen
  1. 3 0
      la_interface.h
  2. 2 0
      la_kernel.c
  3. 4 0
      la_tns_kernel.c
  4. 1 1
      resources/la_widgets.c

+ 3 - 0
la_interface.h

@@ -903,6 +903,7 @@ extern laProp* LA_PROP_CONTROLLER;
 #define LA_BT_SFACE   (LA_BT_FACE|LA_BT_SELECTED)
 #define LA_BT_WARNING (1<<12)
 #define LA_UI_WARNING LA_BT_WARNING
+#define LA_BT_SHADOW (1<<13)
 
 #define LA_UI_TAG_IS_OFFSCREEN  (1<<0)
 #define LA_UI_TAG_CAVANS_SCALED (1<<1)
@@ -937,6 +938,7 @@ STRUCTURE(laTheme){
     real SVertexColor[4];
     real SEdgeColor[4];
     real SFaceColor[4];
+    real ShadowColor[4];
     real EdgeBrightness, EdgeTransparency;
     real VertexBrightness, VertexTransparency;
     real SelectedVertexTransparency;
@@ -1215,6 +1217,7 @@ STRUCTURE(laWidget){
 #define LA_UI_FLAGS_NO_LABEL   (1<<29)
 #define LA_UI_COLLECTION_SIMPLE_SELECTOR LA_UI_FLAGS_CYCLE
 #define LA_UI_FLAGS_WARNING    (LA_UI_FLAGS_CYCLE)
+#define LA_TEXT_SHADOW         LA_UI_FLAGS_NO_OVERLAY
 
 #define LA_UI_FLAGS_INT_ICON  (LA_UI_FLAGS_NO_DECAL|LA_UI_FLAGS_NO_EVENT|LA_UI_FLAGS_ICON)
 #define LA_UI_FLAGS_PLAIN     (LA_UI_FLAGS_NO_DECAL|LA_UI_FLAGS_NO_EVENT)

+ 2 - 0
la_kernel.c

@@ -2119,6 +2119,7 @@ real* laAccentColor(int which){
         case LA_BT_SVERTEX: return MAIN.CurrentTheme->SVertexColor;
         case LA_BT_SEDGE: return MAIN.CurrentTheme->SEdgeColor;
         case LA_BT_SFACE: return MAIN.CurrentTheme->SFaceColor;
+        case LA_BT_SHADOW: return MAIN.CurrentTheme->ShadowColor;
     }
     return MAIN.CurrentTheme->SelectionColor;
 }
@@ -2146,6 +2147,7 @@ void la_RefreshThemeColorSelf(laTheme* th){
     tnsVectorCopy3d(th->AccentColor, th->SVertexColor); th->SVertexColor[3]=th->SelectedVertexTransparency;
     tnsVectorCopy3d(th->AccentColor, th->SEdgeColor); th->SEdgeColor[3]=th->SelectedEdgeTransparency;
     tnsVectorCopy3d(th->AccentColor, th->SFaceColor); th->SFaceColor[3]=th->SelectedFaceTransparency;
+    tnsVectorCopy3d(th->Color, th->ShadowColor); th->ShadowColor[3]=th->CursorAlpha;
 }
 void la_RefreshThemeColor(laTheme* th){
     real hcy[3], usehcy[3], normalhcy[3];

+ 4 - 0
la_tns_kernel.c

@@ -3197,6 +3197,10 @@ int tns_ClipCharacterT2D(real* v, real* t){
     return 1;
 }
 void tnsDrawStringM(char *content, uint32_t* contentU, real Color[4], int L, int R, int T, int Flags){
+    if(Flags&LA_TEXT_SHADOW){
+        int offset = LA_RH/16;
+        tnsDrawStringM(content, contentU, laAccentColor(LA_BT_SHADOW), L+offset, R+offset, T+offset, Flags&(~LA_TEXT_SHADOW));
+    }
     if(!FM->UsingFont){return;} if(Flags&(LA_TEXT_LCD_16|LA_TEXT_LCD_7)){
         tnsDrawStringLCD(content,contentU,Color,L,R,T,Flags,1.0); return;
     }

+ 1 - 1
resources/la_widgets.c

@@ -946,7 +946,7 @@ void la_EnumSelectorDraw(laUiItem *ui, int h){
             if((!HasText) && (!buf[0])) strcpy(buf, transLate(use_ei->Name));
             int iconR; if(IconOnly)iconR=TNS_MAX2(_L+LA_RH,_R);else{ iconR=TNS_MIN2(_L+LA_RH,_R); }
             if (use_ei->IconID && !ico){ ico=use_ei->IconID; }
-            if (ico) tnsDrawIcon(ico, laThemeColor(bt, LA_BT_TEXT|ExtraState), _L,iconR, _U, LA_TEXT_ALIGN_CENTER);
+            if (ico) tnsDrawIcon(ico, laThemeColor(bt, LA_BT_TEXT|ExtraState), _L,iconR, _U, LA_TEXT_ALIGN_CENTER|ui->Flags);
             if(!IconOnly){
                 int UseFlags=ui->Flags; if(!HasIcon && IsExpand){ if(!(UseFlags&LA_TEXT_ALIGN)); UseFlags|=LA_TEXT_ALIGN_CENTER; }
                 tnsDrawStringAuto(buf, laThemeColor(bt, LA_BT_TEXT|ExtraState), _L+bt->LM+(HasIcon?LA_RH:0), _R-bt->RM, _U, UseFlags);