height

How do I set the number of visible lines in a Gtk::TextView?

会有一股神秘感。 提交于 2020-06-23 11:01:05
问题 I have a Gtk::TextView that I would always like to have two lines of text visible, regardless of the font size. Obviously if more than two lines were entered then the box would scroll but I'd like the text view to remain 2 lines tall. How do I do this? 回答1: This is very difficult. For example, what will you do if two font sizes are mixed in one line? One way to do it is to create a Pango layout of one letter and find out its height. This is an untested simplification of some code I wrote in C

Flutter: Specify ListTile height

瘦欲@ 提交于 2020-05-28 13:44:10
问题 In this code, I am trying to make a list of buttons or tile "as buttons does not work well for me " in the very top of the page. Thus, when one is clicked it returns a value in the rest of the page. The issue is: The tile here toke around more than half of the page which makes it looks inconsistent. I want to limit the height of the tile, I have tried putting them in a row and a container and it doesn't work. Any HELP will be appreciated. the result after running the code is: this is the

How to set an element height same as width?

六眼飞鱼酱① 提交于 2020-05-26 08:05:09
问题 Can somebody tell me what is the best way to set height of element same as width? Also it should had auto-scaling according to web browser resolution changes. Is there a wato to that with only html template? Something like: <div class="tile" #square [ngStyle]="{'height.px': square.width}" > 回答1: HTML: <div #div (window:resize)="0" [ngStyle]="{'height.px': div.offsetWidth }"> DEMO All the credit goes to @yurzui 回答2: You need to use square.offsetWidth : <div class="tile" #square [ngStyle]="{

Flexbox body and main min-height

微笑、不失礼 提交于 2020-05-25 04:25:03
问题 https://jsfiddle.net/vz7cLmxy/ I'm trying to have the body to expand but the min-height does not work. I've read other related topics but can't get my head around it. CSS and html body, html { padding: 0; margin: 0; min-height: 100%; } body { display: flex; background: #eee; flex-direction: column; } .menu { background: red; color: #fff; padding: 10px; } .wrap { display: flex; } .sidebar { background: #ddd; width: 300px; } .main { background: #ccc; flex: 1; } .footer { background: #000; color

【CSS】width 、clientWidth、scrollWidth、offsetWidth

僤鯓⒐⒋嵵緔 提交于 2020-04-24 23:42:01
先说 宽度 clientWidth、scrollWidth、offsetWidth参见 http://www.w3school.com.cn/jsref/dom_obj_all.asp clientWidth :可见宽度,包括元素的内容区,就是最里面那部分,包括padding,不包括magin,不包括border,不包括滑动条; 备注:background-color包括元素的内容区、padding、border,也就是比clientWidth涉及区域多了一个border。 scrollWidth :可以滚动的clientWidth; offsetWidth :不包括magin,其他都包括; 注:这里offsetWidth包括滚动条的宽度,但是和scrollWidth不太一样,scrollWidth的是实际内容的宽度,就是将滑块滑动走过的宽度;而offsetWidth包括滚动条的宽度,不是滚动区域。 width :就是你style给的width,不过有一个奇怪的地方,当打印style.width的时候,只对内联样式,且必须写成style = "width:某某px"的有用,能打印出来,其他的打印出来的都是空字符串。不知为何,好奇怪。 至于高度,和宽度一样的啦,对号入座就ok。 来源: oschina 链接: https://my.oschina.net/u/1165741/blog

<GridVew 高度自适应>设置GirdView中item高度来填满 达到自适应

自古美人都是妖i 提交于 2020-04-14 03:02:12
【今日推荐】:为什么一到面试就懵逼!>>> GridView高度和宽度只能在Adapter中获取,所以设置每项item的代码要写在Adapter中。 代码如下: int height = mGridView.getHeight(); int width = mGridView.getWidth(); //得到GridView每一项的高度与宽度 GridView.LayoutParams params = new GridView.LayoutParams(width / 3, height /2); //设置每一行的高度和宽度 view.setLayoutParams(params); 使用此方法每个Item都将多绘制一遍,GirdView项不会太多可以使用,如果数据量大挺影响性能的,如果大家发现更好或优化的方法,给我留言。 来源: oschina 链接: https://my.oschina.net/u/106603/blog/464068

Get Computed Height - Javascript - Not jQuery

别说谁变了你拦得住时间么 提交于 2020-03-18 21:47:08
问题 I have two divs side by side set to height auto. I want them to have equal height, so i combined them as members of an array. I recurse through the array and set the not-tallest ones to the height of the tallest. Problem is everything i have tried to get the COMPUTED height has resulted in the incorrect value. I have tried the following: (els[x].currentStyle) ? h=els[x].currentStyle.height : h=window.getComputedStyle(els[x],null).height; h = el.clientHeight || el.offsetHeight || el

PHP Get height and width in Pdf file proprieties

不想你离开。 提交于 2020-03-09 04:00:39
问题 I have a PDF file. I would to get it height and width in mm. So I do an exec(pdfinfo ... ); I have this result : Creator: Adobe InDesign CS5 (7.0.3) Producer: Acrobat Distiller 9.4.2 (Macintosh) CreationDate: Mon Jan 30 15:48:43 2012 ModDate: Fri Feb 10 10:35:05 2012 Tagged: no Pages: 34 Encrypted: no Page size: 552.744 x 708.643 pts File size: 80724791 bytes Optimized: yes PDF version: 1.3 I have a script witch extract my info : <?php $output = shell_exec("pdfinfo ".$pdflivrelink); $data =

how to extract height and width from a svg file

删除回忆录丶 提交于 2020-02-25 08:39:26
问题 example: <svg width="23" height="22" xmlns="http://www.w3.org/2000/svg"> <!-- Created with SVG-edit - http://svg-edit.googlecode.com/ --> <g> <title>Layer 1</title> <path fill-opacity="0" id="svg_1" d="m23,2-20,9.5l22,9" stroke-width="4" stroke="#000000" fill="#ffffff" /> </g> </svg> I want to extract the width and height of the svg file so that I can do some positioning with canvg. I know it's xml, but I can't figure it out. It's probably something really easy but it's the last day of the

how to extract height and width from a svg file

你。 提交于 2020-02-25 08:39:06
问题 example: <svg width="23" height="22" xmlns="http://www.w3.org/2000/svg"> <!-- Created with SVG-edit - http://svg-edit.googlecode.com/ --> <g> <title>Layer 1</title> <path fill-opacity="0" id="svg_1" d="m23,2-20,9.5l22,9" stroke-width="4" stroke="#000000" fill="#ffffff" /> </g> </svg> I want to extract the width and height of the svg file so that I can do some positioning with canvg. I know it's xml, but I can't figure it out. It's probably something really easy but it's the last day of the