--- a/src/hbcore/gui/hbtoolbarextension.cpp Mon Apr 19 14:02:13 2010 +0300
+++ b/src/hbcore/gui/hbtoolbarextension.cpp Mon May 03 12:48:33 2010 +0300
@@ -83,6 +83,7 @@
mColsPortrait(3),
mColsLandscape(4),
lazyInitDone(false),
+ orientationConnectDone(false),
//
mExtendedButton(0),
mToolBar(0)
@@ -147,7 +148,6 @@
int column (0);
int row(0);
initialiseContent();
-
if (!mDefaultContentWidget)
return;
@@ -167,7 +167,7 @@
if ( row >= maxRow ) {
qWarning() << "Too many items in extension!";
}
- HbToolButtonPrivate::d_ptr(button)->setBackgroundVisible(false);
+ HbToolButtonPrivate::d_ptr(button)->setExtensionBackgroundVisible(true);
mLayout->addItem( button, row, column );
++j;
}
@@ -294,6 +294,7 @@
HbToolBarExtensionPrivate::d_ptr(q)->setAlignment(Qt::AlignRight);
}
}
+ q->repolish();
doLayout();
}
@@ -327,6 +328,7 @@
*/
HbToolBarExtension::~HbToolBarExtension()
{
+ disconnect();
}
/*!
@@ -484,7 +486,13 @@
{
Q_D(HbToolBarExtension);
if (change == QGraphicsItem::ItemVisibleHasChanged) {
- if (value.toBool() == true) {
+ if (value.toBool()) {
+ HbMainWindow* w(mainWindow());
+ if(w && !d->orientationConnectDone) {
+ QObject::connect(w,SIGNAL(orientationChanged(Qt::Orientation)),
+ this, SLOT(_q_orientationChanged()));
+ d->orientationConnectDone = true;
+ }
d->placeToolBarExtension();
}
}