You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by gb...@apache.org on 2009/05/15 23:09:49 UTC
svn commit: r775342 - in /incubator/pivot/trunk/wtk:
src/pivot/wtk/skin/CardPaneSkin.java test/pivot/wtk/test/card_pane_test.wtkx
Author: gbrown
Date: Fri May 15 21:09:49 2009
New Revision: 775342
URL: http://svn.apache.org/viewvc?rev=775342&view=rev
Log:
Minor fixes to CardPaneSkin.
Modified:
incubator/pivot/trunk/wtk/src/pivot/wtk/skin/CardPaneSkin.java
incubator/pivot/trunk/wtk/test/pivot/wtk/test/card_pane_test.wtkx
Modified: incubator/pivot/trunk/wtk/src/pivot/wtk/skin/CardPaneSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/pivot/wtk/skin/CardPaneSkin.java?rev=775342&r1=775341&r2=775342&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/pivot/wtk/skin/CardPaneSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/pivot/wtk/skin/CardPaneSkin.java Fri May 15 21:09:49 2009
@@ -122,7 +122,6 @@
Component toCard = getToCard();
if (toCard != null) {
toCard.getDecorators().add(fadeInDecorator);
- toCard.setSize(toCard.getPreferredSize());
toCard.setVisible(true);
}
@@ -343,11 +342,11 @@
int height = getHeight();
for (Component card : cardPane) {
- // If the card is visible, set its size and location
- if (card.isVisible()) {
- card.setLocation(0, 0);
- card.setSize(width, height);
- }
+ // Setting the size of non-visible cards does not impose a
+ // performance penalty since setSize() does not trigger an
+ // invalidate unless the component is visible
+ card.setLocation(0, 0);
+ card.setSize(width, height);
}
}
Modified: incubator/pivot/trunk/wtk/test/pivot/wtk/test/card_pane_test.wtkx
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/test/pivot/wtk/test/card_pane_test.wtkx?rev=775342&r1=775341&r2=775342&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/test/pivot/wtk/test/card_pane_test.wtkx (original)
+++ incubator/pivot/trunk/wtk/test/pivot/wtk/test/card_pane_test.wtkx Fri May 15 21:09:49 2009
@@ -32,9 +32,21 @@
</TablePane.Row>
<TablePane.Row height="1*">
<CardPane wtkx:id="cardPane" styles="{sizeToSelection:true, selectionChangeEffect:'crossfade'}">
- <Border title="320x240" preferredWidth="320" preferredHeight="240"/>
- <Border title="640x480" preferredWidth="640" preferredHeight="480"/>
- <Border title="800x600" preferredWidth="800" preferredHeight="600"/>
+ <Border title="320x240" preferredWidth="320" preferredHeight="240">
+ <content>
+ <ListView listData="['One', 'Two', 'Three', 'Four', 'Five', 'One', 'Two', 'Three', 'Four', 'Five', 'One', 'Two', 'Three', 'Four', 'Five', 'One', 'Two', 'Three', 'Four', 'Five']"/>
+ </content>
+ </Border>
+ <Border title="640x480" preferredWidth="640" preferredHeight="480">
+ <content>
+ <ListView listData="['Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Six', 'Seven', 'Eight', 'Nine', 'Ten']"/>
+ </content>
+ </Border>
+ <Border title="800x600" preferredWidth="800" preferredHeight="600">
+ <content>
+ <ListView listData="['Eleven', 'Twelve', 'Thirteen', 'Fourteen', 'Fifteen', 'Eleven', 'Twelve', 'Thirteen', 'Fourteen', 'Fifteen', 'Eleven', 'Twelve', 'Thirteen', 'Fourteen', 'Fifteen', 'Eleven', 'Twelve', 'Thirteen', 'Fourteen', 'Fifteen']"/>
+ </content>
+ </Border>
</CardPane>
</TablePane.Row>
</rows>