util/s60pixelmetrics/pixel_metrics.cpp
changeset 25 e24348a560a6
parent 23 89e065397ea6
equal deleted inserted replaced
23:89e065397ea6 25:e24348a560a6
    48 
    48 
    49 // Version number for dynamic calculations. These are to be exported to static data,
    49 // Version number for dynamic calculations. These are to be exported to static data,
    50 // so that we can keep dynamic and static values inline.
    50 // so that we can keep dynamic and static values inline.
    51 // Please adjust version data if correcting dynamic PM calculations.
    51 // Please adjust version data if correcting dynamic PM calculations.
    52 const TInt KPMMajorVersion = 1;
    52 const TInt KPMMajorVersion = 1;
    53 const TInt KPMMinorVersion = 18;
    53 const TInt KPMMinorVersion = 19;
    54 
    54 
    55 TPixelMetricsVersion PixelMetrics::Version()
    55 TPixelMetricsVersion PixelMetrics::Version()
    56     {
    56     {
    57     TPixelMetricsVersion version;
    57     TPixelMetricsVersion version;
    58     version.majorVersion = KPMMajorVersion;
    58     version.majorVersion = KPMMajorVersion;
   466             TAknLayoutRect sliderRect;
   466             TAknLayoutRect sliderRect;
   467             sliderRect.LayoutRect( settingContentRect.Rect(), AknLayoutScalable_Avkon::setting_slider_graphic_pane() );
   467             sliderRect.LayoutRect( settingContentRect.Rect(), AknLayoutScalable_Avkon::setting_slider_graphic_pane() );
   468             TAknLayoutRect sliderSettingRect;
   468             TAknLayoutRect sliderSettingRect;
   469             sliderSettingRect.LayoutRect( sliderRect.Rect(), AknLayoutScalable_Avkon::slider_set_pane_cp() );
   469             sliderSettingRect.LayoutRect( sliderRect.Rect(), AknLayoutScalable_Avkon::slider_set_pane_cp() );
   470             TAknLayoutRect sliderGraph2Rect;
   470             TAknLayoutRect sliderGraph2Rect;
   471             sliderGraph2Rect.LayoutRect( sliderSettingRect.Rect(), AknLayoutScalable_Avkon::slider_set_pane_g2() );
   471             sliderGraph2Rect.LayoutRect( sliderSettingRect.Rect(), AknLayoutScalable_Avkon::slider_set_pane_g6() );
   472             value = sliderGraph2Rect.Rect().Width();
   472             value = sliderGraph2Rect.Rect().Width();
   473             }
   473             }
   474             break;
   474             break;
   475         case QStyle::PM_SliderThickness:
   475         case QStyle::PM_SliderThickness:
   476             {
   476             {
   481             TAknLayoutRect sliderRect;
   481             TAknLayoutRect sliderRect;
   482             sliderRect.LayoutRect( settingContentRect.Rect(), AknLayoutScalable_Avkon::setting_slider_graphic_pane() );
   482             sliderRect.LayoutRect( settingContentRect.Rect(), AknLayoutScalable_Avkon::setting_slider_graphic_pane() );
   483             TAknLayoutRect sliderSettingRect;
   483             TAknLayoutRect sliderSettingRect;
   484             sliderSettingRect.LayoutRect( sliderRect.Rect(), AknLayoutScalable_Avkon::slider_set_pane_cp() );
   484             sliderSettingRect.LayoutRect( sliderRect.Rect(), AknLayoutScalable_Avkon::slider_set_pane_cp() );
   485             TAknLayoutRect sliderGraph2Rect;
   485             TAknLayoutRect sliderGraph2Rect;
   486             sliderGraph2Rect.LayoutRect( sliderSettingRect.Rect(), AknLayoutScalable_Avkon::slider_set_pane_g2() );
   486             sliderGraph2Rect.LayoutRect( sliderSettingRect.Rect(), AknLayoutScalable_Avkon::slider_set_pane_g6() );
       
   487             //todo: make a proper calculation for tick marks
   487             value = (TInt)(sliderGraph2Rect.Rect().Height()*1.5); // add assumed tickmark height
   488             value = (TInt)(sliderGraph2Rect.Rect().Height()*1.5); // add assumed tickmark height
   488             }
   489             }
   489             break;
   490             break;
   490         case QStyle::PM_SliderTickmarkOffset:
   491         case QStyle::PM_SliderTickmarkOffset:
   491             {
   492             {
   496             TAknLayoutRect sliderRect;
   497             TAknLayoutRect sliderRect;
   497             sliderRect.LayoutRect( settingContentRect.Rect(), AknLayoutScalable_Avkon::setting_slider_graphic_pane() );
   498             sliderRect.LayoutRect( settingContentRect.Rect(), AknLayoutScalable_Avkon::setting_slider_graphic_pane() );
   498             TAknLayoutRect sliderSettingRect;
   499             TAknLayoutRect sliderSettingRect;
   499             sliderSettingRect.LayoutRect( sliderRect.Rect(), AknLayoutScalable_Avkon::slider_set_pane_cp() );
   500             sliderSettingRect.LayoutRect( sliderRect.Rect(), AknLayoutScalable_Avkon::slider_set_pane_cp() );
   500             TAknLayoutRect sliderGraph2Rect;
   501             TAknLayoutRect sliderGraph2Rect;
   501             sliderGraph2Rect.LayoutRect( sliderSettingRect.Rect(), AknLayoutScalable_Avkon::slider_set_pane_g2() );
   502             sliderGraph2Rect.LayoutRect( sliderSettingRect.Rect(), AknLayoutScalable_Avkon::slider_set_pane_g6() );
       
   503             //todo: make a proper calculation for tick marks
   502             value = (TInt)(sliderGraph2Rect.Rect().Height()*0.5); // no tickmarks in S60, lets assume they are half the size of slider indicator
   504             value = (TInt)(sliderGraph2Rect.Rect().Height()*0.5); // no tickmarks in S60, lets assume they are half the size of slider indicator
   503             }
   505             }
   504             break;
   506             break;
   505         case QStyle::PM_SliderControlThickness:
   507         case QStyle::PM_SliderControlThickness:
   506             {
   508             {
   511             TAknLayoutRect sliderRect;
   513             TAknLayoutRect sliderRect;
   512             sliderRect.LayoutRect( settingContentRect.Rect(), AknLayoutScalable_Avkon::setting_slider_graphic_pane() );
   514             sliderRect.LayoutRect( settingContentRect.Rect(), AknLayoutScalable_Avkon::setting_slider_graphic_pane() );
   513             TAknLayoutRect sliderSettingRect;
   515             TAknLayoutRect sliderSettingRect;
   514             sliderSettingRect.LayoutRect( sliderRect.Rect(), AknLayoutScalable_Avkon::slider_set_pane_cp() );
   516             sliderSettingRect.LayoutRect( sliderRect.Rect(), AknLayoutScalable_Avkon::slider_set_pane_cp() );
   515             TAknLayoutRect sliderGraph2Rect;
   517             TAknLayoutRect sliderGraph2Rect;
   516             sliderGraph2Rect.LayoutRect( sliderSettingRect.Rect(), AknLayoutScalable_Avkon::slider_set_pane_g2() );
   518             sliderGraph2Rect.LayoutRect( sliderSettingRect.Rect(), AknLayoutScalable_Avkon::slider_set_pane_g6() );
   517             value = sliderGraph2Rect.Rect().Height();
   519             value = sliderGraph2Rect.Rect().Height();
   518             }
   520             }
   519             break;
   521             break;
   520         case QStyle::PM_SliderSpaceAvailable:
   522         case QStyle::PM_SliderSpaceAvailable:
   521             {
   523             {