epics-containers / pvi

EPICS PV Interface described in YAML
https://epics-containers.github.io/pvi
Apache License 2.0
4 stars 3 forks source link

Use 15 point font for bob widget type=group, and 5 pixel grid #135

Open coretl opened 3 months ago

coretl commented 3 months ago

Grid snapping in the phoebus editor is to the global co-ordinates. If you make a group box it applies a local offset to this that is proportional to the font size, but snapping continues on the global co-ordinates. The current offset with size 14 font is 18 pixels, which is not a multiple of 5 which is our widget spacing distance. If we increase the group box font to 15, then it is 20 pixels which is.

I suggest we add this to widget group box:

  <widget type="group" version="3.0.0">
    ...
    <font>
      <font family="Liberation Sans" style="REGULAR" size="15.0">
      </font>
    </font>

and set the top level display grid to 5 pixels to match:

<display version="2.0.0">
  ...
  <grid_step_x>5</grid_step_x>
  <grid_step_y>5</grid_step_y>

Acceptance Criteria

GDYendell commented 1 month ago

Are you expecting that with this change we can enable grid snapping and then drag a widget out of the generated position and then back again and the position is the same? That doesn't seem to be the case for grid size 5 and text size 15. The position changes slightly:

-    </widget>
-    <widget type="label" version="2.0.0">
-      <name>Label</name>
-      <text>Image File Tmot</text>
-      <x>0</x>
-      <y>48</y>
-      <width>120</width>
-      <height>20</height>
-      <tooltip>$(text)</tooltip>
-    </widget>
-    <widget type="textentry" version="3.0.0">
-      <name>TextEntry</name>
-      <pv_name>$(P)$(R)ImageFileTmot</pv_name>
-      <x>124</x>
-      <y>48</y>
-      <width>124</width>
-      <height>20</height>
-      <horizontal_alignment>1</horizontal_alignment>
...
+    <widget type="label" version="2.0.0">
+      <name>Label</name>
+      <text>Image File Tmot</text>
+      <x>1</x>
+      <y>50</y>
+      <width>120</width>
+      <tooltip>$(text)</tooltip>
+    </widget>
+    <widget type="textentry" version="3.0.0">
+      <name>TextEntry</name>
+      <pv_name>$(P)$(R)ImageFileTmot</pv_name>
+      <x>126</x>
+      <y>50</y>
+      <width>124</width>
coretl commented 1 month ago

Are you expecting that with this change we can enable grid snapping and then drag a widget out of the generated position and then back again and the position is the same? That doesn't seem to be the case for grid size 5 and text size 15. The position changes slightly:

Oh dear, that is not expected. @diamondRC is this working for you with size 15 font? Please could you demo to Gary if so?