homescreenapp/widgetplugins/hsshortcutwidgetplugin/src/hsshortcutwidget.cpp
changeset 62 341166945d65
parent 55 03646e8da489
child 69 87476091b3f5
equal deleted inserted replaced
57:2e2dc3d30ca8 62:341166945d65
   134             handleMouseMoveEvent(static_cast<QGraphicsSceneMouseEvent *>(event));
   134             handleMouseMoveEvent(static_cast<QGraphicsSceneMouseEvent *>(event));
   135             return true;
   135             return true;
   136         case QEvent::GraphicsSceneMouseRelease:
   136         case QEvent::GraphicsSceneMouseRelease:
   137             handleMouseReleaseEvent(static_cast<QGraphicsSceneMouseEvent *>(event));
   137             handleMouseReleaseEvent(static_cast<QGraphicsSceneMouseEvent *>(event));
   138             return true;
   138             return true;
       
   139         case QEvent::UngrabMouse:
       
   140             setBackgroundToNormal();
       
   141             return true;
   139         default:
   142         default:
   140             break;
   143             break;
   141     }
   144     }
   142 
   145 
   143     return false;
   146     return false;
   230 
   233 
   231     if (!contains(event->pos())) {
   234     if (!contains(event->pos())) {
   232         return;
   235         return;
   233     }
   236     }
   234 
   237 
   235     HbInstantFeedback::play(HsConfiguration::shortcutWidgetTapFeedbackType());
   238     HbInstantFeedback::play(HSCONFIGURATION_GET(shortcutWidgetTapFeedbackEffect));
   236     
   239     
   237     if (mCaEntryRole == ItemEntryRole) {
   240     if (mCaEntryRole == ItemEntryRole) {
   238         CaService::instance()->executeCommand(mCaEntryId);
   241         CaService::instance()->executeCommand(mCaEntryId);
   239     } else {
   242     } else {
   240         HsShortcutService::instance()->executeCollectionAction(mCaEntryId, mCaEntryTypeName);
   243         HsShortcutService::instance()->executeCollectionAction(mCaEntryId, mCaEntryTypeName);
   259         mIcon = new HbIconItem(this);
   262         mIcon = new HbIconItem(this);
   260         HbStyle::setItemName(mIcon, QLatin1String("icon"));
   263         HbStyle::setItemName(mIcon, QLatin1String("icon"));
   261     }
   264     }
   262 
   265 
   263     // Text
   266     // Text
   264     if ( HsConfiguration::shortcutLabelsVisible() && !mText ) {
   267     if (HSCONFIGURATION_GET(isShortcutLabelVisible) && !mText ) {
   265         mText = new HbTextItem(this);
   268         mText = new HbTextItem(this);
   266         HbStyle::setItemName(mText, QLatin1String("text"));
   269         HbStyle::setItemName(mText, QLatin1String("text"));
   267         }
   270         }
   268     // Touch Area
   271     // Touch Area
   269     if (!mTouchArea) {
   272     if (!mTouchArea) {
   281     mCaEntryRole = caEntry.role();
   284     mCaEntryRole = caEntry.role();
   282     mCaEntryFlags = caEntry.flags();
   285     mCaEntryFlags = caEntry.flags();
   283     mCaEntryTypeName = caEntry.entryTypeName();
   286     mCaEntryTypeName = caEntry.entryTypeName();
   284     mIcon->setIcon(caEntry.makeIcon());
   287     mIcon->setIcon(caEntry.makeIcon());
   285     if (mText) {
   288     if (mText) {
   286         mText->setText(caEntry.text());
   289         if(caEntry.attribute(entryShortName()).length()) {
   287         }
   290             mText->setText(caEntry.attribute(entryShortName()));
       
   291         } else {
       
   292             mText->setText(caEntry.text());
       
   293         }        
       
   294     }
   288 }
   295 }
   289 
   296 
   290 /*!
   297 /*!
   291     \internal
   298     \internal
   292 */
   299 */
   343         emit finished();
   350         emit finished();
   344     }
   351     }
   345 }
   352 }
   346 
   353 
   347 
   354 
       
   355