summaryrefslogtreecommitdiffstats
path: root/hyperui
diff options
context:
space:
mode:
authorAdriano Rezende <adriano.rezende@openbossa.org>2009-10-27 20:31:33 -0300
committerAdriano Rezende <adriano.rezende@openbossa.org>2009-10-29 18:25:06 -0300
commitbade920d37f84f90c0d2845da983b199ef87e138 (patch)
treecdc9a59f78cd3a0e6def085670a621bb370932c8 /hyperui
parente8575e25487bd9fa6c323e0d05dd76e80c0eb54d (diff)
HiperUI: Adjusted main menu organization following design mockup
The icons now are placed in a specific order to simulate a diagonal menu. TODO: In order to not handle clicks in the transparent area the button must support mask shape.
Diffstat (limited to 'hyperui')
-rw-r--r--hyperui/menuview.cpp63
-rw-r--r--hyperui/menuview.h4
-rw-r--r--hyperui/resource/640x360/hyperui.ini7
-rw-r--r--hyperui/resource/640x360/images/menu_bt_calendar.pngbin8001 -> 14412 bytes
-rw-r--r--hyperui/resource/640x360/images/menu_bt_camera.pngbin7990 -> 14371 bytes
-rw-r--r--hyperui/resource/640x360/images/menu_bt_chat.pngbin7542 -> 13669 bytes
-rw-r--r--hyperui/resource/640x360/images/menu_bt_email.pngbin7394 -> 13804 bytes
-rw-r--r--hyperui/resource/640x360/images/menu_bt_folder.pngbin7261 -> 14179 bytes
-rw-r--r--hyperui/resource/640x360/images/menu_bt_games.pngbin8076 -> 14314 bytes
-rw-r--r--hyperui/resource/640x360/images/menu_bt_music.pngbin8263 -> 14651 bytes
-rw-r--r--hyperui/resource/640x360/images/menu_bt_navigation.pngbin9991 -> 16979 bytes
-rw-r--r--hyperui/resource/640x360/images/menu_bt_phone.pngbin7211 -> 24822 bytes
-rw-r--r--hyperui/resource/640x360/images/menu_bt_settings.pngbin9038 -> 15081 bytes
-rw-r--r--hyperui/resource/640x360/images/menu_bt_twitter.pngbin8626 -> 14634 bytes
-rw-r--r--hyperui/resource/640x360/images/menu_bt_web.pngbin9269 -> 15335 bytes
-rw-r--r--hyperui/resource/864x480/hyperui.ini9
-rw-r--r--hyperui/resource/864x480/images/menu_bt_calendar.pngbin11512 -> 19676 bytes
-rw-r--r--hyperui/resource/864x480/images/menu_bt_camera.pngbin11656 -> 19261 bytes
-rw-r--r--hyperui/resource/864x480/images/menu_bt_chat.pngbin10839 -> 18559 bytes
-rw-r--r--hyperui/resource/864x480/images/menu_bt_email.pngbin10853 -> 18945 bytes
-rw-r--r--hyperui/resource/864x480/images/menu_bt_folder.pngbin10526 -> 19630 bytes
-rw-r--r--hyperui/resource/864x480/images/menu_bt_games.pngbin11658 -> 19339 bytes
-rw-r--r--hyperui/resource/864x480/images/menu_bt_music.pngbin12090 -> 19973 bytes
-rw-r--r--hyperui/resource/864x480/images/menu_bt_navigation.pngbin14429 -> 23827 bytes
-rw-r--r--hyperui/resource/864x480/images/menu_bt_phone.pngbin10637 -> 35313 bytes
-rw-r--r--hyperui/resource/864x480/images/menu_bt_settings.pngbin12871 -> 20436 bytes
-rw-r--r--hyperui/resource/864x480/images/menu_bt_twitter.pngbin12368 -> 19693 bytes
-rw-r--r--hyperui/resource/864x480/images/menu_bt_web.pngbin12973 -> 20398 bytes
28 files changed, 42 insertions, 41 deletions
diff --git a/hyperui/menuview.cpp b/hyperui/menuview.cpp
index 9ed83dc..0173b72 100644
--- a/hyperui/menuview.cpp
+++ b/hyperui/menuview.cpp
@@ -29,65 +29,60 @@
**
****************************************************************************/
-#include <QGraphicsGridLayout>
-
#include "global.h"
#include "button.h"
#include "menuview.h"
#include "phoneview.h"
+#define FPOS(i, j) QPointF(leftMargin + vSpacing * i, \
+ topMargin + hSpacing * j)
+
MenuView::MenuView(QGraphicsItem *parent)
: View(parent)
{
setTitle(tr("MENU"));
+ setFlag(QGraphicsItem::ItemHasNoContents);
+ setFlag(QGraphicsItem::ItemClipsChildrenToShape);
// read settings
const int topMargin = Resource::intValue("menu-view/margin-top");
const int leftMargin = Resource::intValue("menu-view/margin-left");
const int vSpacing = Resource::intValue("menu-view/spacing-vertical");
const int hSpacing = Resource::intValue("menu-view/spacing-horizontal");
+ const QPointF &mainIconPos = Resource::value("menu-view/main-icon-pos").toPoint();
// initialize interface
- setFlag(QGraphicsItem::ItemHasNoContents);
+ addIcon(Resource::pixmap("menu_bt_twitter.png"), FPOS(0, 0));
- Button *phoneButton = new Button(Resource::pixmap("menu_bt_phone.png"));
- Button *chatButton = new Button(Resource::pixmap("menu_bt_chat.png"));
- Button *emailButton = new Button(Resource::pixmap("menu_bt_email.png"));
- Button *musicButton = new Button(Resource::pixmap("menu_bt_music.png"));
- Button *gamesButton = new Button(Resource::pixmap("menu_bt_games.png"));
- Button *navigationButton = new Button(Resource::pixmap("menu_bt_navigation.png"));
- Button *folderButton = new Button(Resource::pixmap("menu_bt_folder.png"));
- Button *calendarButton = new Button(Resource::pixmap("menu_bt_calendar.png"));
- Button *settingsButton = new Button(Resource::pixmap("menu_bt_settings.png"));
- Button *cameraButton = new Button(Resource::pixmap("menu_bt_camera.png"));
- Button *webButton = new Button(Resource::pixmap("menu_bt_web.png"));
- Button *twitterButton = new Button(Resource::pixmap("menu_bt_twitter.png"));
+ addIcon(Resource::pixmap("menu_bt_email.png"), FPOS(0, 2));
+ addIcon(Resource::pixmap("menu_bt_settings.png"), FPOS(1, 1));
+ addIcon(Resource::pixmap("menu_bt_music.png"), FPOS(2, 0));
- connect(phoneButton, SIGNAL(clicked()), SLOT(onPhoneClicked()));
+ addIcon(Resource::pixmap("menu_bt_navigation.png"), FPOS(0, 4));
+ addIcon(Resource::pixmap("menu_bt_chat.png"), FPOS(1, 3));
+ addIcon(Resource::pixmap("menu_bt_games.png"), FPOS(2, 2));
+ addIcon(Resource::pixmap("menu_bt_web.png"), FPOS(3, 1));
- QGraphicsGridLayout *layout = new QGraphicsGridLayout();
- layout->setVerticalSpacing(vSpacing);
- layout->setHorizontalSpacing(hSpacing);
- layout->setContentsMargins(leftMargin, topMargin, 0, 0);
+ addIcon(Resource::pixmap("menu_bt_folder.png"), FPOS(1, 5));
+ addIcon(Resource::pixmap("menu_bt_calendar.png"), FPOS(2, 4));
+ addIcon(Resource::pixmap("menu_bt_camera.png"), FPOS(3, 3));
- layout->addItem(phoneButton, 0, 0);
- layout->addItem(chatButton, 0, 1);
- layout->addItem(emailButton, 0, 2);
-
- layout->addItem(musicButton, 1, 0);
- layout->addItem(gamesButton, 1, 1);
- layout->addItem(navigationButton, 1, 2);
+ addIcon(Resource::pixmap("menu_bt_phone.png"),
+ mainIconPos, SLOT(onPhoneClicked()));
+}
- layout->addItem(folderButton, 2, 0);
- layout->addItem(calendarButton, 2, 1);
- layout->addItem(settingsButton, 2, 2);
+Button *MenuView::addIcon(const QPixmap &pixmap, const QPointF &pos,
+ const char *slot)
+{
+ Button *button = new Button(pixmap);
+ button->setParentItem(this);
+ button->setPos(pos);
- layout->addItem(cameraButton, 3, 0);
- layout->addItem(webButton, 3, 1);
- layout->addItem(twitterButton, 3, 2);
+ if (slot)
+ connect(button, SIGNAL(clicked()), slot);
- setLayout(layout);
+ return button;
}
void MenuView::onPhoneClicked()
diff --git a/hyperui/menuview.h b/hyperui/menuview.h
index 62478f3..f649d33 100644
--- a/hyperui/menuview.h
+++ b/hyperui/menuview.h
@@ -44,6 +44,10 @@ public:
protected slots:
void onPhoneClicked();
+
+protected:
+ Button *addIcon(const QPixmap &pixmap, const QPointF &pos,
+ const char *slot = 0);
};
#endif
diff --git a/hyperui/resource/640x360/hyperui.ini b/hyperui/resource/640x360/hyperui.ini
index 9d11953..0a864da 100644
--- a/hyperui/resource/640x360/hyperui.ini
+++ b/hyperui/resource/640x360/hyperui.ini
@@ -18,9 +18,10 @@ margin-top=90
[menu-view]
margin-top=10
-margin-left=18
-spacing-vertical=38
-spacing-horizontal=23
+margin-left=10
+spacing-vertical=72
+spacing-horizontal=72
+main-icon-pos=@Point(-53 416)
[clock-widget]
update-timeout=5000
diff --git a/hyperui/resource/640x360/images/menu_bt_calendar.png b/hyperui/resource/640x360/images/menu_bt_calendar.png
index 99963e1..cf77d08 100644
--- a/hyperui/resource/640x360/images/menu_bt_calendar.png
+++ b/hyperui/resource/640x360/images/menu_bt_calendar.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/menu_bt_camera.png b/hyperui/resource/640x360/images/menu_bt_camera.png
index b1623e4..69742f9 100644
--- a/hyperui/resource/640x360/images/menu_bt_camera.png
+++ b/hyperui/resource/640x360/images/menu_bt_camera.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/menu_bt_chat.png b/hyperui/resource/640x360/images/menu_bt_chat.png
index 61e1cea..b653d6c 100644
--- a/hyperui/resource/640x360/images/menu_bt_chat.png
+++ b/hyperui/resource/640x360/images/menu_bt_chat.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/menu_bt_email.png b/hyperui/resource/640x360/images/menu_bt_email.png
index c1b5b38..615b063 100644
--- a/hyperui/resource/640x360/images/menu_bt_email.png
+++ b/hyperui/resource/640x360/images/menu_bt_email.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/menu_bt_folder.png b/hyperui/resource/640x360/images/menu_bt_folder.png
index a15aac4..001df25 100644
--- a/hyperui/resource/640x360/images/menu_bt_folder.png
+++ b/hyperui/resource/640x360/images/menu_bt_folder.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/menu_bt_games.png b/hyperui/resource/640x360/images/menu_bt_games.png
index 0c32bc2..a225d48 100644
--- a/hyperui/resource/640x360/images/menu_bt_games.png
+++ b/hyperui/resource/640x360/images/menu_bt_games.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/menu_bt_music.png b/hyperui/resource/640x360/images/menu_bt_music.png
index b01fd47..bdaaf8d 100644
--- a/hyperui/resource/640x360/images/menu_bt_music.png
+++ b/hyperui/resource/640x360/images/menu_bt_music.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/menu_bt_navigation.png b/hyperui/resource/640x360/images/menu_bt_navigation.png
index ca4cf44..5b0fb5f 100644
--- a/hyperui/resource/640x360/images/menu_bt_navigation.png
+++ b/hyperui/resource/640x360/images/menu_bt_navigation.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/menu_bt_phone.png b/hyperui/resource/640x360/images/menu_bt_phone.png
index 7c0ee82..1a1eb10 100644
--- a/hyperui/resource/640x360/images/menu_bt_phone.png
+++ b/hyperui/resource/640x360/images/menu_bt_phone.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/menu_bt_settings.png b/hyperui/resource/640x360/images/menu_bt_settings.png
index 7cb3231..2654eea 100644
--- a/hyperui/resource/640x360/images/menu_bt_settings.png
+++ b/hyperui/resource/640x360/images/menu_bt_settings.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/menu_bt_twitter.png b/hyperui/resource/640x360/images/menu_bt_twitter.png
index 564d024..0b2aa98 100644
--- a/hyperui/resource/640x360/images/menu_bt_twitter.png
+++ b/hyperui/resource/640x360/images/menu_bt_twitter.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/menu_bt_web.png b/hyperui/resource/640x360/images/menu_bt_web.png
index bfe9737..a3f590d 100644
--- a/hyperui/resource/640x360/images/menu_bt_web.png
+++ b/hyperui/resource/640x360/images/menu_bt_web.png
Binary files differ
diff --git a/hyperui/resource/864x480/hyperui.ini b/hyperui/resource/864x480/hyperui.ini
index 9994d22..51b09e7 100644
--- a/hyperui/resource/864x480/hyperui.ini
+++ b/hyperui/resource/864x480/hyperui.ini
@@ -17,10 +17,11 @@ label-rect=@Rect(10 10 267 35)
margin-top=120
[menu-view]
-margin-top=10
-margin-left=25
-spacing-vertical=50
-spacing-horizontal=28
+margin-top=18
+margin-left=18
+spacing-vertical=98
+spacing-horizontal=98
+main-icon-pos=@Point(-68 569)
[clock-widget]
update-timeout=5000
diff --git a/hyperui/resource/864x480/images/menu_bt_calendar.png b/hyperui/resource/864x480/images/menu_bt_calendar.png
index c7f0f5d..cdc4f18 100644
--- a/hyperui/resource/864x480/images/menu_bt_calendar.png
+++ b/hyperui/resource/864x480/images/menu_bt_calendar.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/menu_bt_camera.png b/hyperui/resource/864x480/images/menu_bt_camera.png
index 234b399..0bb2b73 100644
--- a/hyperui/resource/864x480/images/menu_bt_camera.png
+++ b/hyperui/resource/864x480/images/menu_bt_camera.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/menu_bt_chat.png b/hyperui/resource/864x480/images/menu_bt_chat.png
index eab4a48..b5912f5 100644
--- a/hyperui/resource/864x480/images/menu_bt_chat.png
+++ b/hyperui/resource/864x480/images/menu_bt_chat.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/menu_bt_email.png b/hyperui/resource/864x480/images/menu_bt_email.png
index 97f2047..9168c48 100644
--- a/hyperui/resource/864x480/images/menu_bt_email.png
+++ b/hyperui/resource/864x480/images/menu_bt_email.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/menu_bt_folder.png b/hyperui/resource/864x480/images/menu_bt_folder.png
index 689e5d3..80acd14 100644
--- a/hyperui/resource/864x480/images/menu_bt_folder.png
+++ b/hyperui/resource/864x480/images/menu_bt_folder.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/menu_bt_games.png b/hyperui/resource/864x480/images/menu_bt_games.png
index 6d265c8..64facc0 100644
--- a/hyperui/resource/864x480/images/menu_bt_games.png
+++ b/hyperui/resource/864x480/images/menu_bt_games.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/menu_bt_music.png b/hyperui/resource/864x480/images/menu_bt_music.png
index 073e9a3..4d14fdf 100644
--- a/hyperui/resource/864x480/images/menu_bt_music.png
+++ b/hyperui/resource/864x480/images/menu_bt_music.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/menu_bt_navigation.png b/hyperui/resource/864x480/images/menu_bt_navigation.png
index da37631..90835be 100644
--- a/hyperui/resource/864x480/images/menu_bt_navigation.png
+++ b/hyperui/resource/864x480/images/menu_bt_navigation.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/menu_bt_phone.png b/hyperui/resource/864x480/images/menu_bt_phone.png
index 567c76c..f6978f5 100644
--- a/hyperui/resource/864x480/images/menu_bt_phone.png
+++ b/hyperui/resource/864x480/images/menu_bt_phone.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/menu_bt_settings.png b/hyperui/resource/864x480/images/menu_bt_settings.png
index 3bcecc4..87bba74 100644
--- a/hyperui/resource/864x480/images/menu_bt_settings.png
+++ b/hyperui/resource/864x480/images/menu_bt_settings.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/menu_bt_twitter.png b/hyperui/resource/864x480/images/menu_bt_twitter.png
index 8cddefb..7904c00 100644
--- a/hyperui/resource/864x480/images/menu_bt_twitter.png
+++ b/hyperui/resource/864x480/images/menu_bt_twitter.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/menu_bt_web.png b/hyperui/resource/864x480/images/menu_bt_web.png
index ecbbdf8..4e11f6a 100644
--- a/hyperui/resource/864x480/images/menu_bt_web.png
+++ b/hyperui/resource/864x480/images/menu_bt_web.png
Binary files differ