--- a/controlpanelplugins/themeplugin/src/cpthemelistview.cpp Fri Jun 25 17:12:20 2010 +0800
+++ b/controlpanelplugins/themeplugin/src/cpthemelistview.cpp Wed Sep 29 10:09:58 2010 +0800
@@ -20,20 +20,22 @@
#include <QModelIndex>
#include <hbview.h>
-#include <hblabel.h>
#include <hblistview.h>
#include <hblistviewitem.h>
+#include <hbtoolbar.h>
+#include <hbaction.h>
+#include <hbgroupbox.h>
+
#include "cpthemelistview.h"
/*!
\class CpThemeListView
- \brief CpThemeListView displays a heading (Select theme) and a list of themes with
+ \brief CpThemeListView displays a heading (e.g Theme) and a list of themes with
corresponding icons.
Note: This class is a subclass of CpBaseSettingView for compatibility with Control Panel
- framework. However, it does not use HbDataForm as its widget and as its parent does, so
- it uses SetWidget to set the listview to its widget instead of an HbDataForm.
+ framework.
*/
/*!
@@ -42,27 +44,46 @@
CpThemeListView::CpThemeListView(QGraphicsItem *parent) : CpBaseSettingView(0, parent),
mThemeList(new HbListView(this))
{
-
- //Create a layout with a heading "Select theme" at top and the list below it.
+
+ //Create a layout with a heading at top and the list below it.
HbWidget* contentWidget = new HbWidget(this);
QGraphicsLinearLayout* layout = new QGraphicsLinearLayout(Qt::Vertical);
+ layout->setContentsMargins(0,0,0,0);
//setup the heading.
- HbLabel* label = new HbLabel(hbTrId("txt_cp_title_select_theme"), contentWidget);//txt_cp_title_select_theme
- layout->addItem(label);
-
- connect(mThemeList, SIGNAL(activated(const QModelIndex&)),
- this, SIGNAL(newThemeSelected(const QModelIndex&)));
+ HbGroupBox *simpleLabel = new HbGroupBox();
+ simpleLabel->setHeading(hbTrId("txt_cp_title_select_theme"));
+
+ layout->addItem(simpleLabel);
+
+ connect(mThemeList, SIGNAL(activated(QModelIndex)),
+ this, SIGNAL(newThemeSelected(QModelIndex)));
+ //set list item icons to be large.
HbListViewItem* listViewItem = mThemeList->listItemPrototype();
listViewItem->setGraphicsSize(HbListViewItem::LargeIcon);
-
+ //set singleSelection to enable showing an indicator (e.g check mark) next to active theme.
+ mThemeList->setSelectionMode(HbAbstractItemView::SingleSelection);
+
//add the list to layout.
layout->addItem(mThemeList);
+
+ //Create the toolbar for Ovi Store.
+ HbToolBar* toolBar = new HbToolBar(this);
+
+ HbAction* oviAction = new HbAction(HbIcon("qtg_large_ovistore"), hbTrId("txt_cp_list_get_more_tones"));
+ QObject::connect( oviAction, SIGNAL(triggered()),
+ this, SIGNAL(oviClicked()));
+
+ //Add Action to the toolbar and show toolbar
+ toolBar->addAction(oviAction);
+
+ setToolBar(toolBar);
contentWidget->setLayout(layout);
setWidget(contentWidget);
+
}
/*!