|
@@ -162,6 +162,9 @@ int la_SocketGetHeight(laUiItem *ui){
|
|
|
if(ui->Flags&(LA_UI_SOCKET_LABEL_N|LA_UI_SOCKET_LABEL_S))return 2; return 1;
|
|
|
}
|
|
|
|
|
|
+int la_ColorSelectorGetMinWidth(laUiItem *ui){
|
|
|
+ return 5*LA_RH;
|
|
|
+}
|
|
|
int la_ValueGetMinWidth(laUiItem *ui){
|
|
|
int ExtraW=0;
|
|
|
if(ui->Flags&LA_UI_FLAGS_EXPAND){ ExtraW+=tnsStringGetWidth(ui->PP.LastPs->p->Name,0,0); }
|
|
@@ -197,15 +200,24 @@ int la_EnumGetMinWidth(laUiItem *ui){
|
|
|
if(!IsIcon){
|
|
|
SharedWidth = bt->LM + bt->RM + ((IsCycle||IsExpand)?0:LA_RH); int HasIcon=0;
|
|
|
if(Highlight){
|
|
|
- tW = tnsStringGetWidth(ep->Base.Name, 0, ui->Flags&LA_TEXT_MONO) + SharedWidth;
|
|
|
- if (tW > W) W = tW;
|
|
|
- }
|
|
|
- for (i = ep->Items.pFirst; i; i = i->Item.pNext){
|
|
|
- tW = tnsStringGetWidth(i->Name, 0, ui->Flags&LA_TEXT_MONO) + SharedWidth;
|
|
|
- if (i->IconID){ HasIcon=1; }
|
|
|
+ if (ui->ExtraInstructions){
|
|
|
+ if (ui->Type->OperatorType->ParseArgs){
|
|
|
+ int ico; char buf[256]; buf[0]=0;
|
|
|
+ ui->Type->OperatorType->ParseArgs(ui->Instructions, &ico, buf);
|
|
|
+ tW = tnsStringGetWidth(buf, 0, ui->Flags&LA_TEXT_MONO) + SharedWidth;
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ tW = tnsStringGetWidth(ep->Base.Name, 0, ui->Flags&LA_TEXT_MONO) + SharedWidth;
|
|
|
+ }
|
|
|
if (tW > W) W = tW;
|
|
|
+ }else{
|
|
|
+ for (i = ep->Items.pFirst; i; i = i->Item.pNext){
|
|
|
+ tW = tnsStringGetWidth(i->Name, 0, ui->Flags&LA_TEXT_MONO) + SharedWidth;
|
|
|
+ if (i->IconID){ HasIcon=1; }
|
|
|
+ if (tW > W) W = tW;
|
|
|
+ }
|
|
|
+ if(HasIcon) W+=bt->LM+LA_RH;
|
|
|
}
|
|
|
- if(HasIcon) W+=bt->LM+LA_RH;
|
|
|
}else{
|
|
|
W = LA_RH;
|
|
|
}
|
|
@@ -747,7 +759,14 @@ void la_EnumSelectorDraw(laUiItem *ui, int h){
|
|
|
tnsPackAs(GL_LINE_LOOP);
|
|
|
}
|
|
|
|
|
|
- if(!Highlight){ strcpy(buf, transLate(use_ei->Name)); }
|
|
|
+ if(!Highlight){
|
|
|
+ if (ui->ExtraInstructions){
|
|
|
+ if (ui->Type->OperatorType->ParseArgs){
|
|
|
+ int ico; buf[0]=0; ui->Type->OperatorType->ParseArgs(ui->Instructions, &ico, buf);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(!buf[0]) strcpy(buf, transLate(use_ei->Name));
|
|
|
+ }
|
|
|
else{ if(ArrLen==1) strcpy(buf, transLate(ui->PP.LastPs->p->Name)); else{ if(i<8)strcat(buf, &prefix[i]); } }
|
|
|
int iconR; if(IconOnly)iconR=TNS_MAX2(_L+LA_RH,_R);else{ iconR=TNS_MIN2(_L+LA_RH,_R); }
|
|
|
if (use_ei->IconID) tnsDrawIcon(use_ei->IconID, laThemeColor(bt, LA_BT_TEXT|ExtraState), _L,iconR, _U, LA_TEXT_ALIGN_CENTER);
|
|
@@ -1432,6 +1451,7 @@ void la_RegisterUiTypesBasic(){
|
|
|
LA_WIDGET_FLOAT_COLOR->Type=
|
|
|
_LA_UI_FLOAT_COLOR = la_RegisterUiType("LA_real_color", LA_PROP_FLOAT | LA_PROP_ARRAY, "LA_real_color_operator",
|
|
|
&_LA_THEME_VALUATOR, la_FloatArrayColorDraw, 0, la_GeneralUiInit, la_GeneralUiDestroy);
|
|
|
+ _LA_UI_FLOAT_COLOR->GetMinWidth=la_ColorSelectorGetMinWidth;
|
|
|
|
|
|
LA_WIDGET_FLOAT_COLOR_HCY->Type=
|
|
|
_LA_UI_FLOAT_COLOR_HCY = la_RegisterUiType("LA_real_hcy", LA_PROP_FLOAT | LA_PROP_ARRAY, "LA_real_hcy_operator",
|