0

I have a basic layout in EDC:

group { "sample";
  parts {
     text { "text0";
        desc { "default";
           rel1.relative: 0 0;
           rel2.relative: 1 0.5;
           color: 255 0 0 255;
           text {
              text: "Title";
              font: "Tizen:style=Regular";
              size: 30;;
              align: 0.5 1;
           }
        }
     }
     text { "text1";
        desc { "default";
           rel1.relative: 0 0.5;
           rel2.relative: 1 1;
           color: 255 0 255 255;
           text {
              text: "SubTitle";
              font: "Tizen:style=Regular";
              size: 14;
              align: 0.5 0;
           }
        }
     }         
  }
}

This is working as intended:

enter image description here

However I want to position those two texts in the vertical middle:

enter image description here

I draw two green lines, the texts shall be positioned in between them (vertically).

How can I achieve this with EDC?

Extra info: I need those two texts, one is not enough.

Daniel
  • 2,318
  • 2
  • 22
  • 53
  • Creating another group with a *SWALLOW* part can work but seems a bit waste of memory and resources. – Daniel Jan 08 '21 at 06:20

1 Answers1

1

EDC image

Do you want this? please refer below.

collections {
   group { "sample";
      parts {
         spacer { "base";
            desc { "default";
               min: 400 120;
               max: 400 120;
            }
         }
         rect { "bg";
            desc { "default";
               rel.to: "base";
               color: 255 255 255 255;
            }
         }
         text { "text0";
            desc { "default";
               rel1.to: "rect0";
               rel2.to_x: "rect0";
               rel2.to_y: "rect_middle";
               rel1.relative: 0.5 1;
               rel2.relative: 0.5 0;
               align: 0.5 0.5;
               color: 255 0 0 255;
               text {
                  text: "Title";
                  font: "Tizen:style=Regular";
                  size: 30;;
                  align: 0.5 1;
                  min: 1 1;
               }
            }
         }
         text { "text1";
            desc { "default";
               rel1.to_x: "rect1";
               rel1.to_y: "rect_middle";
               rel2.to: "rect1";
               rel1.relative: 0.5 1;
               rel2.relative: 0.5 0;
               align: 0.5 0.5;
               color: 255 0 255 255;
               text {
                  text: "SubTitle";
                  font: "Tizen:style=Regular";
                  size: 14;
                  align: 0.5 0;
                  min: 1 1;
               }
            }
         }
         rect { "rect_middle";
            desc { "default";
               color: 0 0 255 255;
               rel.to: "base";
               align: 0.5 0.5;
               min: 0 2;
               max: -1 2;
            }
         }   
         rect { "rect0";
            desc { "default";
               color: 0 255 0 255;
               rel.to: "base";
               align: 0.4 0;
               min: 2 30;
               max: 2 30;
            }
         }
         rect { "rect1";
            desc { "default";
               color: 0 255 0 255;
               rel.to: "base";
               align: 0.4 1;
               min: 2 30;
               max: 2 30;
            }
         }
      }
   }
}
  • Actually, those two green lines are not needed within the EDC, they are just showing where should be the texts positioned. Your solution does not seem perfect, for me it seems the two texts are a bit mispositioned. – Daniel Jan 11 '21 at 15:00
  • https://imgur.com/a/nLLgd5z: there 2 pixels top and 11 pixels bottom difference between the text and the rects. If you see it from a distance it will feel not aligned center vertically - thank you anyway! (I know there can be letters like 'y' which will go downwards, but not 11px for sure) – Daniel Jan 11 '21 at 15:03