summaryrefslogtreecommitdiffstats
path: root/src/gui/styles/qs60style.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '4.7-review' into 4.7-stagingThierry Bastian2011-01-171-2/+4
|\
| * Build failure fix (related to QT-4079)Sami Merila2011-01-101-1/+1
| | | | | | | | | | | | | | | | | | | | Change d281cea3a445aa244901decceffd7d653ed829c8 caused build failure, due to missing comma (one line missing from commit). Fixed by adding the missing change. Task-number: QT-4079 Reviewed-by: Miikka Heikkinen
| * QWidgets support for VGA screenSami Merila2011-01-101-1/+3
| | | | | | | | | | | | | | Add pixelmetrics data for QS60Style to support VGA screensizes. Task-number: QT-4079 Reviewed-by: Miikka Heikkinen
* | Update copyright year to 2011.Jason McDonald2011-01-101-1/+1
|/ | | | Reviewed-by: Trust Me
* Remove support for automatic tactile feedback from QS60StyleSami Merila2010-12-161-3/+0
| | | | | | | | | | | | | | | Currently QS60Style loads automatically a plugin to support tactile feedback for styled applications. However, there is no control over this, so applications cannot remove the automatic support, if they'd like to use Mobility APIs to control the feedback themselves. In order to avoid this, remove tactile feedback plugin from style. Lets see if we can later put this back with optional enable/disable flag. Task-number: QTBUG-16151 Reviewed-by: Miikka Heikkinen
* Fix whitespace in qs60style.cppSami Merila2010-12-101-1/+1
| | | | Reviewed-by: TrustMe
* QDateTimeEdit is not showing correctly when resizes in symbianSami Merila2010-12-101-22/+16
| | | | | | | | | | | | | | | | The problem boils down to using large square area for QDateTime widget (which is more or less a date-aware combobox). Style tries to make the combobox button as wide as it is tall, and as button is as tall as the combobox frame, it steals the whole square widget for itself. To fix this, we now limit the combobox button height to be no more than fourth of the total width of the widget. Thus, in normal, non-resized case, button is, as tall as the frame, but as widget is made larger, button stops to grow after reaching quarter of width of the widget. Task-number: QT-4312 Reviewed-by: Janne Koskinen
* QS60Style: Null pointer crash when using itemviews in some cases (pt2)Sami Merila2010-11-191-2/+2
| | | | | | | Also remove accidentally added whitespaces. Task-number: QTBUG-15455 Reviewed-by: TrustMe
* Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-water-team into 4.7Sami Merila2010-11-191-0/+50
|\
| * QToolbar should fill available width on SymbianSami Merila2010-11-181-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Normally QStyle provides a minimum size for a widget. However, to imitate native toolbar behavior, QToolBar should occupy available screen estate on Symbian (with QS60Style). This is only supported for horizontal QToolBars as native side does not have same functionality for vertical toolbars. QToolbar size now tries to take into account available size of parent reduced by margins (if several parents, then each can reduce the available space by their margins). Also, toolbar internal pixel metrics data (item spacing, item margins) are taken into account. Task-number: QTBUG-13120 Reviewed-by: Janne Koskinen
* | QS60Style: Null pointer crash when using itemviews in some casesSami Merila2010-11-191-4/+5
|/ | | | | | | | | QS60Style attempts to use null pointer when drawing CE_ItemViewItem, if the parameter widget is provided as null. This leads to, for example, Chart example app crash in startup. Reviewed-by: Janne Anttila
* Doc: Fixing typoSergio Ahumada2010-11-111-1/+1
|
* QS60Style: Color calculation should be optimizedSami Merila2010-11-091-57/+50
| | | | | | | | | | | | | | | | | | | | | | | | | Currently, QS60Style calculates some palette colors (tooltip base and button). Since native side does not have a color for these, but a nine-part theme graphic, the style tries to estimate the color of the bitmap by taking a small sample of the QPixmap and calculate the RGB colors of 32*32 pixels. This is rather slow, it takes around 110 msecs for each QApplication, when the application is started. Note that color is cached to member variable of style, but it is very rarely asked again (as the color is polished to all widgets/apps) and the cache is not shared across processes. As a fix, style now calculates the button color (tooltip color is no longer calculated, as no other QStyle does that, and tooltips do not anyway work in the Qt/Symbian) and stores the calculated value to Global QSettings together with active theme ID. Now, when a second Qt application is launched, the stored theme ID value is matched with currently active theme. If it matches, then the stored Button color is used. Otherwise, color is again calculated and stored. If theme is unchanged, the application launch is ~95msecs faster. Task-number: QTBUG-14860 Reviewed-by: Jani Hautakangas
* Remove code changes that were NOT intended as part of the fixSami Merila2010-11-041-18/+0
| | | | | | | | | For some unknown reasons (read: missed git checkout -f), few code line changes which were NOT part of fix for QTBUG-14331 crept into the commit. These are now removed with this fix. Task-number: QTBUG-14331 Reviewed-by: Janne Anttila
* Qt/Symbian: QInputDialog layout and size are wrongSami Merila2010-11-031-2/+20
| | | | | | | | | | | | | | | | The QInputDialog with anything but QLineEdit as the input widget, will show up as minimal size on device/emulator. Also, the dialog looks bad since the widgets are deployed very close to the dialog borders. As a fix, layout will not get the size policy set on Symbian, but the dialog itself is stretched to occupy screen width and thus, layout grows to occupy the available size. Additionally, style will set layout pixel metrics for dialogs larger than for other widgets, to avoid the layout from putting widgets very close to dialog border. Task-number: QTBUG-14331 Reviewed-by: Janne Anttila
* Support tactile feeedback from QS60Style for QWidgetsSami Merila2010-10-291-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently tactile feedback is not given for QWidgets running on Symbian even if the native side supports this (Sym^3 and 5th Edition devices). This task adds support for QWidgets having QS60Style. The tactile feedback has been implemented as a plugin that the style loads when instantiating itself for touch devices. NOTE that the feedback is NOT supported by the emulated style, nor is the plugin interface public, so it cannot be used outside of style. The implementation is simplistic, since we only want to provide stop-gap solution until 4.8 when real Qt feedback implementation is ready. The implementation will only give feedback for touch-down events for visible, interactive and enabled widgets. Sliders and scrollbars will use sensitive feedback (slightly less aggressive) and all others will use basic feedback. Note that Sym^3 adds tens of different feedback categories, which this plugin ignores as we want to share the same implementation for Sym^3 and 5th ed. In distributed Qt package there is no tactile feedback for 5th edition, due to package creation limitations. Support can be added manually by re-compiling Qt on top of 5th Edition SDK. Task-number: QT-4037 Reviewed-by: Jani Hautakangas Reviewed-by: Janne Koskinen
* QS60Style: The QComboBox/QSpinBox text color is not according to themeSami Merila2010-10-211-4/+1
| | | | | | | | | Theme text colors are incorrect for spinboxes and comboboxes, they should have same theme colors as lineedit has, as they are using same graphic for "editor" sub-control in them. Task-number: QT-4176 Reviewed-by: Miikka Heikkinen
* QS60Style: ComboBox disappears after orientation switchSami Merila2010-10-181-0/+2
| | | | | | | | | | | | | This is due to that QS60Style uses desktop area for a bounding rect of combobox content to disallow it to grow outside of screen size. Unfortunately with some recent changes to screensize handling in desktop widget size makes the desktop resize to happen later than when style is asked for combobox size. So, style returns invalid QSize for combobox content size. As a fix, if the returned size is invalid, ask it directly from QCommonStyle. Task-number: QTBUG-14423 Reviewed-by: Janne Anttila
* QS60Style: Highlighted TreeBranch indicator is incorrectSami Merila2010-10-061-1/+1
| | | | | | | | | | | Part of the fix for QTBUG-13553 incorrectly uses commonstyle to draw branch highlight, when it should use QS60Style. As a fix, commonstyle should not be used unless theme palette has been tempered with. Task-number: QTBUG-13699 Reviewed-by: Miikka Heikkinen
* QS60Style: QDateEdit - Layout issuesSami Merila2010-10-051-7/+2
| | | | | | | | | | | | | | | In portrait orientation, QDateEdit's calendar popup (QCalendarWidget) does not fit into screen. As a fix, the pixel metric PM_FocusFrameHMargin, is reduced from 13 to 3 in qHD screens (640*360). Also, the explicit halving of the pixel metric for QTableViews is removed. The pixel metric resulted in 27 pixel text margins (2 * pm + 1)for calendar widgets, which is clearly a bit too much. Task-number: QTBUG-14126 Reviewed-by: Miikka Heikkinen
* QS60Style: Possible NULL pointer use when drawing frameSami Merila2010-09-301-1/+1
| | | | | | | | | QS60Style::drawControl casts QStyleOption pointer to QStyleOptionFrame, yet never checks if the orginal pointer was NULL or not. The casted pointer is then used to fetch palette information from style option. Thus, this might lead to crash. Reviewed-by: Miikka Heikkinen
* Button remains pressed if release event happens outside of widgetSami Merila2010-09-211-2/+1
| | | | | | | | | | | | | QS60Style tracks the pressed down state for itemviews and some other widgets that required highlight pressed down graphics. However, the implementation was faulty as it required that a mouse release event occurs in another widget, instead of anywhere. This partially fixes QTBUG-13759. Task-number: QTBUG-13759 Reviewed-by: Jani Hautakangas
* QS60Style does not show checkbox for checkable item in QTreeViewSami Merila2010-09-171-2/+2
| | | | | | | | | | QS60Style currently skips drawing of checkbox for checkable itemviews. It however reserves space for the checkbox in the itemview item row. As a fix, also draw the checkbox. Task-number: QTBUG-11150 Reviewed-by: Shane Kearns
* Panic in qs60style.cpp while drawing a QTreeViewSami Merila2010-09-171-11/+25
| | | | | | | | | | | | | | | QS60Style crashes when running a test application that modifies active style AND application's palette. After switching to other style, setting palette to application default, re-enabling the style's palette and activating QS60Style, causes a crash. This is due to that internal theme palette is tried to access, before it is constructed. Fixed by making sure that when theme palette is accessed, it is not NULL. Task-number: QTBUG-13553 Reviewed-by: Miikka Heikkinen
* QS60style: itemview selection indication works incorrectlySami Merila2010-09-161-17/+23
| | | | | | | | | | | | | | Currently QS60Style shows tick mark for listWidget with multiselection capability only after two or more items are selected. This is fixed so that selection indication is shown in multiselection itemviews (all of them and not just list widget) irregardless of number of selected items. Also, if itemview loses focus with singleitem itemview, style now still draws item highlight to it (with 50% transparency). Task-number: QTBUG-12875, QTBUG-13072 Reviewed-by: Janne Anttila
* QS60Style: QToolbar button and checked state is not shownSami Merila2010-09-031-10/+7
| | | | | | | | | QS60Style ignores Style_On state for QToolButton drawing. This has been fixed, so that when toolbutton is "on", button is drawn with pressed down graphics. Task-number: QTBUG-13099 Reviewed-by: Alessandro Portale
* Plug memory leak from QS60StyleSami Merila2010-09-031-0/+3
| | | | | | | | | Currently style leaks an animation object (QS60StyleAnimation) when style is destroyed. To avoid this, animation object array is deleted in the style's destructor. Task-number: QTBUG-13145 Reviewed-by: mread
* QS60Style: Itemviews are drawn incorrectlySami Merila2010-09-011-1/+5
| | | | | | | | | | | | | | | | | When running QS60Style on hardware, all the itemview items without any special background (i.e. not "pressed", not "highlighted", not "alternate") are drawn with "pressed button" graphics. This is due that the internal drawing function gets called without any enum value set and it seem to pick the second enumeration constant from theme element list. The enumeration constant is not defined to match to any integer value. As a solution, style will not call the drawing function when theme element is not defined. Task-number: QTBUG-11601 Reviewed-by: Liang Qi
* QS60Style: Simplify QMenu drawingSami Merila2010-07-021-35/+32
| | | | | | | | This cleans up implementation of menu item drawing and "fixes" it, by moving the rect calculations to occur in subElementRect() method, instead of in the drawing code itself. Reviewed-by: Alessandro Portale
* QS60Style: Remove gap from QProgressDialogSami Merila2010-07-021-0/+5
| | | | | | | | When showing a progressDialog with QS60Style, there is a strange empty area after the QProgressbar. This is reserved for label even if it is not showing one. Reviewed-by: Alessandro Portale
* ComboBox popuplist is not correctly layouted in fullscreen modeSami Merila2010-06-151-10/+1
| | | | | | | | | | | This is part two of the fix for issue QTBUG-9913. This corrects the left margin of the ComboBox menu to start from the left screen border (for LetToRight UI Layout), instead of having small margin. Task-number: QTBUG-9913 Reviewed-by: Alessandro Portale
* Stylus menu for Share (QT app) is different from native S60 appsSami Merila2010-06-151-31/+35
| | | | | | | | | | | | | | | | | | | This is part two of the fix. This fix makes the menu item to be layoutted always with space reserved for checkbox indicator, even if the menu item is not having one (just like native side). Also, the right and left "gap areas" (between menu border and menu item highlight) match the native side more closely now. There is still some difference if using QMenu (instead of QComboBoxListView), since we can't just ignore margin set from widget. Also, the Sym^3 "separator lines" are now started from correct position. Finally, the menu item height now matches the native side. Task-number: QT-3295 Reviewed-by: Alessandro Portale
* Stylus menu for Share (QT app) is different from native S60 appsSami Merila2010-06-111-17/+59
| | | | | | | | | | | | | First part of corrections to make menu items more native like. This fixes: - In Sym^3 "separator items" are drawn automatically between items, using a simple line graphic with theme color and alpha values - highlight for menu item is positioned better - menu items themselves are better positioned - the corners of highlight are now more rounded for Sym^3 devices Task-number: QT-3295 Reviewed-by: Alessandro Portale
* Incorrectly named keys in QS60StyleEnums::SkinPartsSami Merila2010-06-111-6/+6
| | | | | | | | | | | Some of the internal part names of QS60Style do not match the real theme item names, making automated tool use to make "theme blob" for QCreator simulator manual work. Renamed the parts to match native side names. Task-number: QTBUG-11053 Reviewed-by: Alessandro Portale
* QS60Style: QComboBox displays checkboxes for itemsSami Merila2010-06-101-1/+8
| | | | | | | | | | | | QComboMenuDelegate claims that all combobox menu items should be checkable even if they aren't. In all the other styles, it has been circumvented in the style code that this particular setting from QComboMenuDelegate is ignored. :) Adding the same workaround to QS60Style as well. Task-number: QTBUG-11322 Reviewed-by: Alessandro Portale
* QS60Style: In S60 3.x and 5.0 Qt itemviews behaviour is not nativelikeSami Merila2010-05-141-3/+7
| | | | | | | | | | | | | Currently style defines QStyle::SH_ItemView_ActivateItemOnSingleClick, which leads to itemview item activation only occur on double-click (or tap). The item selection work native-like on Sym^3. As a correction, style needs to check the passed styleoption and check whether or not the state "Selected" is on. In these cases, the itemactivation can proceed. Task-number: QTBUG-10697 Reviewed-by: Miikka Heikkinen
* QS60Style will draw focus frame to a PushButton with any stylesheetingSami Merila2010-05-101-2/+3
| | | | | | | | | | | Due to incorrect braces in the if-within-if, QS60Style decided to use QCommonStyle for styling focus frame into QPushButton when button had *any* kind of stylesheet. Corrected the braces. Task-number: QTBUG-10549 Reviewed-by: Alessandro Portale
* QS60Style: QTreeView branch indicators are drawn incorrectly in RtoLSami Merila2010-05-071-34/+36
| | | | | | | | | | | | QS60Style tries to rotate branch graphics around the x-axis, when it is running in RtoL UI direction. This makes the "L-shaped" branch indicators to point to too high at the item view item. Branch indicators should be mirrored across the x-axis to make them look fine. Task-number: QTBUG-9844 Reviewed-by: Alessandro Portale
* QS60Style: Housekeeping taskSami Merila2010-05-071-13/+7
| | | | | | | Fix whitespace, remove unneeded code, break very long lines to two rows. Reviewed-by: Alessandro Portale
* QS60Style - PushButton with text and with icon should be of same sizeSami Merila2010-05-071-1/+1
| | | | | | | | | | | | When pushbutton contains standardIcon or non-modified text, it should be of same size. As a fix, style now checking default text height for icon pushbuttons and if the icon is smaller than text height, style will make button to match text height content. Task-number: QT-2179 Reviewed-by: Alessandro Portale
* QS60Style: When context menu is open ToolButton is not pressed downSami Merila2010-05-071-5/+3
| | | | | | | | | | | | QS60Style prefers to use widget and calls its down() API. The value is not true unless tool button has been set down programmatically. Thus, we should rely on State_Sunken as well. As a fix, style asks from both the widget and checks the state before drawing button raised/pressed. Task-number: QTBUG-10487 Reviewed-by: Alessandro Portale
* QS60Style: Sliders are too smallSami Merila2010-05-061-10/+9
| | | | | | | | | | | | | | | Sometime back slider graphic in the QS60Style was changed to use the "new" slider graphic available in 5th Edition and newer SDKs (the old SDKs still use the slider graphic). However, at that time nobody noticed that the new slider has different size than the old one in the Nokia LAF document. To fix the sliders, updated the pixel metrics calculation rules to use the new slider LAF data. Also fixed a grpahic start and end part rounding to match native look. Task-number: QTBUG-10454 Reviewed-by: Alessandro Portale
* QS60Style: QCalendarWidget draws only one-digit datesSami Merila2010-05-051-0/+8
| | | | | | | | | | | | Due to largish pixel metrics values for text margins, content does not fit into QCalendarWidget date-cells. To fix this, the failing pixel metric values are halved for QTableViews and its derivatives. This matches native margins almost perfectly (depending on native layout 1-2 pixel offset). Task-number: QTBUG-10417 Reviewed-by: Alessandro Portale
* QS60Style: QTabWidget icon size property doesn't workSami Merila2010-05-041-2/+3
| | | | | | | | | | | QS60Style did check if the tab icon size was larger than pixel metric for default tab icon size. If it was, then it reset the icon size to match pixel metric. It was impossible to set large icon to tab widget. As a fix, this check was removed from style. Task-number: QTBUG-3102 Reviewed-by: Jason Barron
* QS60Style: QTabWidget Usability issue with capacitive screensSami Merila2010-05-031-11/+55
| | | | | | | | | | | | | | | | | | Normally Qt uses scrollbuttons together at right (for LeftToRight UI) side of the horizontal QTabBar; for vertical tab bar, scrollbuttons are displayed below/above the widget. Using QTabBar's scroll buttons with touch device that has capacitive screen, is somewhat hard as the touch area for either of the scroll buttons is somewhat smallish. So user is experiencing frequent wrong taps. Making the touch area larger, would make the tabbar tab shape area smaller, so it isn't a very good solution. Therefore, when QS60Style is in use, QTabWidget draws the scrollbuttons on either side of the QTabBar. Task-number: QT-3104 Reviewed-by: Alessandro Portale
* QS60Style: Menu separators are not drawn, yet they take up screen spaceSami Merila2010-04-261-0/+6
| | | | | | | | | | | | Currently, QS60Style does not draw menu separators at all, yet they are calculated to take screen estate. Remove the screen reservation from them. See also QTBUG-10054 for details to add menu separator support to style. Task-number: QTBUG-10191 Reviewed-by: Alessandro Portale
* QS60Style: QMenu behaves badly with a lot of menu itemsSami Merila2010-04-261-9/+16
| | | | | | | | | | | | | | | | | Due to recent change in QS60Style where combobox menu was changed to popup menu, instead of dropdown menu, long QMenus now work sloppily. This is due to that pixel metric PE_MenuScrollerHeight was set to zero to avoid "non-drawn" areas in combobox popups. Of course, QMenu scrolling really needs the scrolling area if it is to make any scrolling. As a solution, scroller height is now zero for combobox popup and in QMenu it is the height of itemview item (for "standard" content), but no any scroller indication is drawn. The menu scrolls automatically when bottom/top part of menu list is highlighted. Task-number: QTBUG-10073 Reviewed-by: Janne Koskinen
* QS60Style: Style draws a focus frame to context menus and popupsSami Merila2010-04-201-0/+6
| | | | | | | | | | | | | | Currently QS60Style draws a ficus frame around context menus and combobox popups. This should be removed, as these widgets have keypad navigable item highlight rect inside them AND the widgets cannot be navigated in/out from other widgets. Also, currently there is no room to draw the focus frame to left and right border, so the focus frame looks somewhat strange theme colored think line above and below popup/menu. Task-number: QTBUG-10064 Reviewed-by: Alessandro Portale
* Context menu for application is differs from native S60 appsSami Merila2010-04-201-0/+6
| | | | | | | | | | | | QMenu and QComboBoxListView differ somewhat from their native equivalents. First, the font is not correct. It uses a default font, when style should polish the widgets to use "AVKON primary" font. Second, the background graphic is not the same as on native side. Finally, and most importantly, menu items should be lot taller when using touch enabled S60 UI. Task-number: QT-3295 Reviewed-by: Janne Anttila
* Slider graphics does not look correct in N95 (part2)Sami Merila2010-04-151-1/+2
| | | | | | | | | | The original fix for this, only fixed horizontal widgets. But the same issue can be reproduced also with vertical widgets. This latter fix replaces the orginal fix. Task-number: QTBUG-9854 Reviewed-by: Alessandro Portale