*/}}
Ver Fonte

Disabled value color

YimingWu há 1 ano atrás
pai
commit
e3f85aa811
1 ficheiros alterados com 7 adições e 2 exclusões
  1. 7 2
      resources/la_widgets.c

+ 7 - 2
resources/la_widgets.c

@@ -207,6 +207,7 @@ int la_ColorSelectorGetMinWidth(laUiItem *ui){
 }
 int la_ValueGetMinWidth(laUiItem *ui){
     int ExtraW=0;
+    if(ui->Flags&LA_UI_FLAGS_NO_LABEL){ return LA_RH; }
     if((ui->Flags&LA_UI_FLAGS_EXPAND)&&(!(ui->Flags&LA_UI_FLAGS_NO_LABEL))){
         ExtraW+=tnsStringGetWidth(transLate(ui->PP.LastPs->p->Name),0,0);
     }
@@ -566,6 +567,7 @@ void la_IntDraw(laUiItem *ui, int h){
     int IsIcon=ui->Flags&LA_UI_FLAGS_ICON;
     int NoDecal=ui->Flags&LA_UI_FLAGS_NO_DECAL;
     int NoLabel=ui->Flags&LA_UI_FLAGS_NO_LABEL;
+    int IsDisabled=ui->Flags&LA_UI_FLAGS_DISABLED;
 
     if (laIsPropertyReadOnly(&ui->PP) && !NoDecal) ui->State = LA_BT_DISABLED;
 
@@ -631,7 +633,8 @@ void la_IntDraw(laUiItem *ui, int h){
 
             tnsDrawStringM(0, buf, laThemeColor(bt, LA_BT_TEXT_ACTIVE), _L + bt->LM, _R - bt->RM, _U, ui->Flags);
         }else{
-            tnsDrawStringWithPriority(NoLabel?0:buf2, buf, laThemeColor(bt, LA_BT_TEXT|ui->State), bt->TextAlign, _L + bt->LM, _R - bt->RM, _U, ui->Flags);//, ui->ExtraInstructions);
+            tnsDrawStringWithPriority(NoLabel?0:buf2, buf,
+                IsDisabled?laThemeColor(bt, LA_BT_DISABLED):laThemeColor(bt, LA_BT_TEXT|ui->State), bt->TextAlign, _L + bt->LM, _R - bt->RM, _U, ui->Flags);//, ui->ExtraInstructions);
         }
         if (ui->Extra && ui->Extra->On == i + 1) ui->State = Original;
     }
@@ -653,6 +656,7 @@ void la_FloatDraw(laUiItem *ui, int h){
     int NoDecal=ui->Flags&LA_UI_FLAGS_NO_DECAL;
     int IsRad=ui->PP.LastPs->p->IsRadAngle;
     int NoLabel=ui->Flags&LA_UI_FLAGS_NO_LABEL;
+    int IsDisabled=ui->Flags&LA_UI_FLAGS_DISABLED;
 
     if (laIsPropertyReadOnly(&ui->PP) && !NoDecal) ui->State = LA_BT_DISABLED;
 
@@ -714,7 +718,8 @@ void la_FloatDraw(laUiItem *ui, int h){
 
             tnsDrawStringM(0, buf, laThemeColor(bt, LA_BT_TEXT_ACTIVE), _L + bt->LM, _R - bt->RM, _U, ui->Flags);
         }else{
-            tnsDrawStringWithPriority(NoLabel?0:buf2, buf, laThemeColor(bt, LA_BT_TEXT|ui->State), bt->TextAlign, _L + bt->LM, _R - bt->RM, _U, ui->Flags);//, ui->ExtraInstructions);
+            tnsDrawStringWithPriority(NoLabel?0:buf2, buf,
+                IsDisabled?laThemeColor(bt, LA_BT_DISABLED):laThemeColor(bt, LA_BT_TEXT|ui->State), bt->TextAlign, _L + bt->LM, _R - bt->RM, _U, ui->Flags);//, ui->ExtraInstructions);
         }
         if (ui->Extra && ui->Extra->On == i + 1) ui->State = Original;
     }