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

OMEdit Text visualisation glitch #8383

Closed
max-privato opened this issue Jan 7, 2022 · 8 comments · Fixed by #11610
Closed

OMEdit Text visualisation glitch #8383

max-privato opened this issue Jan 7, 2022 · 8 comments · Fixed by #11610
Assignees
Labels
COMP/GUI/OMEdit Issue and pull request related to OMEdit
Milestone

Comments

@max-privato
Copy link

max-privato commented Jan 7, 2022

Description

When we use a text box in diagram or icon, we can use the red squares to resize the allowable space.
Text is expected to stay inside the four red squares. In the example below (file and screenshot), it is truncated in just a fraction of the allowable space (see screenshot below)

Steps to Reproduce

Open Test.mo and select the text box in diagram view
Test.mo.txt

Expected Behavior

Text should use the space allowed by the two red squares

Screenshots

image

Version and OS

OM 1.18.0 64 bit, Win10

  • OpenModelica Version: [e.g. omc --version or Help->About OMEdit from OMEdit]
  • OS: [e.g. Windows 10, 64 bit]
  • Versions of used Modelica libraries if applicable

Additional Context

@adeas31 adeas31 added this to the UniPI DFD - September 2023 milestone Jun 16, 2023
@casella casella modified the milestones: UniPI DFD - October 2023, 1.23.0 Sep 18, 2023
@casella
Copy link
Contributor

casella commented Nov 17, 2023

@ceraolo, I'm not sure how this text box was set up originally, but if you right-click on it and select Properties, you get this dialog:

immagine

The font and text style are set to use 10 points characters and left alignment, so that's what you get. If you want the text to fill in the available space, select font size Auto (which is the default when you create a text box), and you get this result:

immagine

If you resize the box, the text will fill in all the available space, e.g.:

immagine

@casella casella closed this as completed Nov 17, 2023
@casella casella added the COMP/GUI/OMEdit Issue and pull request related to OMEdit label Nov 17, 2023
@ceraolo
Copy link

ceraolo commented Nov 18, 2023

The font and text style are set to use 10 points characters and left alignment, so that's what you get.

I don't agree. As I wrote in the ticket's description, the whole space set by the red boxes should be filled. In the case of this ticket's image, there would be plenty of room to put more 10 pt charaters, instead of having all that empty space.

@casella
Copy link
Contributor

casella commented Nov 18, 2023

No, if you have carriage return characters \n in the strings 😃

@ceraolo
Copy link

ceraolo commented Nov 19, 2023

No, if you have carriage return characters \n in the strings 😃

  1. the third row is cut even though there would be enough space and it does not contain '\n' (1st screenshot)
  2. the second row is cut even when there would be enough space to display it (2nd screenshot)
  3. the third row is missing even if where is enough vertical space (2nd screenshot)

Screenshots:
image
image

@casella
Copy link
Contributor

casella commented Nov 20, 2023

@adeas31 can you please check?

@casella casella reopened this Nov 20, 2023
@adeas31
Copy link
Member

adeas31 commented Nov 20, 2023

We try to find the elided text and it is not possible to do it for multiline. The algorithm removes the \n and then tries to find the elide text on the whole string. Based on this what you get is the correct behavior.

I think we should not try to find the elided text if the string is multiline and font size is fixed.

@ceraolo
Copy link

ceraolo commented Nov 20, 2023

good solution.
I personally use frequently multiline text, so this enhancement has a significant impact at least for me.

@adeas31
Copy link
Member

adeas31 commented Nov 28, 2023

Ported this to 1.22.1 #11655

adeas31 added a commit that referenced this issue Nov 28, 2023
* fix OMSimulator PYTHONPATH in OMEdit (#11526)

* update subModule OMSimulator

* Check if we have a parameter modification or a binding (#11599)

Fixes #11595

* Do not use elided text for multiline string with fixed font size (#11610)

Fixes #8383

* Add loadClassContentString API (#11574)

* Rename conflicting elements in loadClassContentString (#11613)

Fixes #11596

* Added a tab widget at the bottom of MainWindow (#11627)

* Added a tab widget at the bottom of MainWindow

The tab widget mimics the Messages Browser. It is a shorter version of it.
Only shown when Messages Browser is hidden.
Messages Browser can now only be docked at the bottom.

Scroll to bottom when a new simulation output is added.

Fixes #9889

* Set the index to 0

* Fix the context menu for shapes (#11634)

This is a regression introduced in afb86a3

* Use the `loadClassContentString` API for cut, copy and paste (#11598)

Instead of using the OMEdit internal structures for pasting elements use `loadClassContentString` to merge.
Generate the Modelica code from the selected elements and then merge the code using `loadClassContentString`.
Put the data in the form of string and JSON on the clipboard. Use it when paste is called.

* Show the typed dimensions of array parameter in the dialog (#11629)

* Improve loadClassContentString (#11644)

- Traverse equations/algorithms manually when renaming instead of using
  the AbsynUtil traversal functions, since the traversal functions only
  traverses expressions and not crefs in e.g. connect equations.
- Rewrite the conflict handling to avoid generating new names that
  conflicts with the elements being added.

* Do not call show documentation when editing documentation

Fixes #11638
Calling show documentation while editing causes a recursion

* Do not push intermediate commands to stack

* Use QScrollArea for welcome page buttons

Fixes #10235

---------

Co-authored-by: arun3688 <rain100falls@gmail.com>
Co-authored-by: Per Östlund <per.ostlund@liu.se>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
COMP/GUI/OMEdit Issue and pull request related to OMEdit
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants