How do I copy text inside of the tooltip that appears when hovering over elements? - google-chrome-devtools

I'm trying to set min and max dimensions for some elements on a webpage and for elements near the end of the screen, the tooltip is cut off. Usually I would just look at the computed height and width and guess what it could be rounded to, but the width and height are set to auto.
I can't change the size of the viewport, since the size of most of my elements is dependent on viewport width.
I could try to copy the text inside of the tooltip, but I don't know how to get it to stay frozen in place so that I can select the text.
I saw some answers saying to hold F8, but that only works if you have a tooltip applied to the element you're hovering over, it doesn't freeze the inspect tooltip.
An example of what I'm trying to describe.
Source: https://developer.chrome.com/blog/new-in-devtools-75/#A%20detailed%20tooltip.

Related

What's the proper way to align a strechable Text and an image to two ends in Unity UI?

I have an UI element that has a Text and an Image as its children. It has a HorizontalLayoutGroup component that enables Control Child Size and Child Force Expand.
I want the Image has a fixed size, and Text has strechable size controlled by the HorizontalLayoutGroup. So when the Image is set to inactive, the Text fills the whole space and when the Image is active, the Text shrinks a little bit in order to give space to the Image. Right now this part works good.
My second goal is to align them to both ends: the Text in the left and the Image on the right with space in between. But changing Child Alignment can't achieve this.
I tried the following solution:
Add LayoutElement both to Image and Text. On Text, enable Flexible Width and set a a value, on Image, enable Min Width and set to a value. Manually adjust the two values until it seems right.
This solution seems to work, but I don't know why. Is anyone familiar with this?What's the recommended way to do it? Thanks!
I worked it out. On the LayoutElement, treat Preferred Width or Preferred Height as Max Width or Max Height. Enable them, set the value the same with min value. One the other objects that you want to stretch, enable Flexible values. Then all worked as we want.

Setting row to minimum child height flutter

I'm trying to produce a widget like this below to be contained inside of a listview. I have managed an effect like this rather simply based on the example given on the flutter website for YouTube. However, the part I'm struggling with is that I would like the image to resize vertically depending on how large the text is.
Currently this is created with a row. If possible I'd like to set the row height somehow but only dependent on the height of the text. As some elements will have more text and some will have less I would like to have the image fill the vertical space so the height is the same as the text height.
I basically want this - https://api.flutter.dev/flutter/material/ListTile-class.html#material.ListTile.4
but where the image height on the left matches the text height on the right
Thanks in advance!

Unity3d. UI elements snapping/anchoring

I have canvas with vertical layout and 2 elements within (in fact it's element with only recttransform on it, let's call it container). So these 2 containers take a half of the screen by height and stretched by width, ok. How can I place an text element in above container and snap it to the bottom of this container? I tried press bottom button in recttransform widget (also with shift and alt) and it seems it doesn't affect my transform at all
P.s. May be I can use some free plugin instead of default unity components of UI layout?
There are different ways of placing your UI elements
Simply drag and drop it to the bottom where you want it
Use the anchor widget to set the anchoring to bottom with horizontal stretch and hold shift to also set pivot. Then set Pos Y to 0. Set Left and Right to 0.
Assuming you also want other elements in your containers, place a Vertical Layout Group on each container and make sure that your text element is the last child of the container in the hierarchy.
I would also advise you to seek out tutorials on Unity UI anchoring, positioning, scaling, and layout. You need a deeper understanding of how these things interact than you are likely to get from Stack Overflow. Otherwise you will suddenly find that your UI behaves in unexpected ways when rearranged or displayed on a different aspect ratio.
It's fairly easy with Unity UI system. You just need to get used to it. Here are simple steps to accomplish what you want:
Create Text element as a child of that container.
Select your newly created element and edit its RectTransform component values:
2.1. Set both Y axis anchors (min and max) to 0.
2.2. Set pivot value to 0 as well.
2.3. Set Pos Y value to 0 as well.
Now your Text element is anchored at the bottom of the container and its position (and height) is measured from the bottom of the Text element itself.

CodeMirror vertical offset at cursor

I have a CodeMirror window whose element's height is set to auto. The max height is set such that it does not add a scroll bar to the page itself. My problem is that when this max height is reached, any subsequent line additions is hidden until I scroll down manually. I would like additional lines to be shown when added by default, thus I'm looking for a vertical offset for the editor, similar to Vim's scrolloff. That is, I always want the lines above and below the cursor to be displayed.
I've come across cursorScrollMargin and played around with a few values, but no noticeable changes occur.

Text component displaying lines in reverse order

Alright, I do not know how to fix this and only ran into this problem after trying to put in some longer text on a UI Text component. I have tried both pasting a value into its Text attribute through the Unity editor, and setting its value programmatically like this:
t.GetComponent<Text> ().text = "This is where meat, fish, and [...] (long text)"
Because Horizontal wrap is on, the text wraps when it reaches the edge of the available space.
However, the text displays backwards. Meaning, the start of the paragraph is at the bottom, and bottom at the top. Taking off wrap fixes this, but then the font size has to be really small (or it won't all be visible), and it can't form a normal paragraph because it has to... you know... wrap.
Is this a bug in Unity?
This is what happens - as you can see, it is displayed backwards:
The negative Line Spacing value is what is causing the issue here:
When the value of this field is less than 0, the lines will actually be arranged backwards, leading to the behaviour you're currently encountering. Just change the value to a positive number to have the text display correctly.