diff --git a/debian/changelog b/debian/changelog index 93c3f14c..69465287 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ system-ui (1.2.6~1) unstable; urgency=low * [UNRELEASED] * Fixes: NB#283768 - Media Sharing status menu item should be loaded to status menu. + * Fixes: NB#274279 - 'Current state: Charging only' (§qtn_usb_charging§) alignment and font are incorrect in the USB mode selection dialog -- Vesa Halttunen Mon, 03 Oct 2011 16:06:22 +0300 diff --git a/src/systemui/usbui.cpp b/src/systemui/usbui.cpp index 2068701c..40275670 100644 --- a/src/systemui/usbui.cpp +++ b/src/systemui/usbui.cpp @@ -29,6 +29,9 @@ #include #include #include +#include +#include +#include #ifdef HAVE_QMSYSTEM #include @@ -44,7 +47,7 @@ UsbUi::UsbUi(QObject *parent) : MDialog(), #endif developerMode(new MGConfItem("/Meego/System/DeveloperMode", this)), layout(new QGraphicsLinearLayout(Qt::Vertical)), - chargingLabel(new MLabel), + chargingLabel(new MLabel()), massStorageItem(new MBasicListItem(MBasicListItem::SingleTitle)), oviSuiteItem(new MBasicListItem(MBasicListItem::SingleTitle)), sdkItem(new MBasicListItem(MBasicListItem::SingleTitle)) @@ -54,19 +57,44 @@ UsbUi::UsbUi(QObject *parent) : MDialog(), setSystem(true); setButtonBoxVisible(false); - chargingLabel->setStyleName("CommonBodyTextInverted"); - chargingLabel->setAlignment(Qt::AlignCenter); - layout->addItem(chargingLabel); + layout->setContentsMargins(0, 0, 0, 0); + layout->setSpacing(0); - massStorageItem->setStyleName("CommonBasicListItemInverted"); + MStylableWidget* topSpacer = new MStylableWidget; + topSpacer->setStyleName("CommonSpacer"); + layout->addItem(topSpacer); + + MContainer* frame = new MContainer; + frame->setHeaderVisible(false); + frame->setStyleName("CommonTextFrameInverted"); + + chargingLabel->setStyleName("CommonSingleTitleInverted"); + chargingLabel->setTextElide(true); + + MImageWidget* icon = new MImageWidget("icon-m-common-usb"); + icon->setStyleName("CommonSmallMainIcon"); + + QGraphicsLinearLayout* currentStateLayout = new QGraphicsLinearLayout(Qt::Horizontal, frame->centralWidget()); + currentStateLayout->setContentsMargins(0, 0, 0, 0); + currentStateLayout->setSpacing(0); + currentStateLayout->addItem(icon); + currentStateLayout->setAlignment(icon, Qt::AlignCenter); + currentStateLayout->addItem(chargingLabel); + layout->addItem(frame); + + MStylableWidget* bottomSpacer = new MStylableWidget; + bottomSpacer->setStyleName("CommonSpacer"); + layout->addItem(bottomSpacer); + + massStorageItem->setStyleName("CommonSmallPanelInverted"); connect(massStorageItem, SIGNAL(clicked()), this, SLOT(setMassStorageMode())); layout->addItem(massStorageItem); - oviSuiteItem->setStyleName("CommonBasicListItemInverted"); + oviSuiteItem->setStyleName("CommonSmallPanelInverted"); connect(oviSuiteItem, SIGNAL(clicked()), this, SLOT(setOviSuiteMode())); layout->addItem(oviSuiteItem); - sdkItem->setStyleName("CommonBasicListItemInverted"); + sdkItem->setStyleName("CommonSmallPanelInverted"); connect(sdkItem, SIGNAL(clicked()), this, SLOT(setSDKMode())); connect(developerMode, SIGNAL(valueChanged()), this, SLOT(updateSDKItemVisibility())); updateSDKItemVisibility(); diff --git a/tests/ut_usbui/ut_usbui.cpp b/tests/ut_usbui/ut_usbui.cpp index 15be3a6f..4892dc94 100644 --- a/tests/ut_usbui/ut_usbui.cpp +++ b/tests/ut_usbui/ut_usbui.cpp @@ -243,12 +243,14 @@ void Ut_UsbUi::testSDKItemVisibleOnlyWhenDeveloperModeEnabled() mGConfItemValue = QVariant(true); m_subject = new UsbUi; - QCOMPARE(m_subject->layout->count(), 4); + // Current state items (3) + 3 list items + QCOMPARE(m_subject->layout->count(), 6); QCOMPARE(m_subject->sdkItem->parentLayoutItem(), m_subject->layout); mGConfItemValue = QVariant(false); m_subject->updateSDKItemVisibility(); - QCOMPARE(m_subject->layout->count(), 3); + // Current state items (3) + 2 list items + QCOMPARE(m_subject->layout->count(), 5); QCOMPARE(m_subject->sdkItem->parentLayoutItem(), (QGraphicsLayoutItem *)NULL); }