src/hbinput/inputwidgets/hbinputmethodselectionlist.cpp
changeset 28 b7da29130b0e
parent 23 e6ad4ef83b23
child 30 80e4d18b72f5
equal deleted inserted replaced
23:e6ad4ef83b23 28:b7da29130b0e
   138  : HbDialog(*new HbInputMethodSelectionListPrivate(), parent)
   138  : HbDialog(*new HbInputMethodSelectionListPrivate(), parent)
   139 {
   139 {
   140     Q_D(HbInputMethodSelectionList);
   140     Q_D(HbInputMethodSelectionList);
   141     HbInputRegionCollector::instance()->attach(this);
   141     HbInputRegionCollector::instance()->attach(this);
   142 
   142 
   143     HbStyle style;
       
   144     qreal listWidth(300);
   143     qreal listWidth(300);
   145     style.parameter(QString("expr(var(hb-param-screen-short-edge)-(2*var(hb-param-margin-gene-screen)))"), listWidth);
   144     style()->parameter(QString("expr(var(hb-param-screen-short-edge)-(2*var(hb-param-margin-gene-screen)))"), listWidth);
   146     qreal margin(5);
   145     qreal margin(5);
   147     style.parameter(QString("hb-param-margin-gene-popup"), margin);
   146     style()->parameter(QString("hb-param-margin-gene-popup"), margin);
   148 
   147 
   149     QGraphicsLinearLayout *layout = new QGraphicsLinearLayout();
   148     QGraphicsLinearLayout *layout = new QGraphicsLinearLayout();
   150     layout->setContentsMargins(margin, margin, margin, margin);
   149     layout->setContentsMargins(margin, margin, margin, margin);
   151 
   150 
   152     // set default values for popup
   151     // set default values for popup
   156     setPreferredWidth(listWidth);
   155     setPreferredWidth(listWidth);
   157     setModal(true);
   156     setModal(true);
   158 
   157 
   159     // Make sure input method selection list never steals focus.
   158     // Make sure input method selection list never steals focus.
   160     setFlag(QGraphicsItem::ItemIsPanel, true);
   159     setFlag(QGraphicsItem::ItemIsPanel, true);
       
   160     d->mActivePopup = false;
   161     setActive(false);
   161     setActive(false);
   162 
   162 
   163     d->createSelectionList();
   163     d->createSelectionList();
   164 
   164 
   165     layout->addItem(d->mList);
   165     layout->addItem(d->mList);