*/}}
Ver código fonte

Display optimizations and version bump

YimingWu 1 ano atrás
pai
commit
c217e13b88

+ 1 - 1
la_interface.h

@@ -46,7 +46,7 @@
 //#include <Windows.h>
 
 #define LA_VERSION_MAIN 5
-#define LA_VERSION_SUB 2
+#define LA_VERSION_SUB 3
 
 #define LA_ACTUATOR_CAPABILITY_MAIN 5
 #define LA_ACTUATOR_CAPABILITY_SUB 0

+ 10 - 9
resources/la_properties.c

@@ -33,9 +33,7 @@ void laset_TerminalInput(void* unused, char* content){
     strcpy(MAIN.TerminalInput,content);
 }
 
-void *laget_ActiveTheme(void *unused){
-    return MAIN.CurrentTheme;
-}
+void *laget_ActiveTheme(void *unused){ return MAIN.CurrentTheme; }
 void laset_ActiveTheme(void* unused, laTheme* t){
     if(!t) MAIN.CurrentTheme = MAIN.Themes.pFirst;
     else MAIN.CurrentTheme = t;
@@ -43,12 +41,8 @@ void laset_ActiveTheme(void* unused, laTheme* t){
     la_RegenerateWireColors();
     laRedrawAllWindows();
 }
-void laset_ThemeName(laTheme *t, char *content){
-    strSafeSet(&t->Name, content);
-}
-void laset_ThemeAuthor(laTheme *t, char *content){
-    strSafeSet(&t->Author, content);
-}
+void laset_ThemeName(laTheme *t, char *content){ strSafeSet(&t->Name, content); }
+void laset_ThemeAuthor(laTheme *t, char *content){ strSafeSet(&t->Author, content); }
 void laset_ThemeColor(laTheme* t, real* array){
     tnsVectorCopy4d(array,t->Color);
     la_RefreshThemeColor(t);
@@ -130,6 +124,11 @@ void laset_ThemeSVertexTransparency(laTheme* t, real val){ t->SelectedVertexTran
 void laset_ThemeSEdgeTransparency(laTheme* t, real val){ t->SelectedEdgeTransparency = val; la_RefreshThemeColorSelf(t); laRedrawAllWindows(); }
 void laset_ThemeSFaceTransparency(laTheme* t, real val){ t->SelectedFaceTransparency = val; la_RefreshThemeColorSelf(t); laRedrawAllWindows(); }
 
+void laread_UsingTheme(void* unused, char* name){ laTheme* t=laGetTheme(name); if(t){ laset_ActiveTheme(0,t); } }
+void laget_UsingTheme(void* unused, char* result, char**result_direct){ laTheme* t=laget_ActiveTheme(0);
+    if(t&&t->Name&&t->Name->Ptr){ *result_direct=t->Name->Ptr; return; } *result_direct="NOT FOUND";
+}
+
 void laset_WireColorSlices(void* unused, int val){ MAIN.WireColorSlices = val; la_RegenerateWireColors(); laRedrawAllWindows(); }
 void laset_WireThickness(void* unused, real val){ MAIN.WireThickness = val;laRedrawAllWindows(); }
 void laset_WireSaggyness(void* unused, real val){ MAIN.WireSaggyness = val; laRedrawAllWindows(); }
@@ -1627,6 +1626,8 @@ void la_RegisterInternalProps(){
             laAddFloatProperty(p, "color_picker_gamma", "Color Picker Gamma", "Allows less saturated colors to have more areas", 0,0,0,3.0,1.0, 0.05,1.5, 0,offsetof(LA, ColorPickerGamma), 0,laset_ColorPickerGamma,0,0,0,0,0,0,0,0,0);
             laAddFloatProperty(p, "viewport_halftone_factor", "Halftone Factor", "Viewport halftone mixing factor", 0,0,0,1.0,0.0,0.05,0.5, 0,offsetof(LA, ViewportHalftoneFactor), 0,laset_ViewportHalftoneFactor,0,0,0,0,0,0,0,0,0);
             laAddFloatProperty(p, "viewport_halftone_size", "Halftone Size", "Viewport halftone size", 0,0,0,8.0,1.9, 0.05,3.7, 0,offsetof(LA, ViewportHalftoneSize), 0,laset_ViewportHalftoneSize,0,0,0,0,0,0,0,0,0);
+
+            laAddStringProperty(p,"theme_name","Theme Name","Using theme name",0,0,0,0,0,0,0,laget_UsingTheme,0,laread_UsingTheme,0);
         }
 
         p = laAddPropertyContainer("la_translation_language", "Language", "Translation language pack", 0,0,sizeof(laTranslationNode), 0,0,1);{

+ 7 - 6
resources/la_templates.c

@@ -632,12 +632,11 @@ void laui_Theme(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColu
     //}
 
     col = laFirstColumn(uil); laSplitColumn(uil,col,0.5);
-    cl=laLeftColumn(col,0);
-    cr=laRightColumn(col,0);
+    cl=laLeftColumn(col,0); cr=laRightColumn(col,0);
 
     ui=laBeginRow(uil,col, 0,0);
-    laShowItem(uil,col,Base, "name")->Expand=1;
     laShowItem(uil,col,Base, "delete");
+    laShowItem(uil,col,Base, "name")->Expand=1;
     laEndRow(uil, ui);
 
     laShowLabel(uil, col, "Basics:",0,0);
@@ -1337,12 +1336,14 @@ void laui_UserPreference(laUiList *uil, laPropPack *Base, laPropPack *OperatorIn
 
         muil = laAddTabPage(bracket, "Theme");{
             //muil->HeightCoeff = -1;
-            mc = laFirstColumn(muil);
+            mc = laFirstColumn(muil); laSplitColumn(muil,mc,0.4);
+            mcl=laLeftColumn(mc,7);mcr=laRightColumn(mc,0);
 
             if(MAIN.PreferencePageTheme){ MAIN.PreferencePageTheme(muil,0,0,0,0); }
 
-            laShowLabel(muil, mc, "Active Theme", 0, 0);
-            laShowItemFull(muil, mc, 0, "la.themes", LA_WIDGET_COLLECTION_SELECTOR, 0,laui_ThemeListItem,0);
+            laShowLabel(muil, mcl, "Active Theme", 0, 0);
+            laShowItemFull(muil, mcr, 0, "la.themes", LA_WIDGET_COLLECTION_SELECTOR, 0,laui_ThemeListItem,0);
+            laShowSeparator(muil,mc);
             laShowItemFull(muil, mc, 0, "la.themes", LA_WIDGET_COLLECTION_SINGLE, 0 ,0,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
         }
 

+ 3 - 0
resources/la_translations.c

@@ -19,6 +19,9 @@
 #include "la_5.h"
 
 static const char *entries[]={
+"Viewport:","视口:",
+"Halftone Factor","半调色程度",
+"Halftone Size","半调色尺寸",
 "Restore Factory Settings","恢复出厂设置",
 "Restart the program for changes to take effect.","重新启动程序生效。",
 "Success","成功",

+ 2 - 2
resources/la_widgets.c

@@ -2932,8 +2932,8 @@ void la_NodeSocketGetPositionDelta(laUiItem* ui, int ex,int ey,int* dx,int* dy){
     int cx,cy;
     if(ui->Flags&LA_UI_SOCKET_LABEL_E){ cy=(ui->U+ui->B)/2; cx=ui->L+(ui->B-ui->U)/2; }
     elif(ui->Flags&LA_UI_SOCKET_LABEL_W){ cy=(ui->U+ui->B)/2; cx=ui->R-(ui->B-ui->U)/2; }
-    elif(ui->Flags&LA_UI_SOCKET_LABEL_N){ cx=(ui->L+ui->R)/2; cy=ui->U+(ui->R-ui->L)/3; }
-    elif(ui->Flags&LA_UI_SOCKET_LABEL_S){ cx=(ui->L+ui->R)/2; cy=ui->B-(ui->R-ui->L)/3; }
+    elif(ui->Flags&LA_UI_SOCKET_LABEL_N){ cx=(ui->L+ui->R)/2; cy=ui->U+(ui->R-ui->L)*0.75; }
+    elif(ui->Flags&LA_UI_SOCKET_LABEL_S){ cx=(ui->L+ui->R)/2; cy=ui->B-(ui->R-ui->L)*0.75; }
     else{ cx=(ui->L+ui->R)/2; cy=(ui->U+ui->B)/2; }
     *dx=cx-ex; *dy=cy-ey;
 }