telutils/dialpad/src/dialpad.cpp
changeset 33 8d5d7fcf9b59
parent 32 1f002146abb4
child 42 35488577e233
--- a/telutils/dialpad/src/dialpad.cpp	Tue Jul 06 14:53:02 2010 +0300
+++ b/telutils/dialpad/src/dialpad.cpp	Wed Jul 21 18:26:52 2010 +0300
@@ -27,6 +27,7 @@
 #include <hbapplication.h>
 #include <hbswipegesture.h>
 #include <hbeffect.h>
+#include <hbevent.h>
 
 #include "dialpad.h"
 #include "dialpadinputfield.h"
@@ -45,8 +46,8 @@
 static const qreal DialpadComponentMargin = 0.75; // units
 static const qreal DialpadCloseHandleHeight = 2.23; // units
 static const qreal DialpadCloseHandleWidth = 18.8; // units
-static const qreal DialpadCallButtonHeight = 8.0; // units
-static const qreal DialpadCallButtonHeightH = 6.0; // units
+static const qreal DialpadCallButtonHeight = 8.75; // units, same as numeric buttons
+static const qreal DialpadCallButtonHeightH = 7.25; // units
 
 static const QLatin1String handsetIcon("qtg_mono_call");
 static const QLatin1String vmbxIcon("qtg_mono_voice_mailbox");
@@ -113,7 +114,8 @@
     popupLayout->addItem(mKeypad);
     popupLayout->addItem(&mKeypad->callButton());
     popupLayout->setContentsMargins(margin, mCloseHandleHeight, margin, margin);
-    popupLayout->setSpacing(margin);
+    popupLayout->setSpacing(0);
+    popupLayout->setItemSpacing(0,margin);
     setLayout(popupLayout);
 
     // asterisk multitap handler
@@ -214,6 +216,16 @@
     mIconDrawer->paint(painter, rect);
 }
 
+void Dialpad::changeEvent(QEvent *event)
+{
+    if (event->type() == QEvent::LayoutDirectionChange) {
+        mBackgroundDrawer->setLayoutDirection(layoutDirection());
+    } else if (event->type() == HbEvent::ThemeChanged) {
+        mBackgroundDrawer->themeChanged();
+        mIconDrawer->themeChanged();
+    }
+}
+
 bool Dialpad::isOpen() const
 {
     return mIsOpen;