<br><br>
<div class="gmail_quote">On Dec 19, 2007 8:53 AM, Aaron J. Seigo &lt;<a href="mailto:aseigo@kde.org">aseigo@kde.org</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="Ih2E3d">On Wednesday 19 December 2007, Marco Martin wrote:<br>&gt; the minimum size of the icon is too big for the panel<br>&gt; and the applet should have an expandingdirections 0 otherwiseit eats all<br>&gt; the available space in a boxlayout
<br><br></div>this:<br><br>&nbsp;setMinimumContentSize(QSize(48,78));</blockquote>
<div>&nbsp;</div>
<div>Agreed.&nbsp; I&#39;ve been working on a way to do this but have been unable to find a way to get the fontmetrics of the display.&nbsp; I believe it&#39;s available in QStyleGraphicsItem but that is not available upon creation of the widget.
</div>
<div>&nbsp;</div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><span id=""></span><br><br>should probably be based on the height() of the font that will be used?<br>
<div class="Ih2E3d"><br>&gt; this patch should address these issues, in particular i made the<br>&gt; minimumcontentsize dependent from the containment, because in the panel the<br>&gt; icon doesn&#39;t have text (-&gt;different aspect ratio) and it should still be
<br>&gt; possible to have a very tiny panel like 16 pixels or so.<br><br></div>ineed.<br>
<div class="Ih2E3d"><br>&gt; i think it should be done to every applet that uses an icon widget (move it<br>&gt; down to icon widget?)<br><br></div>some of it will need to, yes.<br>
<div class="Ih2E3d"><br>&gt; it still has the problem of the elided text that i feel it&#39;s kinda<br>&gt; connected with this one, i think the aspect ratio of the icon should change<br>&gt; upon resizing to make enough room for at least 15-16 characters, but i
<br>&gt; still don&#39;t know how to do it<br><br></div>ok, this part belongs in the applet. basically what you want to do is in<br>constraintsUpdated you will want to respond to (constraints &amp; SizeConstraint)<br>and calculate a new width based on the height.
<br></blockquote>
<div>&nbsp;</div>
<div>I&#39;ve added a sizeHint to the widget just for that purpose.&nbsp; My plan is to compare the sizeHint of the Widget and compare that the size constraints of the Applet and accomodate the Widget if it fits within the size constraints of the applet.
</div>
<div>&nbsp;</div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><span id=""></span><br>you can either set the new width right there or use contentSizeHint. either<br>way, you need to be careful not to create an infinite loop: changing the size
<br>may well cause another call to constraintsUpdated for SizeConstraint; so the<br>calculation needs to be stable (always returning the same width for the same<br>height)<br>
<div>
<div></div>
<div class="Wj3C7c"><br>--<br>Aaron J. Seigo<br>humru othro a kohnu se<br>GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA &nbsp;EE75 D6B7 2EB1 A7F1 DB43<br><br>KDE core developer sponsored by Trolltech<br></div></div><br>_______________________________________________
<br>Panel-devel mailing list<br><a href="mailto:Panel-devel@kde.org">Panel-devel@kde.org</a><br><a href="https://mail.kde.org/mailman/listinfo/panel-devel" target="_blank">https://mail.kde.org/mailman/listinfo/panel-devel
</a><br><br></blockquote></div><br>