*/}}
浏览代码

More header UI options

YimingWu 4 月之前
父节点
当前提交
76fb7b4333
共有 4 个文件被更改,包括 51 次插入22 次删除
  1. 42 20
      ouroperations.c
  2. 3 0
      ourpaint.h
  3. 3 1
      ourtranslations_es-ES.c
  4. 3 1
      ourtranslations_zh-hans.c

+ 42 - 20
ouroperations.c

@@ -266,7 +266,9 @@ void ourui_Brush(laUiList *uil, laPropPack *This, laPropPack *DetachedProps, laC
     laUiItem* b1=laOnConditionToggle(uil,cr,0,0,0,0,0);{ strSafeSet(&b1->ExtraInstructions,"text=☰");
         b=laBeginRow(uil,c,0,0);
         laShowItem(uil,c,This,"remove")->Flags|=LA_UI_FLAGS_ICON|LA_UI_FLAGS_NO_CONFIRM;
-        laShowItem(uil,c,This,"binding")->Expand=1;
+        laShowItem(uil,c,This,"binding")->Flags|=LA_UI_FLAGS_KNOB;
+        laUiItem* ui=laShowItem(uil,c,This,"binding");
+        ui->Flags|=LA_UI_FLAGS_PLAIN|LA_UI_FLAGS_NO_LABEL|LA_TEXT_ALIGN_LEFT;ui->Expand=1;
         laShowItem(uil,c,This,"show_in_pages")
             ->Flags|=LA_UI_FLAGS_EXPAND|LA_UI_FLAGS_CYCLE|LA_UI_FLAGS_HIGHLIGHT|LA_UI_FLAGS_TRANSPOSE|LA_UI_FLAGS_NO_CONFIRM|LA_UI_FLAGS_ICON;
         laShowItem(uil,c,This,"duplicate")->Flags|=LA_UI_FLAGS_ICON|LA_UI_FLAGS_NO_CONFIRM;
@@ -559,11 +561,18 @@ void ourui_OurPreference(laUiList *uil, laPropPack *This, laPropPack *DetachedPr
     laShowItem(uil,cl,0,"our.preferences.show_stripes");
     laShowItem(uil,cr,0,"our.preferences.canvas_default_scale");
     laShowItem(uil,cl,0,"our.preferences.show_grid");
-    laShowItem(uil,cr,0,"our.preferences.brush_numbers_on_header");
-    laShowItem(uil,cl,0,"our.preferences.multithread_write");
+    laShowItem(uil,cr,0,"our.preferences.multithread_write");
     
     laShowSeparator(uil,c);
 
+    laShowLabel(uil,c,"Shortcut Buttons:",0,0);
+    laShowItem(uil,cl,0,"our.preferences.undo_on_header");
+    laShowItem(uil,cr,0,"our.preferences.tools_on_header");
+    laShowItem(uil,cl,0,"our.preferences.mix_mode_on_header");
+    laShowItem(uil,cr,0,"our.preferences.brush_numbers_on_header");
+
+    laShowSeparator(uil,c);
+
     laShowLabel(uil,c,"Undo:",0,0);
     laShowItem(uil,c,0,"our.preferences.paint_undo_limit");
     
@@ -3061,21 +3070,25 @@ void ourui_MenuButtons(laUiList *uil, laPropPack *pp, laPropPack *actinst, laCol
 }
 void ourui_ToolExtras(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context){
     laColumn *c = laFirstColumn(uil);
-    laShowItemFull(uil,c,0,"our.tool",0,0,0,0)->Flags|=LA_UI_FLAGS_EXPAND|LA_UI_FLAGS_ICON;
+    laUiItem* b1,*b2;
+    b1=laOnConditionThat(uil,c,laPropExpression(0,"our.preferences.undo_on_header"));{
+        laShowItem(uil, c, 0, "LA_undo")->Flags|=LA_UI_FLAGS_NO_CONFIRM|LA_UI_FLAGS_ICON;
+        laShowItem(uil, c, 0, "LA_redo")->Flags|=LA_UI_FLAGS_NO_CONFIRM|LA_UI_FLAGS_ICON;
+    }laEndCondition(uil,b1);
+    b1=laOnConditionThat(uil,c,laPropExpression(0,"our.preferences.tools_on_header"));{
+        laShowItemFull(uil,c,0,"our.tool",0,0,0,0)->Flags|=LA_UI_FLAGS_EXPAND|LA_UI_FLAGS_ICON;
+    }laEndCondition(uil,b1);
+
     laUiItem* b=laOnConditionThat(uil,c,laEqual(laPropExpression(0,"our.tool"),laIntExpression(0)));{
-        laShowItemFull(uil,c,0,"our.erasing",LA_WIDGET_ENUM_HIGHLIGHT,0,0,0)->Flags|=LA_UI_FLAGS_NO_CONFIRM;
-        laUiItem* b1;
-#ifdef LAGUI_ANDROID
-        // undo seems not very responsive clicking from title bar.
-        //laShowItem(uil, c, 0, "LA_undo")->Flags|=LA_UI_FLAGS_NO_CONFIRM|LA_UI_FLAGS_ICON;
-        //laShowItem(uil, c, 0, "LA_redo")->Flags|=LA_UI_FLAGS_NO_CONFIRM|LA_UI_FLAGS_ICON;
-#else
-        b1=laOnConditionThat(uil,c,laPropExpression(0,"our.erasing"));{
-            laShowItem(uil,c,0,"our.brush_mix")->Flags|=LA_UI_FLAGS_EXPAND|LA_UI_FLAGS_ICON|LA_UI_FLAGS_DISABLED|LA_UI_FLAGS_NO_CONFIRM;
-        }laElse(uil,b1);{
-            laShowItem(uil,c,0,"our.brush_mix")->Flags|=LA_UI_FLAGS_EXPAND|LA_UI_FLAGS_ICON|LA_UI_FLAGS_NO_CONFIRM;
+        b1=laOnConditionThat(uil,c,laPropExpression(0,"our.preferences.mix_mode_on_header"));{
+            laShowItemFull(uil,c,0,"our.erasing",LA_WIDGET_ENUM_HIGHLIGHT,0,0,0)->Flags|=LA_UI_FLAGS_NO_CONFIRM;
+            b2=laOnConditionThat(uil,c,laPropExpression(0,"our.erasing"));{
+                laShowItem(uil,c,0,"our.brush_mix")->Flags|=LA_UI_FLAGS_EXPAND|LA_UI_FLAGS_ICON|LA_UI_FLAGS_DISABLED|LA_UI_FLAGS_NO_CONFIRM;
+            }laElse(uil,b2);{
+                laShowItem(uil,c,0,"our.brush_mix")->Flags|=LA_UI_FLAGS_EXPAND|LA_UI_FLAGS_ICON|LA_UI_FLAGS_NO_CONFIRM;
+            }laEndCondition(uil,b2);
         }laEndCondition(uil,b1);
-#endif
+
         b1=laOnConditionThat(uil,c,laPropExpression(0,"our.preferences.brush_numbers_on_header"));{
             laShowItem(uil,c,0,"our.preferences.brush_number")->Flags|=LA_UI_FLAGS_EXPAND;
         }laEndCondition(uil,b1);
@@ -3321,9 +3334,9 @@ void ourRegisterEverything(){
     laAddEnumItemAs(p,"ADD","Accumulate","Accumulate values",3,U'🔦');
     p=laAddEnumProperty(pc, "brush_page","Brush Page","Show brushes in pages",0,0,0,0,0,offsetof(OurPaint,BrushPage),0,ourset_BrushPage,0,0,0,0,0,0,0,0);
     laAddEnumItemAs(p,"ALL","~","Show all brushes",0,'~');
-    laAddEnumItemAs(p,"P1","1","Show brush page 1",1,'1');
-    laAddEnumItemAs(p,"P2","2","Show brush page 2",2,'2');
-    laAddEnumItemAs(p,"P3","3","Show brush page 3",3,'3');
+    laAddEnumItemAs(p,"P1","A","Show brush page A",1,'A');
+    laAddEnumItemAs(p,"P2","B","Show brush page B",2,'B');
+    laAddEnumItemAs(p,"P3","C","Show brush page C",3,'C');
     laAddEnumItemAs(p,"LIST","=","Show brushes as a list",OUR_BRUSH_PAGE_LIST,L'☰');
 
     pc=laAddPropertyContainer("our_preferences","Our Preferences","OurPaint preferences",0,0,sizeof(OurPaint),0,0,1);
@@ -3352,9 +3365,18 @@ void ourRegisterEverything(){
     p=laAddEnumProperty(pc,"spectral_mode","Spectral Brush","Use spectral mixing in brush strokes",LA_WIDGET_ENUM_HIGHLIGHT,0,0,0,0,offsetof(OurPaint,SpectralMode),0,0,0,0,0,0,0,0,0,0);
     laAddEnumItemAs(p,"NONE","None","Use regular RGB mixing for brushes",0,0);
     laAddEnumItemAs(p,"SPECTRAL","Spectral","Use spectral mixing for brushes",1,0);
-    p=laAddEnumProperty(pc,"brush_numbers_on_header","Brush Numbers On Header","Show brush numbers on header",LA_WIDGET_ENUM_HIGHLIGHT,0,0,0,0,offsetof(OurPaint,BrushNumbersOnHeader),0,0,0,0,0,0,0,0,0,0);
+    p=laAddEnumProperty(pc,"brush_numbers_on_header","Brush Numbers","Show brush numbers on header",LA_WIDGET_ENUM_HIGHLIGHT,0,0,0,0,offsetof(OurPaint,BrushNumbersOnHeader),0,0,0,0,0,0,0,0,0,0);
     laAddEnumItemAs(p,"NONE","None","Hide brush numbers on header",0,0);
     laAddEnumItemAs(p,"SHOWN","Shown","Show brush numbers on header",1,0);
+    p=laAddEnumProperty(pc,"mix_mode_on_header","Mix Modes","Show mix modes on header",LA_WIDGET_ENUM_HIGHLIGHT,0,0,0,0,offsetof(OurPaint,MixModeOnHeader),0,0,0,0,0,0,0,0,0,0);
+    laAddEnumItemAs(p,"NONE","None","Hide mix modes on header",0,0);
+    laAddEnumItemAs(p,"SHOWN","Shown","Show mix modes on header",1,0);
+    p=laAddEnumProperty(pc,"tools_on_header","Tools","Show tool selector on header",LA_WIDGET_ENUM_HIGHLIGHT,0,0,0,0,offsetof(OurPaint,ToolsOnHeader),0,0,0,0,0,0,0,0,0,0);
+    laAddEnumItemAs(p,"NONE","None","Hide tool selector on header",0,0);
+    laAddEnumItemAs(p,"SHOWN","Shown","Show tool selector on header",1,0);
+    p=laAddEnumProperty(pc,"undo_on_header","Undo","Show undo buttons on header",LA_WIDGET_ENUM_HIGHLIGHT,0,0,0,0,offsetof(OurPaint,UndoOnHeader),0,0,0,0,0,0,0,0,0,0);
+    laAddEnumItemAs(p,"NONE","None","Hide undo buttons on header",0,0);
+    laAddEnumItemAs(p,"SHOWN","Shown","Show undo buttons on header",1,0);
     laAddFloatProperty(pc,"smoothness","Smoothness","Smoothness of global brush input",0,0, 0,1,0,0.05,0,0,offsetof(OurPaint,Smoothness),0,0,0,0,0,0,0,0,0,0,0);
     laAddFloatProperty(pc,"hardness","Strength","Pressure strength of global brush input",0,0, 0,1,-1,0.05,0,0,offsetof(OurPaint,Hardness),0,0,0,0,0,0,0,0,0,0,0);
     p=laAddEnumProperty(pc,"show_stripes","Ref Stripes","Whether to show visual reference stripes",LA_WIDGET_ENUM_HIGHLIGHT,0,0,0,0,offsetof(OurPaint,ShowStripes),0,ourset_ShowStripes,0,0,0,0,0,0,0,0);

+ 3 - 0
ourpaint.h

@@ -425,6 +425,9 @@ STRUCTURE(OurPaint){
     int PaintUndoLimit;
     int SpectralMode;
     int BrushNumbersOnHeader;
+    int MixModeOnHeader;
+    int ToolsOnHeader;
+    int UndoOnHeader;
     int SketchMode;
     int SegmentedWrite;
 

+ 3 - 1
ourtranslations_es-ES.c

@@ -28,6 +28,8 @@ extern tnsMain* T;
 extern OurPaint *Our;
 
 static const char *entries[]={
+"Shortcut Buttons:","Botones de acceso directo:",
+"Mix Modes","Modos de mezcla",
 "Show brush direction:","Mostrar la dirección del pincel:",
 "Not registered","No registrado",
 "Registered","Registrado",
@@ -37,7 +39,7 @@ static const char *entries[]={
 "Brush Size","Tamaño de Pincel",
 "Brush Base Size","Tamaño de Base de Pincel",
 "Size Offset","Desviación de Tamaño",
-"Brush Numbers On Header","Números de Pincel en Encabezado",
+"Brush Numbers","Números de Pincel",
 "Nodes Help","Ayuda de Nodos",
 "Full","Completo",
 "Ref Grids","Malla de Referencia",

+ 3 - 1
ourtranslations_zh-hans.c

@@ -23,6 +23,8 @@ extern tnsMain* T;
 extern OurPaint *Our;
 
 static const char *entries[]={
+"Shortcut Buttons:","快捷按钮:",
+"Mix Modes","混合模式",
 "Show brush direction:","显示笔刷方向:",
 "Linear D65 P3","线性 D65 P3",
 "Auto","自动",
@@ -38,7 +40,7 @@ static const char *entries[]={
 "Brush Size","笔刷尺寸",
 "Brush Base Size","笔刷基础尺寸",
 "Size Offset","尺寸偏移",
-"Brush Numbers On Header","在菜单显示笔刷号",
+"Brush Numbers","笔刷号",
 "Nodes Help","节点帮助",
 "Full","全",
 "Ref Grids","参考网格",