*/}}
Browse Source

Various theme and layout fixes

YimingWu 1 year ago
parent
commit
2a09f425e0
5 changed files with 82 additions and 67 deletions
  1. 2 2
      la_interface.h
  2. 46 31
      la_kernel.c
  3. 28 28
      la_resource.c
  4. 4 4
      resources/la_properties.c
  5. 2 2
      resources/la_templates.c

+ 2 - 2
la_interface.h

@@ -720,8 +720,8 @@ STRUCTURE(laBoxedTheme){
 
     int TextAlign;
 
-    real Margins[4]; 
-    real Paddings[4];
+    int Margins[4]; 
+    int Paddings[4];
 
     //Don't change order
     int LM, RM, TM, BM; 

+ 46 - 31
la_kernel.c

@@ -860,7 +860,7 @@ int laGetReadyWith(int GLMajor, int GLMinor, int BufferSamples){
     MAIN.InkOrWinTab = 1; /* Default use wacom wintab input. */
 
     //display:
-    MAIN.FloatingAlpha = 0.7;
+    MAIN.FloatingAlpha = 0.35;
     MAIN.SolidShadowLength = 20;
     MAIN.WireColorSlices = 16;
     MAIN.WireThickness = 5;
@@ -1360,8 +1360,8 @@ void la_RefreshBoxedThemeColor(laBoxedTheme* bt){
     hcy[2]=bt->TextActiveY; tnsHCY2RGB(hcy, bt->TextActive); bt->TextActive[3]=1;
     int *tm=&bt->LM,*tp=&bt->LP;
     for(int i=0;i<4;i++){
-        tm[i]=bt->Margins[i]*LA_RH*MAIN.MarginSize;
-        tp[i]=bt->Paddings[i]*LA_RH*MAIN.MarginSize;
+        tm[i]=(real)bt->Margins[i]*LA_RH*MAIN.MarginSize/10+0.5;
+        tp[i]=(real)bt->Paddings[i]*LA_RH*MAIN.MarginSize/10+0.5;
     }
 }
 void la_RefreshThemeColorSelf(laTheme* th){
@@ -1781,12 +1781,13 @@ void la_PanelDefDraw(laWindow *w, laPanel *p, laBoxedTheme *bt){
             laRecalcPanelImmediate(p);
         }
         if (!p->MenuRefer){
-            if(!p->OffScr){la_PanelDrawToOffsceen(p,&p->UI); p->Refresh|=LA_TAG_REDRAW; laRefreshWindow(); }
+            if(!p->OffScr){ la_PanelDrawToOffsceen(p,&p->UI); p->Refresh|=LA_TAG_REDRAW; laRefreshWindow(); }
             if (p->Refresh || !p->OffScr){
                 la_PanelDrawToOffsceen(p, &p->UI);
                 la_SetupUiListLimitMatrix(&uild, 0, p->W, 0, p->H, p->H);
                 la_PanelBackgroundInit(p, bt);
-                la_DrawUiListScrollerV(&p->UI, p->UI.PanY, p->UI.B-p->UI.U-bt->TM-bt->BM, p->H-p->TitleBar.B-bt->TM-bt->BM*2, p->W);
+                int extrap=(p->Mode && (!p->IsMenuPanel))?p->TitleBar.B:0;
+                la_DrawUiListScrollerV(&p->UI, p->UI.PanY, p->UI.B-p->UI.U, p->H-bt->BM-bt->TM-extrap, p->W);
                 tnsFlush();
 
                 if(((p->UI.B>p->H) && (!p->UI.ScrollerShownV))||
@@ -3217,8 +3218,9 @@ void laRecalcPanelImmediate(laPanel* p){
     if(!enclosed){
         la_PanelValidateWidth(p,&p->UI);
         //laEnsurePanelInBound(p,&p->UI);
-        la_UpdateUiListRecursive(&p->TitleBar, bt->TM, bt->LM, p->TW-bt->RM, p->TH-bt->TM-bt->BM, 0, p);
-        la_UpdateUiListRecursive(&p->UI, bt->TM+p->TitleBar.TB, bt->LM, p->TW-bt->RM-scrollw, p->TH-bt->TM-bt->BM, 0, p);
+        la_UpdateUiListRecursive(&p->TitleBar, bt->TM, bt->LM, p->TW-bt->RM, p->TH-bt->BM, 0, p);
+        int UseB=p->TitleBar.TB; if((!p->Mode)||(p->Mode==LA_PANEL_FLOATING_PASSIVE)){ UseB=0; }
+        la_UpdateUiListRecursive(&p->UI, UseB+bt->TM, bt->LM, p->TW-bt->RM-scrollw, p->TH-bt->BM, 0, p);
     }
     laWindow* w=MAIN.CurrentWindow;
     if(w->MaximizedUiPanel==p&&w->MaximizedUi){ int CW = w->CW; int CH = w->CH;
@@ -4668,7 +4670,7 @@ STRUCTURE(laRowNode){
 };
 int la_InitRowNode(laRowInfo* ri, laUiItem* ui, laBoxedTheme* bt){
     ri->MaxW = ui->TR-ui->TL;//row node does not use margin
-    ri->UnitMinW=LA_RH+bt->LM+bt->RM;
+    ri->UnitMinW=LA_RH;
     ri->Expand=ui->State?1:0;
     ri->Even=ui->Flags?1:0;
     ri->U=ui->TU; ri->L=ui->TL;
@@ -4677,14 +4679,14 @@ int la_InitRowNode(laRowInfo* ri, laUiItem* ui, laBoxedTheme* bt){
 void la_AddRowNode(laRowInfo* ri, laUiItem* ui, laBoxedTheme* bt, int H){
     laRowNode* rn=CreateNew(laRowNode);
     rn->LP=bt->LP;rn->RP=bt->RP;
-    rn->GotW = (ui->Type->GetMinWidth?ui->Type->GetMinWidth(ui):(LA_RH)) ;
+    rn->GotW = (ui->Type->GetMinWidth?ui->Type->GetMinWidth(ui):(LA_RH));
     rn->ui=ui;
     rn->H=H;
     rn->Expand=ui->Expand;
     lstAppendItem(&ri->Elements, rn);
 
-    if(!ri->UnitMinW){ri->UnitMinW=LA_RH+bt->LM+bt->RM;}
-    ri->TotalPadding += bt->LP+bt->RP;
+    if(!ri->UnitMinW){ri->UnitMinW=LA_RH;}
+    ri->TotalPadding += (bt->LP+bt->RP);
     ri->MinW+=ri->UnitMinW;
     ri->NonExpandW+=rn->GotW;
     ri->ExpandAccum+=ui->Expand;
@@ -5275,12 +5277,12 @@ void la_DrawUiListArrows(laUiList *uil, int L, int R, int U, int B, real* color)
 void la_DrawUiListScrollerV(laUiList *uil, int DisplayOffset, int TotalH, int DisplayH, int UiR){
     if(!uil->ScrollerShownV) return;
     
-    int W = LA_SCROLL_W;
+    int W = LA_SCROLL_W, RM=_LA_THEME_PANEL->RM;
     int Len = (int)((real)DisplayH / (real)TotalH * (real)DisplayH);
     int Offset = (int)((real)DisplayOffset / (real)TotalH * (real)DisplayH);
     int U = uil->U + Offset;
     int B = U + Len;
-    int L = UiR - _LA_THEME_PANEL->RM - W;
+    int L = UiR - RM*2 - W;
     int R = L + W;
 
     if (B > U + DisplayH) B = U + DisplayH;
@@ -5295,32 +5297,39 @@ void la_DrawUiListScrollerV(laUiList *uil, int DisplayOffset, int TotalH, int Di
 
     laBoxedTheme* bt=_LA_THEME_PANEL;
     real* color=laThemeColor(bt, LA_BT_TEXT);
-    tnsColor4d(LA_COLOR3(color), 0.8);
+
+    tnsColor4d(LA_COLOR3(color), 0.2);
+    tnsVertex2d(R-RM, uil->U);
+    tnsVertex2d(L+RM, uil->U);
+    tnsVertex2d(L+RM, uil->U + DisplayH);
+    tnsVertex2d(R-RM, uil->U + DisplayH);
+    tnsPackAs(GL_TRIANGLE_FAN);
+    tnsColor4d(LA_COLOR3(color), 0.5);
+    tnsVertex2d(R-RM, uil->U);
+    tnsVertex2d(L+RM, uil->U);
+    tnsVertex2d(L+RM, uil->U + DisplayH);
+    tnsVertex2d(R-RM, uil->U + DisplayH);
+    tnsPackAs(GL_LINE_LOOP);
+
+    tnsColor4d(LA_COLOR3(color), 1);
     tnsVertex2d(R, U);
     tnsVertex2d(L, U);
     tnsVertex2d(L, B);
     tnsVertex2d(R, B);
     tnsPackAs(GL_TRIANGLE_FAN);
 
-    tnsColor4d(LA_COLOR3(color), 0.8);
-    tnsVertex2d(R, uil->U);
-    tnsVertex2d(L, uil->U);
-    tnsVertex2d(L, uil->U + DisplayH);
-    tnsVertex2d(R, uil->U + DisplayH);
-    tnsPackAs(GL_LINE_LOOP);
-
     int HU=(U+B)/2+LA_RH2;
     tnsDrawStringAuto("☰",laThemeColor(bt, LA_BT_BORDER),L-100,R+100,HU,LA_TEXT_REVERT_Y|LA_TEXT_ALIGN_CENTER);
 }
 void la_DrawUiListScrollerH(laUiList *uil, int DisplayOffset, int TotalW, int DisplayW, int UiB){
     if(!uil->ScrollerShownH) return;
     
-    int W = LA_SCROLL_W;
+    int W = LA_SCROLL_W,RM=_LA_THEME_PANEL->RM;
     int Len = (int)((real)DisplayW / (real)TotalW * (real)DisplayW);
     int Offset = (int)((real)DisplayOffset / (real)TotalW * (real)DisplayW);
     int L = uil->L + Offset;
     int R = L + Len;
-    int U = UiB - _LA_THEME_PANEL->RM - W;
+    int U = UiB - RM - W;
     int B = U + W;
 
     if (B > U + DisplayW) B = U + DisplayW;
@@ -5335,20 +5344,26 @@ void la_DrawUiListScrollerH(laUiList *uil, int DisplayOffset, int TotalW, int Di
 
     laBoxedTheme* bt=_LA_THEME_PANEL;
     real* color=laThemeColor(bt, LA_BT_TEXT);
-    tnsColor4d(LA_COLOR3(color), 0.8);
+    tnsColor4d(LA_COLOR3(color), 0.2);
+    tnsVertex2d(uil->L,U+RM);
+    tnsVertex2d(uil->L,B-RM);
+    tnsVertex2d(uil->L + DisplayW,B-RM);
+    tnsVertex2d(uil->L + DisplayW,U+RM);
+    tnsPackAs(GL_TRIANGLE_FAN);
+    tnsColor4d(LA_COLOR3(color), 0.5);
+    tnsVertex2d(uil->L,U+RM);
+    tnsVertex2d(uil->L,B-RM);
+    tnsVertex2d(uil->L + DisplayW,B-RM);
+    tnsVertex2d(uil->L + DisplayW,U+RM);
+    tnsPackAs(GL_LINE_LOOP);
+
+    tnsColor4d(LA_COLOR3(color), 1);
     tnsVertex2d(R, U);
     tnsVertex2d(L, U);
     tnsVertex2d(L, B);
     tnsVertex2d(R, B);
     tnsPackAs(GL_TRIANGLE_FAN);
 
-    tnsColor4d(LA_COLOR3(color), 0.8);
-    tnsVertex2d(uil->L,U);
-    tnsVertex2d(uil->L,B);
-    tnsVertex2d(uil->L + DisplayW,B);
-    tnsVertex2d(uil->L + DisplayW,U);
-    tnsPackAs(GL_LINE_LOOP);
-
     int HU=(U+B)/2+LA_RH2;
     tnsDrawStringAuto("↔",laThemeColor(bt, LA_BT_BORDER),L-100,R+100,HU,LA_TEXT_REVERT_Y|LA_TEXT_ALIGN_CENTER);
 }

+ 28 - 28
la_resource.c

@@ -147,33 +147,33 @@ void la_RegisterMainThemes(){
         t->EdgeBrightness=0.65; t->EdgeTransparency=0.8; t->VertexBrightness=0.65, t->VertexTransparency=0.9;
         t->SelectedFaceTransparency=0.6,t->SelectedEdgeTransparency=0.9, t->SelectedVertexTransparency=1.0;
         laDesignBoxedTheme(t, "Panel",&_LA_THEME_PANEL,
-            0.85, 0.5, 0.2, 0.15, 0.1, 0.9, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11);
+            0.85, 0.5, 0.9, 0.2, 0.1, 0.9, 1, 1, 1, 1, 1, 1, 1, 1);
         laDesignBoxedTheme(t, "Floating Panel",&_LA_THEME_FLOATING_PANEL,
-            0.95, 0.8, 0.1, 0.15, 0.1, 0.9, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11);
+            0.95, 0.8, 0.15, 0.15, 0.1, 0.9, 1, 1, 1, 1, 1, 1, 1, 1);
         laDesignBoxedTheme(t, "Valuator",&_LA_THEME_VALUATOR,
-            0.8, 0.5, 0.3, 0.2, 0.1, 0.9, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11);
+            0.8, 0.5, 0.3, 0.2, 0.1, 0.9, 1, 1, 1, 1, 1, 1, 1, 1);
         laDesignBoxedTheme(t, "Button",&_LA_THEME_BUTTON,
-            0.97, 0.2, 0.3, 0.2, 0.9, 0.95, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11);
+            0.97, 0.2, 0.3, 0.2, 0.9, 0.95, 1, 1, 1, 1, 1, 1, 1, 1);
         laDesignBoxedTheme(t, "String",&_LA_THEME_STRING,
-            0.9, 0.95, 0.3, 0.2, 0.1, 0.95, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11);
+            0.9, 0.95, 0.3, 0.2, 0.1, 0.95, 1, 1, 1, 1, 1, 1, 1, 1);
         laDesignBoxedTheme(t, "Selector",&_LA_THEME_SELECTOR,
-            0.85, 0.7, 0.3, 0.2, 0.1, 0.95, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11);
+            0.97, 0.25, 0.3, 0.2, 0.9, 0.95, 1, 1, 1, 1, 1, 1, 1, 1);
         laDesignBoxedTheme(t, "Collection Selector",&_LA_THEME_COLLECTION_SELECTOR,
-            0.85, 0.7, 0.3, 0.2, 0.1, 0.95, -0.11, 1, -0.11, -0.11, 0.11, 0.11, 0.11, 0.11);
+            0.85, 0.7, 0.3, 0.2, 0.1, 0.95, 0, 0, -1, -1, 1, 1, 1, 1);
         laDesignBoxedTheme(t, "Label",&_LA_THEME_LABEL,
-            0.7, 0.8, 0.3, 0.1, 0.05, 0.95, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11);
+            0.7, 0.8, 0.3, 0.1, 0.05, 0.95, 1, 1, 1, 1, 1, 1, 1, 1);
         laDesignBoxedTheme(t, "Tab",&_LA_THEME_TAB,
-            0.9, 0.8, 0.2, 0.1, 0.7, 0.9, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11);
+            0.9, 0.8, 0.2, 0.1, 0.7, 0.9, 1, 1, 1, 1, 1, 1, 1, 1);
         laDesignBoxedTheme(t, "Socket",&_LA_THEME_SOCKET,
-            0.97, 0.2, 0.3, 0.2, 0.9, 0.95, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11);
+            0.97, 0.2, 0.3, 0.2, 0.9, 0.95, 1, 1, 1, 1, 1, 1, 1, 1);
         laDesignBoxedTheme(t, "Collection Group",&_LA_THEME_COLLECTION_GROUP,
-            0.75, 0.65, 0.2, 0.1, 0.7, 0.3, 0.11, 0.11, 0, 0, 0.11, 0.11, 0.11, 0.11);
+            0.75, 0.65, 0.2, 0.1, 0.7, 0.3, 1, 1, 0, 0, 1, 1, 1, 1);
         laDesignBoxedTheme(t, "Collection Item",&_LA_THEME_COLLECTION_ITEM,
-            0.75, 0.65, 0.2, 0.1, 0.7, 0.3, 0.11, 0.11, 0, 0, 0.11, 0.11, 0.11, 0.11);
+            0.75, 0.65, 0.2, 0.1, 0.7, 0.3, 1, 1, 0, 0, 1, 1, 1, 1);
         laDesignBoxedTheme(t, "3D Viewer",&_LA_THEME_3D_VIEW,
-            0.75, 0.65, 0.2, 0.1, 0.7, 0.3, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11);
+            0.75, 0.65, 0.2, 0.1, 0.7, 0.3, 1, 1, 1, 1, 1, 1, 1, 1);
         laDesignBoxedTheme(t, "2D Viewer",&_LA_THEME_2D_VIEW,
-            0.75, 0.65, 0.2, 0.1, 0.7, 0.3, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11);
+            0.75, 0.65, 0.2, 0.1, 0.7, 0.3, 1, 1, 1, 1, 1, 1, 1, 1);
 
         la_RefreshThemeColor(t);
     }
@@ -189,36 +189,36 @@ void la_RegisterMainThemes(){
         t->EdgeBrightness=0.05; t->EdgeTransparency=0.8; t->VertexBrightness=0.05, t->VertexTransparency=0.9;
         t->SelectedFaceTransparency=0.6,t->SelectedEdgeTransparency=0.9, t->SelectedVertexTransparency=1.0;
         bt = laDesignBoxedTheme(t, "Panel",&_LA_THEME_PANEL,
-            0.2, 0.2, 0.1, 0.8, 0.9, 0.8, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11);
+            0.2, 0.2, 0.1, 0.7, 0.9, 0.8, 1, 1, 1, 1, 1, 1, 1, 1);
             memAssignRef(bt, &bt->Parent, t1);
         bt = laDesignBoxedTheme(t, "Floating Panel",&_LA_THEME_FLOATING_PANEL,
-            0.05, 0.05, 0.4, 0.8, 0.9, 0.8, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11);
+            0.05, 0.05, 0.4, 0.8, 0.9, 0.8, 1, 1, 1, 1, 1, 1, 1, 1);
             memAssignRef(bt, &bt->Parent, t1);
         bt = laDesignBoxedTheme(t, "Valuator",&_LA_THEME_VALUATOR,
-            0.3, 0.1, 0.4, 0.8, 0.9, 0.9, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11);
+            0.3, 0.1, 0.4, 0.8, 0.9, 0.9, 1, 1, 1, 1, 1, 1, 1, 1);
             memAssignRef(bt, &bt->Parent, t1);
         bt = laDesignBoxedTheme(t, "Button",&_LA_THEME_BUTTON,
-            0.1, 0.9, 0.3, 0.8, 0.1, 0.95, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11);
+            0.1, 0.9, 0.3, 0.8, 0.1, 0.95, 1, 1, 1, 1, 1, 1, 1, 1);
         bt = laDesignBoxedTheme(t, "String",&_LA_THEME_STRING,
-            0.1, 0.03, 0.3, 0.8, 0.9, 0.95, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11);
+            0.1, 0.03, 0.3, 0.8, 0.9, 0.95, 1, 1, 1, 1, 1, 1, 1, 1);
         bt = laDesignBoxedTheme(t, "Selector",&_LA_THEME_SELECTOR,
-            0.15, 0.7, 0.3, 0.8, 0.2, 0.95, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11);
+            0.15, 0.7, 0.3, 0.8, 0.2, 0.95, 1, 1, 1, 1, 1, 1, 1, 1);
         bt = laDesignBoxedTheme(t, "Collection Selector",&_LA_THEME_COLLECTION_SELECTOR,
-            0.15, 0.1, 0.3, 0.8, 0.9, 0.95, -0.11, 1, -0.11, -0.11, 0.11, 0.11, 0.11, 0.11);
+            0.15, 0.1, 0.3, 0.8, 0.9, 0.95, 0, 0, -1, -1, 1, 1, 1, 1);
         bt = laDesignBoxedTheme(t, "Label",&_LA_THEME_LABEL,
-            0.15, 0.1, 0.3, 0.8, 0.9, 0.95, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11);
+            0.15, 0.1, 0.3, 0.8, 0.9, 0.95, 1, 1, 1, 1, 1, 1, 1, 1);
         bt = laDesignBoxedTheme(t, "Tab",&_LA_THEME_TAB,
-            0.2, 0.3, 0.8, 0.7, 0.1, 0.9, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11);
+            0.2, 0.3, 0.8, 0.7, 0.1, 0.9, 1, 1, 1, 1, 1, 1, 1, 1);
         bt = laDesignBoxedTheme(t, "Socket",&_LA_THEME_SOCKET,
-            0.1, 0.65, 0.7, 0.8, 0.1, 0.95, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11);
+            0.1, 0.65, 0.7, 0.8, 0.1, 0.95, 1, 1, 1, 1, 1, 1, 1, 1);
         bt = laDesignBoxedTheme(t, "Collection Group",&_LA_THEME_COLLECTION_GROUP,
-            0.25, 0.35, 0.8, 0.7, 0.1, 0.3, 0.11, 0.11, 0, 0, 0.11, 0.11, 0.11, 0.11);
+            0.25, 0.35, 0.8, 0.7, 0.1, 0.3, 1, 1, 0, 0, 1, 1, 1, 1);
         bt = laDesignBoxedTheme(t, "Collection Item",&_LA_THEME_COLLECTION_ITEM,
-            0.25, 0.35, 0.8, 0.7, 0.1, 0.3, 0.11, 0.11, 0, 0, 0.11, 0.11, 0.11, 0.11);
+            0.25, 0.35, 0.8, 0.7, 0.1, 0.3, 1, 1, 0, 0, 1, 1, 1, 1);
         bt = laDesignBoxedTheme(t, "3D Viewer",&_LA_THEME_3D_VIEW,
-            0.25, 0.35, 0.8, 0.7, 0.1, 0.3, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11);
+            0.25, 0.35, 0.8, 0.7, 0.1, 0.3, 1, 1, 1, 1, 1, 1, 1, 1);
         bt = laDesignBoxedTheme(t, "2D Viewer",&_LA_THEME_2D_VIEW,
-            0.25, 0.35, 0.8, 0.7, 0.1, 0.3, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11);
+            0.25, 0.35, 0.8, 0.7, 0.1, 0.3, 1, 1, 1, 1, 1, 1, 1, 1);
 
         la_RefreshThemeColor(t);
     }

+ 4 - 4
resources/la_properties.c

@@ -97,12 +97,12 @@ void laset_ThemeAlpha(laBoxedTheme* bt, real val){
     la_RefreshBoxedThemeColor(bt);
     laRedrawAllWindows();
 }
-void laset_ThemeMargins(laBoxedTheme* bt, int index, real val){
+void laset_ThemeMargins(laBoxedTheme* bt, int index, int val){
     bt->Margins[index]=val;
     la_RefreshBoxedThemeColor(bt);
     laRedrawAllWindows();
 }
-void laset_ThemePaddings(laBoxedTheme* bt, int index, real val){
+void laset_ThemePaddings(laBoxedTheme* bt, int index, int val){
     bt->Paddings[index]=val;
     la_RefreshBoxedThemeColor(bt);
     laRedrawAllWindows();
@@ -923,8 +923,8 @@ void la_RegisterInternalProps(){
 
             p = laAddPropertyContainer("boxed_theme", "Boxed Theme", "A Single Theme Item For One Or Multiple Kinds Of UiItems", 0,laui_BoxedThemeItem, sizeof(laBoxedTheme), 0,0,1);{
                 laAddStringProperty(p, "name", "Name", "Boxed Theme Name", 0,0,0,0,1, offsetof(laBoxedTheme, Name), 0,0,0,0,LA_AS_IDENTIFIER);
-                laAddFloatProperty(p, "margins", "Margins", "Margins On Four Sides", 0,"Left,Right,Top,Bottom", 0,1, -1, 0.05, 1, 0,offsetof(laBoxedTheme, Margins), 0,0,4, 0,laset_ThemeMargins, 0,0,0,0,0,0);
-                laAddFloatProperty(p, "paddings", "Paddings", "Paddings On Four Sides", 0,"Left,Right,Top,Bottom", 0,1, -1, 0.05, 1, 0,offsetof(laBoxedTheme, Paddings), 0,0,4, 0,laset_ThemePaddings, 0,0,0,0,0,0);
+                laAddIntProperty(p, "margins", "Margins", "Margins On Four Sides", 0,"Left,Right,Top,Bottom", 0, 10, -2, 1, 1, 0,offsetof(laBoxedTheme, Margins), 0,0,4, 0,laset_ThemeMargins, 0,0,0,0,0,0);
+                laAddIntProperty(p, "paddings", "Paddings", "Paddings On Four Sides", 0,"Left,Right,Top,Bottom", 0,10, -2, 1, 1, 0,offsetof(laBoxedTheme, Paddings), 0,0,4, 0,laset_ThemePaddings, 0,0,0,0,0,0);
                 laAddFloatProperty(p, "normal", "Normal", "Background brightness", 0,0,0,1, 0,0.025, 1, 0,offsetof(laBoxedTheme, NormalY), 0,laset_ThemeNormal, 0,0,0,0,0,0,0,0,0);
                 laAddFloatProperty(p, "active", "Active", "Background brightness in active state", 0,0,0,1, 0,0.025, 1, 0,offsetof(laBoxedTheme, ActiveY), 0,laset_ThemeActive, 0,0,0,0,0,0,0,0,0);
                 laAddFloatProperty(p, "border", "Border", "Border brightness", 0,0,0,1, 0,0.025, 1, 0,offsetof(laBoxedTheme, BorderY), 0,laset_ThemeBorder, 0,0,0,0,0,0,0,0,0);

+ 2 - 2
resources/la_templates.c

@@ -649,7 +649,7 @@ void laui_Theme(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColu
     laShowItem(uil, col, Base, "sface_transparency");    
 
     laShowLabel(uil, col, "Widgets:",0,0);
-    laShowItem(uil, col, Base, "boxed_themes");
+    laShowItem(uil, col, Base, "boxed_themes")->Flags|=(LA_UI_FLAGS_NO_DECAL|LA_UI_FLAGS_NO_GAP);
 }
 void laui_BoxedThemeItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
     laColumn *col, *cl, *cr, *crl,*crr;
@@ -1363,7 +1363,7 @@ void laui_UserPreference(laUiList *uil, laPropPack *Base, laPropPack *OperatorIn
 
             laShowLabel(muil, mc, "Active Theme", 0, 0);
             laShowItemFull(muil, mc, 0, "la.themes", LA_WIDGET_COLLECTION_SELECTOR, 0,laui_ThemeListItem,0);
-            laShowItemFull(muil, mc, 0, "la.themes", LA_WIDGET_COLLECTION_SINGLE, 0 ,0,0);
+            laShowItemFull(muil, mc, 0, "la.themes", LA_WIDGET_COLLECTION_SINGLE, 0 ,0,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
         }
     }
 }