Author: sh-sh-sh
Date: Fri Sep 12 18:42:43 2008
New Revision: 51142
URL: http://svn.opensuse.org/viewcvs/yast?rev=51142&view=rev
Log:
Improved resize behaviour of YDialogSpy
Modified:
trunk/libyui/package/yast2-libyui.changes
trunk/libyui/src/YDialogSpy.cc
Modified: trunk/libyui/package/yast2-libyui.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/libyui/package/yast2-libyui.changes?rev=51142&r1=51141&r2=51142&view=diff
==============================================================================
--- trunk/libyui/package/yast2-libyui.changes (original)
+++ trunk/libyui/package/yast2-libyui.changes Fri Sep 12 18:42:43 2008
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Fri Sep 12 18:42:04 CEST 2008 - sh@suse.de
+
+- Improved resize behaviour of YDialogSpy
+
+-------------------------------------------------------------------
Fri Sep 12 16:12:49 CEST 2008 - sh@suse.de
- Added widget properties to YDialogSpy
Modified: trunk/libyui/src/YDialogSpy.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/libyui/src/YDialogSpy.cc?rev=51142&r1=51141&r2=51142&view=diff
==============================================================================
--- trunk/libyui/src/YDialogSpy.cc (original)
+++ trunk/libyui/src/YDialogSpy.cc Fri Sep 12 18:42:43 2008
@@ -35,6 +35,17 @@
#include
#include
+#define TREE_VWEIGHT 40
+#define PROP_VWEIGHT 60
+
+#define DIA_HEIGHT 24
+
+#define TREE_HEIGHT 10
+#define TREE_WIDTH 50
+
+#define PROP_HEIGHT 12
+#define PROP_WIDTH 50
+
/**
* Custom tree item class to map tree items to widgets
@@ -42,8 +53,8 @@
class YWidgetTreeItem: public YTreeItem
{
public:
- YWidgetTreeItem( YWidget * widget,
- bool isOpen )
+ YWidgetTreeItem( YWidget * widget,
+ bool isOpen )
: YTreeItem( "", isOpen )
, _widget( widget )
{
@@ -118,9 +129,11 @@
YWidgetFactory * fac = YUI::widgetFactory();
priv->spyDialog = fac->createPopupDialog();
- YLayoutBox * vbox = fac->createVBox( priv->spyDialog );
+ YAlignment * diaMin = fac->createMinHeight( priv->spyDialog, DIA_HEIGHT );
+ YLayoutBox * vbox = fac->createVBox( diaMin );
- YAlignment * minSize = fac->createMinSize( vbox, 50, 20 );
+ YAlignment * minSize = fac->createMinSize( vbox, TREE_WIDTH, TREE_HEIGHT );
+ minSize->setWeight( YD_VERT, TREE_VWEIGHT );
priv->widgetTree = fac->createTree( minSize, "Widget &Tree" );
priv->widgetTree->setNotify( true );
@@ -159,10 +172,11 @@
if ( ! propertiesShown() )
{
priv->propReplacePoint->deleteChildren();
+ priv->propReplacePoint->setWeight( YD_VERT, PROP_VWEIGHT );
YWidgetFactory * fac = YUI::widgetFactory();
- YAlignment * minSize = fac->createMinSize( priv->propReplacePoint, 30, 12 );
-
+ YAlignment * minSize = fac->createMinSize( priv->propReplacePoint,
+ PROP_WIDTH, PROP_HEIGHT );
YTableHeader * header = new YTableHeader();
YUI_CHECK_NEW( header );
header->addColumn( "Property" );
@@ -170,6 +184,7 @@
header->addColumn( "Type" );
priv->propTable = fac->createTable( minSize, header );
+ // priv->propTable->setKeepSorting( true );
priv->propButton->setLabel( "<<< &Properties" );
priv->propReplacePoint->showChild();
@@ -183,6 +198,7 @@
if ( propertiesShown() )
{
priv->propReplacePoint->deleteChildren();
+ priv->propReplacePoint->setWeight( YD_VERT, 0 );
priv->propTable = 0;
YUI::widgetFactory()->createEmpty( priv->propReplacePoint );
@@ -243,6 +259,7 @@
}
priv->propTable->addItems( items );
+ priv->propTable->deselectAllItems();
}
}
@@ -271,6 +288,8 @@
{
bool updateProp = false;
YEvent * event = priv->spyDialog->waitForEvent();
+ yuiMilestone() << "dialog: " << priv->spyDialog->preferredHeight();
+ yuiMilestone() << "tree: " << priv->widgetTree->preferredHeight();
if ( event )
{
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org