Changed the names of a few constants and modified the files/classes that use them...
authorPekka Nissinen <pekka.nissinen@ixonos.com>
Tue, 10 Aug 2010 12:42:07 +0000 (15:42 +0300)
committerPekka Nissinen <pekka.nissinen@ixonos.com>
Tue, 10 Aug 2010 12:42:07 +0000 (15:42 +0300)
src/ui/indicatorbutton.cpp
src/ui/panelcommon.h
src/ui/zoombuttonpanel.cpp

index 7c699ee..2082dd4 100644 (file)
@@ -124,8 +124,8 @@ void IndicatorButton::mouseMoveEvent(QMouseEvent *event)
 
             if (newLocation.x() < 0)
                 newLocation.rx() = 0;
-            else if (newLocation.x() > m_screenSize.width() - width() - PANEL_PEEK_AMOUNT)
-                newLocation.rx() =  m_screenSize.width() - width() - PANEL_PEEK_AMOUNT;
+            else if (newLocation.x() > m_screenSize.width() - width() - PANEL_BAR_WIDTH)
+                newLocation.rx() =  m_screenSize.width() - width() - PANEL_BAR_WIDTH;
 
             if (newLocation.y() < 0)
                 newLocation.ry() = 0;
index 892bf88..4289313 100644 (file)
@@ -1,4 +1,4 @@
- /*
+/*
     Situare - A location system for Facebook
     Copyright (C) 2010  Ixonos Plc. Authors:
 
@@ -19,7 +19,7 @@
     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
@@ -33,39 +33,23 @@ const int DRAG_INIT_TIME = 1000;        ///< How long buttons must be pressed to
 const int FORCE_RELEASE_TIME = 10000;   ///< How long mouse can be grabbed
 
 // Common panel settings
-enum Side {LEFT, RIGHT};            ///< Enumerator for panel sideness
-
 const int MAEMO5_SCROLLBAR_WIDTH = 8; ///< Width of the Maemo scrollbar
 
-const int PANEL_PEEK_AMOUNT = 27;   ///< Amount of pixels shown when panel is closed
 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 SIDEBAR_WIDTH = 23;                       ///< Width of the sidebar
-const int SIDEBAR_HEIGHT = DEFAULT_SCREEN_HEIGHT - PANEL_TOP_PADDING
-                           - PANEL_BOTTOM_PADDING;  ///< Height of the sidebar
-
-const int SLIDER_BAR_WIDTH = 5;                     ///< Width of the slider bar
-const int SLIDER_BUTTON_OFFSET = 19;                ///< Slider bar button extrusion width
-const int SLIDER_WIDTH = 43;                        ///< Width of the whole slider
-const int SLIDER_HEIGHT = DEFAULT_SCREEN_HEIGHT - PANEL_TOP_PADDING
-                          - PANEL_BOTTOM_PADDING;   ///< Height of the slider
+const int PANEL_BAR_WIDTH = 5;                                          ///< Width of the slider bar
+const int PANEL_TAB_WIDTH = 74;                                         ///< Panel tab (maximum) width
+const int PANEL_BAR_TABBED_WIDTH = PANEL_BAR_WIDTH + PANEL_TAB_WIDTH;   ///< Width of the tabbed bar
+const int PANEL_WIDTH  = 384;                                           ///< Width of the panel
+const int PANEL_HEIGHT = DEFAULT_SCREEN_HEIGHT - PANEL_TOP_PADDING
+                         - PANEL_BOTTOM_PADDING;                        ///< Height of the panel
 
 // Friend list panel settings
-const int FRIENDPANEL_WIDTH  = 426;                     ///< Width of the friends list panel
-const int FRIENDPANEL_HEIGHT = DEFAULT_SCREEN_HEIGHT - PANEL_TOP_PADDING
-                               - PANEL_BOTTOM_PADDING;  ///< Height of the friends list panel
-
-/**
- * @brief Friend list panel inner margin (left)
- *
- * @var FRIENDPANEL_MARGIN_LEFT
- */
-const int FRIENDPANEL_MARGIN_LEFT = SLIDER_BUTTON_OFFSET
-                                    + MAEMO5_SCROLLBAR_WIDTH;
-const int FRIENDPANEL_MARGIN_RIGHT = SIDEBAR_WIDTH;     ///< Friend list panel inner margin (right)
-const int FRIENDPANEL_MARGIN_TOP = 0;                   ///< Friend list panel inner margin (top)
-const int FRIENDPANEL_MARGIN_BOTTOM = 0;                ///< Friend list panel inner margin (bottom)
+const int FRIENDPANEL_MARGIN_LEFT = MAEMO5_SCROLLBAR_WIDTH; ///< Friend list panel inner margin (left)
+const int FRIENDPANEL_MARGIN_RIGHT = 0;                     ///< Friend list panel inner margin (right)
+const int FRIENDPANEL_MARGIN_TOP = 0;                       ///< Friend list panel inner margin (top)
+const int FRIENDPANEL_MARGIN_BOTTOM = 0;                    ///< Friend list panel inner margin (bottom)
 
 /**
  * @brief Friend list filter bar margin (left)
@@ -82,59 +66,37 @@ const int FRIENDPANEL_FILTER_MARGIN_LEFT = FRIENDPANEL_MARGIN_LEFT + 4;
 const int FRIENDPANEL_FILTER_MARGIN_RIGHT = FRIENDPANEL_MARGIN_RIGHT
                                             + MAEMO5_SCROLLBAR_WIDTH + 4;
 
-const int SHOW_ALL_BUTTON_RIGHT_MARGIN = SIDEBAR_WIDTH * 2 - 7; ///< Show all button right margin
+const int SHOW_ALL_BUTTON_RIGHT_MARGIN = 39; ///< Show all button right margin
 
-/**
- * @brief Horizontal position of a closed friend list panel
- *
- * @var FRIENDPANEL_CLOSED_X
- */
-const int FRIENDPANEL_CLOSED_X = DEFAULT_SCREEN_WIDTH - SLIDER_BUTTON_OFFSET
-                                 - PANEL_PEEK_AMOUNT;
+const int PANEL_CLOSED_X = DEFAULT_SCREEN_WIDTH - PANEL_TAB_WIDTH
+                                 - PANEL_BAR_WIDTH; ///< Horizontal position of a closed panel
 
-/**
- * @brief Horizontal position of a open friend list panel
- *
- * @var FRIENDPANEL_OPENED_X
- */
-const int FRIENDPANEL_OPENED_X = DEFAULT_SCREEN_WIDTH - SLIDER_BUTTON_OFFSET - SLIDER_BAR_WIDTH
-                                 - FRIENDPANEL_WIDTH;
+const int PANEL_OPENED_X = DEFAULT_SCREEN_WIDTH - PANEL_TAB_WIDTH - PANEL_BAR_WIDTH
+                                 - PANEL_WIDTH;     ///< Horizontal position of a open panel
 
 // User info panel settings
-const int USERPANEL_WIDTH  = 298;                       ///< Width of the user panel
+const int USERPANEL_WIDTH  = PANEL_WIDTH;         ///< Width of the user panel
 const int USERPANEL_HEIGHT = DEFAULT_SCREEN_HEIGHT - PANEL_TOP_PADDING
                              - PANEL_BOTTOM_PADDING;    ///< Height of the user panel
 
-const int USERPANEL_MARGIN_LEFT = SIDEBAR_WIDTH
-                                  + MAEMO5_SCROLLBAR_WIDTH; ///< User info panel inner margin (left)
-const int USERPANEL_MARGIN_RIGHT = SLIDER_BUTTON_OFFSET;    ///< User info panel inner margin (right)
-const int USERPANEL_MARGIN_TOP = 0;                         ///< User info panel inner margin (top)
-const int USERPANEL_MARGIN_BOTTOM = 0;                      ///< User info panel inner margin (bottom)
+const int USERPANEL_MARGIN_LEFT = FRIENDPANEL_MARGIN_LEFT;      ///< User info panel inner margin (left)
+const int USERPANEL_MARGIN_RIGHT = FRIENDPANEL_MARGIN_RIGHT;    ///< User info panel inner margin (right)
+const int USERPANEL_MARGIN_TOP = FRIENDPANEL_MARGIN_TOP;        ///< User info panel inner margin (top)
+const int USERPANEL_MARGIN_BOTTOM = FRIENDPANEL_MARGIN_BOTTOM;  ///< User info panel inner margin (bottom)
 
-/**
- * @brief Horizontal position of a closed user info panel
- *
- * @var USERPANEL_CLOSED_X
- */
-const int USERPANEL_CLOSED_X = - USERPANEL_WIDTH + PANEL_PEEK_AMOUNT
-                               - SLIDER_BAR_WIDTH;
-const int USERPANEL_OPENED_X = 0;                 ///< Horizontal position of a open user info panel
+const int USERPANEL_CLOSED_X = - USERPANEL_WIDTH + PANEL_BAR_WIDTH
+                               - PANEL_BAR_WIDTH;   ///< Horizontal position of a closed user info panel
+const int USERPANEL_OPENED_X = 0;                   ///< Horizontal position of a open user info panel
 
 // Zoom button panel settings
-const int ZOOM_BUTTON_PANEL_POSITION_X = 10 +
-                                         PANEL_PEEK_AMOUNT; ///< Horizontal position of zoom panel
+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";
 
 // Direction indicator button settings
-/**
- * @brief Horizontal position of direction indicator button
- *
- * @var DIRECTION_INDICATOR_POSITION_X
- */
-const int DIRECTION_INDICATOR_POSITION_X = 10 + PANEL_PEEK_AMOUNT;
+const int DIRECTION_INDICATOR_POSITION_X = 10; ///< Horizontal position of direction indicator button
 const int DIRECTION_INDICATOR_POSITION_Y = 315; ///< Vertical position of direction indicator button
 
 const QString DIRECTION_INDICATOR_BUTTON_POSITION = "Direction_Indicator_Position";
index 64ea554..2a4ef94 100644 (file)
@@ -97,8 +97,8 @@ void ZoomButtonPanel::mouseMoveEvent(QMouseEvent *event)
 
             if (newLocation.x() < 0)
                 newLocation.rx() = 0;
-            else if (newLocation.x() > m_screenSize.width() - width() - PANEL_PEEK_AMOUNT)
-                newLocation.rx() =  m_screenSize.width() - width() - PANEL_PEEK_AMOUNT;
+            else if (newLocation.x() > m_screenSize.width() - width() - PANEL_BAR_WIDTH)
+                newLocation.rx() =  m_screenSize.width() - width() - PANEL_BAR_WIDTH;
 
             if (newLocation.y() < 0)
                 newLocation.ry() = 0;