Re-factoring
[situare] / src / ui / panelcommon.h
index 51e1d31..c3fcd64 100644 (file)
@@ -1,8 +1,10 @@
- /*
+/*
     Situare - A location system for Facebook
     Copyright (C) 2010  Ixonos Plc. Authors:
 
         Kaj Wallin - kaj.wallin@ixonos.com
+        Katri Kaikkonen - katri.kaikkonen@ixonos.com
+        Pekka Nissinen - pekka.nissinen@ixonos.com
 
     Situare is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License
     along with Situare; if not, write to the Free Software
     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
     USA.
- */
+*/
 
 #ifndef PANELCOMMON_H
 #define PANELCOMMON_H
 
-#include <QtCore>
-#include "map/mapcommon.h"
+#include <QString>
 
-const int PANEL_PEEK_AMOUNT = 25; ///< Amount of pixels shown when panel is closed
+#include "common.h"
 
-const int FRIENDPANEL_WIDTH  = 420; ///< Width of the friends list panel
-const int FRIENDPANEL_HEIGHT = DEFAULT_SCREEN_HEIGHT; ///< Height of the friends list panel
+// Dragging settings
+const int DRAG_INIT_TIME = 1000;        ///< How long buttons must be pressed to start drag mode
+const int FORCE_RELEASE_TIME = 10000;   ///< How long mouse can be grabbed
 
-const int USERPANEL_WIDTH  = 300; ///< Width of the user panel
-const int USERPANEL_HEIGHT = DEFAULT_SCREEN_HEIGHT; ///< Height of the user panetl
+// Common panel settings
+const int MAEMO5_SCROLLBAR_WIDTH = 8; ///< Width of the Maemo scrollbar
 
-const int MARGIN_CORRECTION = 1; ///< Amount of correction to make panels touch the window borders
-const int MARGIN_CORRECTION2 = 2; ///< Amount of correction to make panels touch the window borders
+const int PANEL_TOP_PADDING = 0;    ///< Amount of padding in top of panels
+const int PANEL_BOTTOM_PADDING = 0; ///< Amount of padding in bottom of panels
 
-const int PANEL_TOP_Y = 0; ///< Y coordinate for top of both panels
+const int PANEL_BAR_WIDTH = 5;                                              ///< Width of the slider bar
+const int PANEL_TAB_BAR_WIDTH = 74;                                         ///< Panel tab bar total width
+const int PANEL_BAR_TABBED_WIDTH = PANEL_BAR_WIDTH + PANEL_TAB_BAR_WIDTH;   ///< Width of the tabbed bar
+const int PANEL_WIDTH  = 384;                                               ///< Width of the panel contents area
+const int PANEL_HEIGHT = DEFAULT_SCREEN_HEIGHT - PANEL_TOP_PADDING
+                         - PANEL_BOTTOM_PADDING;                            ///< Height of the panel
 
-const int FRIENDPANEL_CLOSED_X =
-        DEFAULT_SCREEN_WIDTH-PANEL_PEEK_AMOUNT; ///< X location of the friend list panel when closed
-const int FRIENDPANEL_OPENED_X =
-        DEFAULT_SCREEN_WIDTH-FRIENDPANEL_WIDTH; ///< X location of the friend list panel when opened
+const int PANEL_MARGIN_LEFT = MAEMO5_SCROLLBAR_WIDTH; ///< Panel inner margin (left)
+const int PANEL_MARGIN_RIGHT = 0;                     ///< Panel inner margin (right)
+const int PANEL_MARGIN_TOP = 0;                       ///< Panel inner margin (top)
+const int PANEL_MARGIN_BOTTOM = 0;                    ///< Panel inner margin (bottom)
 
-const int USERPANEL_CLOSED_X =
-        0 - USERPANEL_WIDTH + PANEL_PEEK_AMOUNT;  ///< X location of the user panel when closed
-const int USERPANEL_OPENED_X = 0;     ///< X location of the user panel when opened
+const int PANEL_CLOSED_X = DEFAULT_SCREEN_WIDTH - PANEL_TAB_BAR_WIDTH
+                                 - PANEL_BAR_WIDTH; ///< Horizontal position of a closed panel
 
-const int SIDEBAR_WIDTH = 23;
-const int SIDEBAR_HEIGHT = 424;
+const int PANEL_OPENED_X = DEFAULT_SCREEN_WIDTH - PANEL_TAB_BAR_WIDTH - PANEL_BAR_WIDTH
+                                 - PANEL_WIDTH;     ///< Horizontal position of a open panel
 
-const int SLIDINGBAR_WIDTH = 24;
-const int SLIDINGBAR_HEIGHT = 424;
+// Zoom button panel settings
+const int ZOOM_BUTTON_PANEL_POSITION_X = 10; ///< Horizontal position of zoom panel
+const int ZOOM_BUTTON_PANEL_POSITION_Y = 10; ///< Vertical position of zoom panel
+const int ZOOM_BUTTON_PANEL_BUTTON_SPACING = 4; ///< Size of a zoom button spacing
+
+const QString ZOOMPANEL_POSITION = "Zoom_Panel_Position";
 
 #endif // PANELCOMMON_H