Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
coretl opened this issue Aug 21, 2024 · 2 comments
Open

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

coretl opened this issue Aug 21, 2024 · 2 comments

Comments

@coretl
Copy link
Contributor

coretl commented Aug 21, 2024

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

  • Snap to grid works on widgets within a group box
@GDYendell GDYendell changed the title Use 15 point fornt for bob widget type=group, and 5 pixel grid Use 15 point font for bob widget type=group, and 5 pixel grid Sep 26, 2024
@GDYendell
Copy link
Member

GDYendell commented Oct 16, 2024

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
Copy link
Contributor Author

coretl commented Oct 16, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants