45 #include <hbeffect.h> |
45 #include <hbeffect.h> |
46 #include <hbframedrawer.h> |
46 #include <hbframedrawer.h> |
47 #include <hbevent.h> |
47 #include <hbevent.h> |
48 #include <hbdataform.h> |
48 #include <hbdataform.h> |
49 #include <hbinputregioncollector_p.h> |
49 #include <hbinputregioncollector_p.h> |
|
50 #include <hbfeedbackmanager.h> |
50 |
51 |
51 #include <hbinputmethod.h> |
52 #include <hbinputmethod.h> |
52 #include <hbinputsettingproxy.h> |
53 #include <hbinputsettingproxy.h> |
53 #include <hbinpututils.h> |
54 #include <hbinpututils.h> |
54 #include <hbinputdef.h> |
55 #include <hbinputdef.h> |
65 #include <HbSwipeGesture> |
66 #include <HbSwipeGesture> |
66 #include <HbTapGesture> |
67 #include <HbTapGesture> |
67 #include <HbSelectionDialog> |
68 #include <HbSelectionDialog> |
68 #include <HbListWidgetItem> |
69 #include <HbListWidgetItem> |
69 |
70 |
70 #include "hbinputvirtualrocker.h" |
|
71 #include "hbinputsettinglist.h" |
71 #include "hbinputsettinglist.h" |
72 #include "hbinputmodeindicator.h" |
72 #include "hbinputmodeindicator.h" |
73 #include <hbfeedbackmanager.h> |
|
74 #include "hbinputsmileypicker.h" |
73 #include "hbinputsmileypicker.h" |
75 #include "hbinputscreenshotwidget.h" |
74 #include "hbinputscreenshotwidget.h" |
76 |
75 |
77 #define HB_DIGIT_LATIN_START_VALUE 0x0030 |
76 const int HB_DIGIT_LATIN_START_VALUE = 0x0030; |
78 #define HB_DIGIT_ARABIC_INDIC_START_VALUE 0x0660 |
77 const int HB_DIGIT_ARABIC_INDIC_START_VALUE = 0x0660; |
79 #define HB_DIGIT_EASTERN_ARABIC_START_VALUE 0x06F0 |
78 const int HB_DIGIT_EASTERN_ARABIC_START_VALUE = 0x06F0; |
80 #define HB_DIGIT_DEVANAGARI_START_VALUE 0x0966 |
79 const int HB_DIGIT_DEVANAGARI_START_VALUE = 0x0966; |
81 |
80 |
82 const qreal HbRockerWidth = 50.0; |
81 const qreal HbPortraitSmileyPickerHeightInUnits = 43.7; |
|
82 const qreal HbPortraitSmileyPickerWidthInUnits = 47.8; |
|
83 const qreal HbLandscapeSmileyPickerHeightInUnits = 31.9; |
|
84 const qreal HbLandscapeSmileyPickerWidthInUnits = 83.4; |
|
85 const qreal HbSmileyPickerMarginInUnits = 0.9; |
83 |
86 |
84 |
87 |
85 /*! |
88 /*! |
86 @proto |
89 @proto |
87 @hbinput |
90 @hbinput |
111 mKeymap(0), |
114 mKeymap(0), |
112 mModifiers(0), |
115 mModifiers(0), |
113 mInputModeIndicator(0), |
116 mInputModeIndicator(0), |
114 mSettingList(0), |
117 mSettingList(0), |
115 mButtonLayout(0), |
118 mButtonLayout(0), |
116 mRocker(0), |
|
117 mBackgroundDrawer(0), |
119 mBackgroundDrawer(0), |
118 mIconDrawer(0), |
120 mIconDrawer(0), |
119 mMainWinConnected(false), |
121 mMainWinConnected(false), |
120 mShowRocker(false), |
|
121 mLayout(0), |
122 mLayout(0), |
122 mCurrentHost(0), |
123 mCurrentHost(0), |
123 mDrawbackground(true), |
124 mDrawbackground(true), |
124 mMouseButtonPressedDown(false), |
125 mMouseButtonPressedDown(false), |
125 mFlickDirection(HbInputVkbWidget::HbFlickDirectionNone), |
126 mFlickDirection(HbInputVkbWidget::HbFlickDirectionNone), |
127 mScreenshotWidget(0), |
128 mScreenshotWidget(0), |
128 mScreenshotTimeLine(250), |
129 mScreenshotTimeLine(250), |
129 mMostRecentlyAccessedButton(0), |
130 mMostRecentlyAccessedButton(0), |
130 mMostRecentlyClickedLocation(0.0, 0.0), |
131 mMostRecentlyClickedLocation(0.0, 0.0), |
131 mFocusedObject(0), |
132 mFocusedObject(0), |
|
133 mCurrentFocusedObject(0), |
132 mFlickAnimation(false), |
134 mFlickAnimation(false), |
133 mSettingsListOpen(false), |
135 mSettingsListOpen(false), |
134 mAnimateWhenDialogCloses(false), |
136 mAnimateWhenDialogCloses(false), |
135 mKeyboardSize(HbQwerty4x10), |
137 mKeyboardSize(HbQwerty4x10), |
136 mCloseHandleHeight(0), |
138 mCloseHandleHeight(0), |
137 mCloseHandle(0), |
139 mCloseHandle(0), |
138 mSettingView(0), |
140 mSettingView(0), |
139 mCurrentView(0), |
141 mCurrentView(0), |
140 mKeyboardDimmed(false), |
142 mKeyboardDimmed(false), |
141 mImSelectionDialog(0), |
143 mSettingWidget(0) |
142 mSettingWidget(0) |
|
143 { |
144 { |
144 mScreenshotTimeLine.setUpdateInterval(16); |
145 mScreenshotTimeLine.setUpdateInterval(16); |
145 } |
146 } |
146 |
147 |
147 |
148 |
179 } |
178 } |
180 |
179 |
181 void HbInputVkbWidgetPrivate::init() |
180 void HbInputVkbWidgetPrivate::init() |
182 { |
181 { |
183 Q_Q(HbInputVkbWidget); |
182 Q_Q(HbInputVkbWidget); |
184 q->setFlag(QGraphicsItem::ItemHasNoContents, false); |
183 QGraphicsItem::GraphicsItemFlags itemFlags = q->flags(); |
185 |
184 #if QT_VERSION >= 0x040600 |
186 mRocker = new HbInputVirtualRocker(); |
185 itemFlags |= QGraphicsItem::ItemSendsGeometryChanges; |
|
186 #endif |
|
187 // Make sure the keypad never steals focus. |
|
188 itemFlags |= QGraphicsItem::ItemIsPanel; |
|
189 q->setFlags(itemFlags); |
|
190 |
187 HbInputButtonGroup *buttonGroup = static_cast<HbInputButtonGroup *>(q->contentItem()); |
191 HbInputButtonGroup *buttonGroup = static_cast<HbInputButtonGroup *>(q->contentItem()); |
188 QObject::connect(buttonGroup, SIGNAL(aboutToActivateCustomAction(HbAction *)), |
192 QObject::connect(buttonGroup, SIGNAL(aboutToActivateCustomAction(HbAction *)), |
189 q, SIGNAL(aboutToActivateCustomAction(HbAction *))); |
193 q, SIGNAL(aboutToActivateCustomAction(HbAction *))); |
190 |
|
191 mRocker->setObjectName("VirtualRocker"); |
|
192 QSizeF rockerSize(HbRockerWidth, HbRockerWidth); |
|
193 mRocker->resize(rockerSize); |
|
194 mRocker->setMinimumSize(HbRockerWidth, HbRockerWidth); |
|
195 mRocker->setMaximumSize(HbRockerWidth * 20, HbRockerWidth * 20); |
|
196 if (q->mainWindow()) { |
|
197 q->mainWindow()->scene()->addItem(mRocker); |
|
198 } |
|
199 |
|
200 QObject::connect(mRocker, SIGNAL(rockerDirection(int, HbInputVirtualRocker::RockerSelectionMode)), |
|
201 q, SLOT(_q_handleRockerChange(int, HbInputVirtualRocker::RockerSelectionMode))); |
|
202 |
|
203 mRocker->setVisible(false); |
|
204 |
194 |
205 mBackgroundDrawer = new HbFrameDrawer(); |
195 mBackgroundDrawer = new HbFrameDrawer(); |
206 mBackgroundDrawer->setFrameGraphicsName(backgroundGraphics); |
196 mBackgroundDrawer->setFrameGraphicsName(backgroundGraphics); |
207 mBackgroundDrawer->setFrameType(HbFrameDrawer::ThreePiecesVertical); |
197 mBackgroundDrawer->setFrameType(HbFrameDrawer::ThreePiecesVertical); |
208 mBackgroundDrawer->setFillWholeRect(true); |
198 mBackgroundDrawer->setFillWholeRect(true); |
428 } |
412 } |
429 |
413 |
430 return ret; |
414 return ret; |
431 } |
415 } |
432 |
416 |
433 void HbInputVkbWidgetPrivate::showInputMethodSelectionDialog() |
417 void HbInputVkbWidgetPrivate::_q_activateInputMethod(const HbInputMethodDescriptor &descriptor, const QByteArray &customData) |
434 { |
418 { |
435 Q_Q(HbInputVkbWidget); |
419 Q_Q(HbInputVkbWidget); |
436 |
420 |
437 delete mImSelectionDialog; |
421 if (!descriptor.isEmpty() && mOwner) { |
438 mImSelectionDialog = new HbSelectionDialog(); |
422 // Set as active input method. |
439 |
423 HbInputSettingProxy::instance()->setPreferredInputMethod(q->mainWindow()->orientation(), descriptor, customData); |
440 mImSelectionDialog->setObjectName("Input method dialog"); |
424 // Activate immediately. |
441 |
425 mOwner->activateInputMethod(descriptor); |
442 // Make sure the language dialog never steals focus. |
426 } |
443 mImSelectionDialog->setFlag(QGraphicsItem::ItemIsPanel, true); |
427 } |
444 mImSelectionDialog->setActive(false); |
428 |
445 |
429 void HbInputVkbWidgetPrivate::_q_smileyPickerClosed() |
446 QList<HbInputMethodDescriptor> customList = HbInputMethod::listCustomInputMethods(); |
|
447 |
|
448 QList<HbListWidgetItem *> listItems; |
|
449 HbListWidgetItem *item = new HbListWidgetItem(); |
|
450 QString methodName("Default"); |
|
451 item->setText(methodName); |
|
452 listItems.append(item); |
|
453 |
|
454 foreach(const HbInputMethodDescriptor &descriptor, customList) { |
|
455 QString displayName = descriptor.displayName(); |
|
456 if (displayName.length() == 0) { |
|
457 displayName = QString("Unknown"); |
|
458 } |
|
459 item = new HbListWidgetItem(); |
|
460 item->setText(displayName); |
|
461 listItems.append(item); |
|
462 } |
|
463 mImSelectionDialog->setWidgetItems(listItems, true); |
|
464 mImSelectionDialog->setSelectionMode(HbAbstractItemView::SingleSelection); |
|
465 mImSelectionDialog->setDismissPolicy(HbPopup::NoDismiss); |
|
466 mImSelectionDialog->setModal(true); |
|
467 |
|
468 q->connect(mImSelectionDialog, SIGNAL(finished(HbAction *)), q, SLOT(_q_inputMethodSelectionDialogFinished(HbAction *))); |
|
469 |
|
470 mImSelectionDialog->open(); |
|
471 } |
|
472 |
|
473 void HbInputVkbWidgetPrivate::_q_inputMethodSelectionDialogFinished(HbAction *action) |
|
474 { |
|
475 Q_UNUSED(action); |
|
476 |
|
477 QList<QVariant> selectedItems = mImSelectionDialog->selectedItems(); |
|
478 if (selectedItems.count()) { |
|
479 HbInputMethodDescriptor result; |
|
480 int selection = selectedItems.first().toInt(); |
|
481 if (selection == 0) { |
|
482 result.setDefault(); |
|
483 } else { |
|
484 QList<HbInputMethodDescriptor> customList = HbInputMethod::listCustomInputMethods(); |
|
485 if (customList.count() <= selection) { |
|
486 result = customList[selection-1]; |
|
487 } |
|
488 } |
|
489 |
|
490 if (!result.isEmpty() && mOwner) { |
|
491 // Set as active custom input method. |
|
492 HbInputSettingProxy::instance()->setPreferredInputMethod(Qt::Horizontal, result); |
|
493 HbInputSettingProxy::instance()->setPreferredInputMethod(Qt::Vertical, result); |
|
494 // And finally activate immediately. |
|
495 mOwner->activateInputMethod(result); |
|
496 } |
|
497 } |
|
498 } |
|
499 |
|
500 void HbInputVkbWidgetPrivate::_q_handleRockerChange(int direction, HbInputVirtualRocker::RockerSelectionMode selectionMode) |
|
501 { |
430 { |
502 Q_Q(HbInputVkbWidget); |
431 Q_Q(HbInputVkbWidget); |
503 |
432 |
504 if (direction == HbInputVirtualRocker::HbRockerDirectionRelease) { |
433 q->setKeyboardDimmed(false); |
505 q->setKeyboardDimmed(false); |
|
506 } else if (direction == HbInputVirtualRocker::HbRockerDirectionPress || |
|
507 direction == HbInputVirtualRocker::HbRockerDirectionDoubleClick) { |
|
508 q->setKeyboardDimmed(true); |
|
509 } |
|
510 emit q->rockerDirection(direction, selectionMode); |
|
511 } |
434 } |
512 |
435 |
513 QChar HbInputVkbWidgetPrivate::numberCharacterBoundToKey(int key) |
436 QChar HbInputVkbWidgetPrivate::numberCharacterBoundToKey(int key) |
514 { |
437 { |
515 QChar numChr; |
438 QChar numChr; |
725 } |
645 } |
726 return item; |
646 return item; |
727 } |
647 } |
728 |
648 |
729 /*! |
649 /*! |
|
650 \deprecated HbInputVkbWidget::setRockerVisible(bool) |
|
651 is deprecated. |
|
652 |
730 Sets virtual rocker visibility. |
653 Sets virtual rocker visibility. |
731 */ |
654 */ |
732 void HbInputVkbWidget::setRockerVisible(bool visible) |
655 void HbInputVkbWidget::setRockerVisible(bool visible) |
733 { |
656 { |
734 Q_D(HbInputVkbWidget); |
657 Q_UNUSED(visible); |
735 d->mShowRocker = visible; |
658 } |
736 } |
659 |
737 |
660 /*! |
738 /*! |
661 \deprecated HbInputVkbWidget::isRockerVisible() const |
|
662 is deprecated. |
|
663 |
739 Returns true if virtual rocker is allowed to be visible. |
664 Returns true if virtual rocker is allowed to be visible. |
740 */ |
665 */ |
741 bool HbInputVkbWidget::isRockerVisible() const |
666 bool HbInputVkbWidget::isRockerVisible() const |
742 { |
667 { |
743 Q_D(const HbInputVkbWidget); |
668 return false; |
744 if (d->mShowRocker) { |
|
745 return d->mRocker->isVisible(); |
|
746 } else { |
|
747 return false; |
|
748 } |
|
749 } |
669 } |
750 |
670 |
751 /*! |
671 /*! |
752 Returns active keypad mode. Possible values are EModeAbc, EModeNumeric and EModeSct. |
672 Returns active keypad mode. Possible values are EModeAbc, EModeNumeric and EModeSct. |
753 */ |
673 */ |
837 d->mCurrentHost = host; |
756 d->mCurrentHost = host; |
838 |
757 |
839 if (d->mSmileyPicker && d->mSmileyPicker->isVisible()) { |
758 if (d->mSmileyPicker && d->mSmileyPicker->isVisible()) { |
840 d->mSmileyPicker->hide(); |
759 d->mSmileyPicker->hide(); |
841 } |
760 } |
842 d->mRocker->setVisible(false); |
|
843 if (d->mSettingList) { |
761 if (d->mSettingList) { |
844 d->mSettingList->close(); |
762 d->mSettingList->close(); |
845 } |
763 } |
846 } |
764 } |
847 |
765 |
848 /*! |
766 /*! |
849 Enables or disabled all buttons in the keyboard that have not been disabled directly. |
767 Enables or disables all buttons in the keyboard that have not been disabled directly. |
850 */ |
768 */ |
851 void HbInputVkbWidget::setKeyboardDimmed(bool dimmed) |
769 void HbInputVkbWidget::setKeyboardDimmed(bool dimmed) |
852 { |
770 { |
853 HbInputButtonGroup *buttonGroup = static_cast<HbInputButtonGroup *>(contentItem()); |
771 HbInputButtonGroup *buttonGroup = static_cast<HbInputButtonGroup *>(contentItem()); |
854 if (buttonGroup) { |
772 if (buttonGroup) { |
868 d->captureScreenshot(); |
786 d->captureScreenshot(); |
869 |
787 |
870 if (!d->mSettingList) { |
788 if (!d->mSettingList) { |
871 d->mSettingList = new HbInputSettingList(); |
789 d->mSettingList = new HbInputSettingList(); |
872 connect(d->mSettingList, SIGNAL(inputSettingsButtonClicked()), this, SLOT(showSettingsView())); |
790 connect(d->mSettingList, SIGNAL(inputSettingsButtonClicked()), this, SLOT(showSettingsView())); |
873 connect(d->mSettingList, SIGNAL(inputMethodsButtonClicked()), this, SLOT(executeMethodDialog())); |
791 connect(d->mSettingList, SIGNAL(inputMethodSelected(const HbInputMethodDescriptor &, const QByteArray &)), |
|
792 this, SLOT(_q_activateInputMethod(const HbInputMethodDescriptor &, const QByteArray &))); |
874 } |
793 } |
875 |
794 |
876 HbInputFocusObject *focusObject = d->mOwner->focusObject(); |
795 HbInputFocusObject *focusObject = d->mOwner->focusObject(); |
877 if (focusObject) { |
796 if (focusObject) { |
878 if (focusObject->editorInterface().inputConstraints() & HbEditorConstraintLatinAlphabetOnly) { |
797 if (focusObject->editorInterface().inputConstraints() & HbEditorConstraintLatinAlphabetOnly) { |
958 } |
876 } |
959 HbVkbHost *vkbHost = focusObject->editorInterface().vkbHost(); |
877 HbVkbHost *vkbHost = focusObject->editorInterface().vkbHost(); |
960 if (vkbHost && vkbHost->keypadStatus() != HbVkbHost::HbVkbStatusClosed) { |
878 if (vkbHost && vkbHost->keypadStatus() != HbVkbHost::HbVkbStatusClosed) { |
961 vkbHost->closeKeypad(); |
879 vkbHost->closeKeypad(); |
962 } |
880 } |
|
881 d->mCurrentFocusedObject = focusObject->object(); |
963 |
882 |
964 closeSettingList(); |
883 closeSettingList(); |
965 hide(); |
|
966 if(!d->mSettingView) { |
884 if(!d->mSettingView) { |
967 d->mSettingView = new HbView(this); |
885 d->mSettingView = new HbView(this); |
968 HbAction *backAction = new HbAction(Hb::BackNaviAction, d->mSettingView); |
886 HbAction *backAction = new HbAction(Hb::BackNaviAction, d->mSettingView); |
969 backAction->setText(tr("Back")); |
887 backAction->setText(tr("Back")); |
970 connect(backAction, SIGNAL(triggered(bool)), this, SLOT(closeSettingsView())); |
888 connect(backAction, SIGNAL(triggered(bool)), this, SLOT(closeSettingsView())); |
976 d->mSettingWidget->initializeWidget(); |
894 d->mSettingWidget->initializeWidget(); |
977 HbInputRegionCollector::instance()->attach(d->mSettingView); |
895 HbInputRegionCollector::instance()->attach(d->mSettingView); |
978 d->mSettingView->setTitle(tr("Input Settings")); |
896 d->mSettingView->setTitle(tr("Input Settings")); |
979 mainWindow()->addView(d->mSettingView); |
897 mainWindow()->addView(d->mSettingView); |
980 d->mCurrentView = mainWindow()->currentView(); |
898 d->mCurrentView = mainWindow()->currentView(); |
981 mainWindow()->clearFocus(); |
|
982 mainWindow()->setCurrentView(d->mSettingView); |
899 mainWindow()->setCurrentView(d->mSettingView); |
983 } |
900 } |
984 |
901 |
985 /*! |
902 /*! |
986 Closes settings view and returns to previous view |
903 Closes settings view and returns to previous view |
989 { |
906 { |
990 Q_D(HbInputVkbWidget); |
907 Q_D(HbInputVkbWidget); |
991 |
908 |
992 mainWindow()->setCurrentView(d->mCurrentView); |
909 mainWindow()->setCurrentView(d->mCurrentView); |
993 mainWindow()->removeView(d->mSettingView); |
910 mainWindow()->removeView(d->mSettingView); |
|
911 if (d->mSettingView->scene()) { |
|
912 d->mSettingView->scene()->removeItem(d->mSettingView); |
|
913 } |
994 HbInputRegionCollector::instance()->detach(d->mSettingView); |
914 HbInputRegionCollector::instance()->detach(d->mSettingView); |
995 d->mSettingWidget->resetWidget(); |
915 d->mSettingWidget->resetWidget(); |
996 |
916 |
997 /***** To be removed, Added for vanilla input. |
917 if (d->mCurrentFocusedObject) { |
998 HbInputFocusObject *focusObject = 0; |
918 HbInputFocusObject *focusObject = new HbInputFocusObject(d->mCurrentFocusedObject); |
999 if (!d->mOwner || !(focusObject = d->mOwner->focusObject())) { |
919 d->mOwner->setFocusObject(focusObject); |
1000 return; |
920 d->mCurrentFocusedObject = 0; |
1001 } |
921 } |
1002 HbVkbHost *vkbHost = focusObject->editorInterface().vkbHost(); |
922 } |
1003 if (vkbHost && vkbHost->keypadStatus() != HbVkbHost::HbVkbStatusOpened) { |
923 |
1004 vkbHost->openKeypad(); |
924 /*! |
1005 } |
925 \deprecated HbInputVkbWidget::executeMethodDialog() |
1006 *****/ |
926 is deprecated. |
1007 } |
|
1008 |
|
1009 /*! |
|
1010 Executes input method selection dialog |
927 Executes input method selection dialog |
1011 */ |
928 */ |
1012 void HbInputVkbWidget::executeMethodDialog() |
929 void HbInputVkbWidget::executeMethodDialog() |
1013 { |
930 { |
1014 Q_D(HbInputVkbWidget); |
|
1015 |
|
1016 closeSettingList(); |
|
1017 d->showInputMethodSelectionDialog(); |
|
1018 } |
931 } |
1019 |
932 |
1020 /*! |
933 /*! |
1021 \reimp |
934 \reimp |
1022 */ |
935 */ |
1074 |
984 |
1075 return ret; |
985 return ret; |
1076 } |
986 } |
1077 |
987 |
1078 /*! |
988 /*! |
1079 Returns the virtual rocker position. The default psition is in the middle |
989 \deprecated HbInputVkbWidget::rockerPosition() |
|
990 is deprecated. |
|
991 |
|
992 Returns the virtual rocker position. The default position is in the middle |
1080 of keypad button area. |
993 of keypad button area. |
1081 */ |
994 */ |
1082 QPointF HbInputVkbWidget::rockerPosition() |
995 QPointF HbInputVkbWidget::rockerPosition() |
1083 { |
996 { |
1084 Q_D(const HbInputVkbWidget); |
997 return QPointF(); |
1085 |
|
1086 QPointF result; |
|
1087 |
|
1088 if (d->mRocker) { |
|
1089 QSizeF padArea = keypadButtonAreaSize(); |
|
1090 result = QPointF(scenePos().x() + (padArea.width() * 0.5) - (d->mRocker->size().width() * 0.5), |
|
1091 scenePos().y() + (padArea.height() * 0.5) - (d->mRocker->size().height() * 0.5)); |
|
1092 result.setY(result.y() + d->mCloseHandleHeight); |
|
1093 } |
|
1094 |
|
1095 return result; |
|
1096 } |
998 } |
1097 |
999 |
1098 /*! |
1000 /*! |
1099 Sets the status of the background drawing. This method can be used to |
1001 Sets the status of the background drawing. This method can be used to |
1100 optimize vkb widget drawing. If it is known that the widget will cover whole |
1002 optimize vkb widget drawing. If it is known that the widget will cover whole |
1172 connect(d->mSmileyPicker, SIGNAL(selected(QString)), this, SIGNAL(smileySelected(QString))); |
1074 connect(d->mSmileyPicker, SIGNAL(selected(QString)), this, SIGNAL(smileySelected(QString))); |
1173 } |
1075 } |
1174 } |
1076 } |
1175 |
1077 |
1176 if (d->mSmileyPicker) { |
1078 if (d->mSmileyPicker) { |
1177 d->mSmileyPicker->setGeometry(QRectF(0, pos().y(), geometry().width(), |
1079 qreal unitValue = HbDeviceProfile::profile(mainWindow()).unitValue(); |
1178 geometry().height())); |
1080 QSizeF screenSize = HbDeviceProfile::profile(mainWindow()).logicalSize(); |
1179 d->mSmileyPicker->show(); |
1081 |
|
1082 qreal width = HbPortraitSmileyPickerWidthInUnits * unitValue; |
|
1083 qreal height = HbPortraitSmileyPickerHeightInUnits * unitValue; |
|
1084 if (mainWindow()->orientation() == Qt::Horizontal) { |
|
1085 width = HbLandscapeSmileyPickerWidthInUnits * unitValue; |
|
1086 height = HbLandscapeSmileyPickerHeightInUnits * unitValue; |
|
1087 } |
|
1088 |
|
1089 d->mSmileyPicker->setPreferredSize(QSizeF(width, height)); |
|
1090 d->mSmileyPicker->setPos((screenSize.width() - width) * 0.5, |
|
1091 screenSize.height() - height - HbSmileyPickerMarginInUnits * unitValue); |
|
1092 d->mSmileyPicker->open(this, SLOT(_q_smileyPickerClosed())); |
|
1093 setKeyboardDimmed(true); |
1180 |
1094 |
1181 HbInputButtonGroup *buttonGroup = static_cast<HbInputButtonGroup *>(contentItem()); |
1095 HbInputButtonGroup *buttonGroup = static_cast<HbInputButtonGroup *>(contentItem()); |
1182 if (buttonGroup) { |
1096 if (buttonGroup) { |
1183 buttonGroup->cancelButtonPress(); |
1097 buttonGroup->cancelButtonPress(); |
1184 } |
1098 } |