Map button/compass icon added
authorfortefr <fortefr@localhost>
Thu, 14 Jan 2010 13:54:09 +0000 (13:54 +0000)
committerfortefr <fortefr@localhost>
Thu, 14 Jan 2010 13:54:09 +0000 (13:54 +0000)
src/gui/mainwindow.ui
src/icons.qrc
src/mvc/delegate.cpp
src/mvc/delegate.h
src/mvc/treeview.cpp

index f64817b..f5ff71d 100644 (file)
@@ -18,7 +18,7 @@
     <item row="0" column="0">
      <widget class="QTabWidget" name="tabWidget">
       <property name="currentIndex">
     <item row="0" column="0">
      <widget class="QTabWidget" name="tabWidget">
       <property name="currentIndex">
-       <number>4</number>
+       <number>0</number>
       </property>
       <widget class="QWidget" name="dayViewTab">
        <attribute name="title">
       </property>
       <widget class="QWidget" name="dayViewTab">
        <attribute name="title">
index d96b3fe..e39ff6d 100644 (file)
@@ -7,5 +7,6 @@
     <file>icons/expand.png</file>
     <file>icons/collapse.png</file>
     <file>icons/fosdem.png</file>
     <file>icons/expand.png</file>
     <file>icons/collapse.png</file>
     <file>icons/fosdem.png</file>
+    <file>icons/compass.png</file>
 </qresource>
 </RCC>
 </qresource>
 </RCC>
index 95ab7b1..c6174bf 100644 (file)
@@ -85,6 +85,7 @@ void Delegate::paint(QPainter *painter, const QStyleOptionViewItem &option, cons
         // draw Controls
         painter->drawImage(mControls[FavouriteControl]->drawPoint(option.rect),*mControls[FavouriteControl]->image());
         painter->drawImage(mControls[AlarmControl]->drawPoint(option.rect),*mControls[AlarmControl]->image());
         // draw Controls
         painter->drawImage(mControls[FavouriteControl]->drawPoint(option.rect),*mControls[FavouriteControl]->image());
         painter->drawImage(mControls[AlarmControl]->drawPoint(option.rect),*mControls[AlarmControl]->image());
+        painter->drawImage(mControls[MapControl]->drawPoint(option.rect),*mControls[MapControl]->image());
     }
     else // doesn't have parent - time-groups' elements (top items)
     {
     }
     else // doesn't have parent - time-groups' elements (top items)
     {
@@ -208,6 +209,12 @@ void Delegate::defineControls()
     control = new Control(AlarmControl,QString(":icons/alarm-on.png"));
     control->setDrawPoint(QPoint(-mControls[FavouriteControl]->image()->width()-control->image()->width()-2*SPACER,SPACER));
     mControls.insert(AlarmControl,control);
     control = new Control(AlarmControl,QString(":icons/alarm-on.png"));
     control->setDrawPoint(QPoint(-mControls[FavouriteControl]->image()->width()-control->image()->width()-2*SPACER,SPACER));
     mControls.insert(AlarmControl,control);
+
+    // MAP ICON
+    control = new Control(MapControl,QString(":icons/compass.png"));
+    control->setDrawPoint(QPoint(-mControls[AlarmControl]->image()->width()-control->image()->width()
+                                 -mControls[FavouriteControl]->image()->width()-3*SPACER,SPACER));
+    mControls.insert(MapControl,control);
 }
 
 bool Delegate::isPointFromRect(const QPoint &aPoint, const QRect &aRect) const
 }
 
 bool Delegate::isPointFromRect(const QPoint &aPoint, const QRect &aRect) const
index 657994d..a11cfab 100644 (file)
@@ -15,7 +15,8 @@ class Delegate : public QItemDelegate
         {
             ControlNone = 0,
             FavouriteControl,
         {
             ControlNone = 0,
             FavouriteControl,
-            AlarmControl
+            AlarmControl,
+            MapControl
         };
 
         class Control
         };
 
         class Control
index 80fbd28..c8127d0 100644 (file)
@@ -42,6 +42,12 @@ void TreeView::testForControlClicked(const QModelIndex &aIndex, const QPoint &aP
                 qDebug() << "ALARM CLICKED: " << qVariantValue<QString>(aIndex.data());
             }
             break;
                 qDebug() << "ALARM CLICKED: " << qVariantValue<QString>(aIndex.data());
             }
             break;
+        case Delegate::MapControl:
+            {
+                // handle Alarm Control clicked
+                qDebug() << "MAP CLICKED: " << qVariantValue<QString>(aIndex.data());
+            }
+        break;
         case Delegate::ControlNone:
         default:
             {
         case Delegate::ControlNone:
         default:
             {