summaryrefslogtreecommitdiffstats
path: root/src/gui/styles/qs60style.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Button and LineEdit/TextEdit theme colors are incorrectSami Merilä2009-12-041-2/+4
| | | | | | | | | QS60Style fetches incorrect color values from theme when using buttons and lineEdits/TextEdits. New values are the same as in native widgets (verified from native widget code). Task-number: QTBUG-6364 Reviewed-by: Alessandro Portale
* QS60Style: Overwrites correct stylehint color valuesSami Merilä2009-12-041-4/+3
| | | | | | | | | | | | | | | | | | QS60Style overwrites correct theme colors with QCommonStyle values in QS60Style::styleHint(). In that method returned value is initialized as -1 and then if the value is still -1 after switch statement for different stylehints, the stylehint is queried from common style. Problem is that it is also getting RGB values set into return value. White color as HEX is FFFFFF and -1 as HEX is FFFFFF. So, if theme color is white for Group Text title, or for Grid lines, color is asked from QCommonStyle instead. As a fix, in 'default' case ask from QCommonStyle. Also, use RGBA instead of RGB values. Reviewed-by: Alessandro Portale
* QS60Style: Always store changed theme paletteSami Merilä2009-12-031-5/+4
| | | | | | | | | | | | | | | | When style updates its background brush, it updates QApplication's palette with new background. Also member variable m_backgroundBrush is updated. What is NOT updated is the member variable m_themePalette, which should also contain correct updated palette. This change updates m_themePalette and moves palette updations to occur in one place so that in all use-cases the palettes are modified in a unified way. Task-number: QTBUG-6427 Reviewed-by: Alessandro Portale
* Tidyup QS60Style - remove unused constants, replace magic valuesSami Merilä2009-11-261-3/+3
| | | | | | | | | | | Basically this has three minor fixes: - remove unused style parts that were left over after unifying textEdit and lineEdit graphics - make radiobutton indicator one pixel smaller so it is perfect circle - replace magic "10" with calculated value Reviewed-by: Alessandro Portale
* Background in landscape mode on S60 5.0 is brokenSami Merilä2009-11-261-0/+1
| | | | | | | | | | | | | After initial fix, 99% of widgets draw temselves properly after orientation switch. However, QScrollAreas lose their palette hash, which causes scrollarea background to re-start from theme background top-left. As a correction, we re-set the theme palette hash after calling QApplication::setPalette, since that clears palette hash. Task-number: QTBUG-6125 Reviewed-by: Alessandro Portale
* Remove some white-space from QS60StyleSami Merilä2009-11-261-5/+5
| | | | | | Remove some white space from QS60Style classes. Reviewed-by: TrustMe
* Fixing background painting after orientation switch.Alessandro Portale2009-11-251-0/+1
| | | | | | | | | | | | | | | Fixing previous fixes of QS60StylePrivate::setBackgroundTexture with commit SHAs a80e58335e69c8ce96d1596e0ed2d14e424a0d5e and d4089399a3ab7548a864d5a399e08df85c444783 Now, the palette gets the updated background brush and the palette is actually set as application palette. Also making sure that QS60StylePrivate::handleDynamicLayoutVariantSwitch does the right things in the right order. So that Table headers are not broken after orientaion switch. Task-number: QTBUG-6125 Task-number: QT-1478
* Micro optimizationAlessandro Portale2009-11-251-1/+1
| | | | | | Don't request a palette if you do not use it. Reviewed-By: Trustme
* Removed unused setThemePalette(QStyleOption *option)Alessandro Portale2009-11-251-5/+0
| | | | | | Not used or missed, anywhere. Reviewed-By: Trustme
* QS60Style returns hint QFormLayout::WrapLongRowsAlessandro Portale2009-11-171-0/+4
| | | | | | | | | To get a mobile friendly 1-column layout, we can set QFormLayout's rowWrapPolicy. S60Style should return QFormLayout::WrapLongRows as the SH_FormLayoutWrapPolicy styleHint. Reviewed-by: Jason Barron
* LineEdit graphics are sometimes missing from webpages with s60styleSami Merilä2009-11-171-25/+39
| | | | | | | | | | | | | | | | | | If the webpage does define BODY colors for background, it is possible that lineEdits are not drawn at all. Actually, they are drawn but with transparent background, which makes them near-invisible. This is due to that QS60Style tries to check if the themePalette has been changed and if it has forwards the drawing of that particular widget to common style. Common style unfortunately uses active style's palette to draw the widget. S60Style defines Base to be transparent (to get the theme background shine through) and common style tries to use Base to draw lineEdit. End result is transparent lineEdit on webpage. This fix makes more educated deduction when it tries to see if style has been changed. This is related to QTBUG-4885. Task-number: QTBUG-4885 Reviewed-by: Janne Koskinen
* Define own palette for web-based widgets in QS60StyleSami Merilä2009-11-161-1/+9
| | | | | | | | | | | | | It makes no sense to use the S60-theme based palette in web based widgets. Web pages do not generally show theme background, but their own (or by default white) which clashes badly with WindowText and Text that are set to work with theme background. Therefore, QWebView and QGraphicsWebView need to be set their own palette for texts in theme palette hash. This improves visibility of text in webkit when QS60Style is active. Task-number: QTBUG-4885 Reviewed-by: Janne Koskinen
* Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt-s60-public into ↵axis2009-11-131-1/+1
|\ | | | | | | 4.6-staging2
| * Highlighted text colour correction for s60styleJanne Koskinen2009-11-131-1/+1
| | | | | | | | | | | | | | | | Changed s60style HighlightedText to pickup the correct colour from S60 themes. Task-number: QTBUG-5709 Reviewed-by: Sami Merila
* | Merge commit upstream/4.6 into oslo-staging-2/4.6Olivier Goffart2009-11-131-1/+1
|\ \ | |/ |/|
| * Fix typo in license headerAlessandro Portale2009-11-121-1/+1
| | | | | | | | | | | | The word 'module' was missing. Reviewed-By: TrustMe
| * Removed unused public Api from QS60StyleAlessandro Portale2009-11-101-44/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QS60Style::setStyleProperty() and QS60Style::styleProperty() were intended as generic property setter/getters, but are not needed anymore. Reviewed-by: Sami Merila modified: src/gui/styles/qs60style.cpp modified: src/gui/styles/qs60style.h modified: src/gui/styles/qs60style_p.h modified: src/gui/styles/qs60style_s60.cpp modified: src/gui/styles/qs60style_simulated.cpp modified: src/s60installs/eabi/QtGuiu.def
* | Tab shapes have the wrong size and distance between them on SymbianSami Merilä2009-11-121-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With certain themes it is really apparent that the tabshape rect and position deduction in QS60Style has some issues. See for example 5800Xm's default theme. TabShapes have huge spaces between them. Problem is that the initializer in style for tab shape assumes that the side parts of the frame are squares and will use 1:1 ratio (width:height) when upscaling the theme graphic draw area. This leads to that tabshape graphics will not fill in the whole area reserved for them. When initial area has ratio of 1:2 (for horizontal tab shape), upscaling pruduces correct rect and graphic is drawn correctly. Task-number: QTBUG-5659 Reviewed-by: Alessandro Portale
* | Revert "Using qreal more consistently in code (prevent misuse of double)"Aleksandar Sasha Babic2009-11-111-8/+8
| | | | | | | | | | | | | | | | This reverts commit 676780d515cedca85829ae962e4f501c5e5b6581. Conflicts: src/gui/painting/qblendfunctions.cpp
* | Revert "Check that we're not using double where qreal should be used"Aleksandar Sasha Babic2009-11-111-2/+2
| | | | | | | | This reverts commit d9a275b3cc4a248da1f392fb5649b9fe7a93b12c.
* | QS60Style palette is not updated after orientation switchSami Merilä2009-11-101-1/+1
| | | | | | | | | | | | | | | | Due to bad first fix for QT-1478, palette is still not updated correctly. Changed palette needs to be set back to QApplication. Task-number: QT-1478 Reviewed-by: Alessandro Portale
* | Removed unused public Api from QS60StyleAlessandro Portale2009-11-101-44/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QS60Style::setStyleProperty() and QS60Style::styleProperty() were intended as generic property setter/getters, but are not needed anymore. Reviewed-by: Sami Merila modified: src/gui/styles/qs60style.cpp modified: src/gui/styles/qs60style.h modified: src/gui/styles/qs60style_p.h modified: src/gui/styles/qs60style_s60.cpp modified: src/gui/styles/qs60style_simulated.cpp modified: src/s60installs/eabi/QtGuiu.def
* | Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6Shane Kearns2009-11-101-1/+1
|\ \ | |/
| * Merge branch '4.6-api-review' into 4.6Marius Storm-Olsen2009-11-091-1/+1
| |\
| | * API review: Rename functions numColors(), setNumColors() and numBytes()Marius Storm-Olsen2009-11-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QPaintDevice and QImage used the functions numColors(), setNumColors(), and numBytes(). However, this is not consistent with the rest of the Qt API which uses *Count() and set*Count(). Removed all usage of these functions inside Qt and test-cases. Reviewed-by: Andreas Aardal Hanssen
* | | Check that we're not using double where qreal should be usedSami Merilä2009-11-091-2/+2
| | | | | | | | | | | | | | | | | | | | | Added two missing qreal conversion from QS60Style. Task-number: QTBUG-4894 Reviewed-by: Aleksandar Babic
* | | Using qreal more consistently in code (prevent misuse of double)Aleksandar Sasha Babic2009-11-061-8/+8
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We want to force use of qreal where possible. This can lead to better performance on platforms where qreal -> float (i.e. ARM). To achieve this we: 1. changed from 'double' to 'qreal', where justified 2. using qreal() to intialize constants, where justified 3. adding helper functions that are overloaded for qreal like qAtan2(), qAcos(), qFabs() ... 4. defining QT_USE_MATH_H_FLOATS for Symbian platform In addtion we used opportunity to improve code with some small things 5. converting divisions to multiplications (i.e. '/ 2.0' -> '* qreal(0.5)') 6. defining new constants (i.e. 'Q_PI / 180.0' -> 'Q_PI180') 7. declaring variables as 'const', where justified Reviewed-by: Andreas Aardal Hanssen Reviewed-by: Gunnar Sletta Reviewed-by: Jan-Arve Reviewed-by: Kim Motoyoshi Kalland Reviewed-by: Alessandro Portale Reviewed-by: Janne Koskinen
* | QS60Style: Harmonize theme graphic with LineEdit and QTextEditSami Merilä2009-11-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | In S60 the single line and multi line editors have same theme background. We should share one as well. Now we are using fancy notepad graphic with QTextEdit, but it makes QTextEdits to look apart from QLineEdits and in some themes it is styled rather badly (as it is not a central graphic item in a theme). Therefore it is better to use one and same graphic for both widgets. Task-number: QTBUG-5259 Reviewed-by: Alessandro Portale
* | QProgressBar is drawn stretched in QS60StyleSami Merilä2009-11-051-0/+5
| | | | | | | | | | | | | | | | Style draws the ends of scrollbar as too wide, causing the themegraphic to stratch which looks horrible. Task-number: QTBUG-5445 Reviewed-by: Alessandro Portale
* | QS60Style: Checked menu check indicators are not shownSami Merilä2009-11-051-5/+6
| | | | | | | | | | | | | | | | | | QS60Style does not draw checked menu indicators at all. This is due to that it initializes used style option with style option's base class. Therefore relevant data for menu item indicator is not copied. Task-number: QTBUG-4717 Reviewed-by: Alessandro Portale
* | QS60Style: QToolButton indicator will not fit into toolbutton areaSami Merilä2009-11-041-5/+8
| | | | | | | | | | | | | | | | | | QToolButton rect does not include reserved area for menu indicator, so drawing the indicator makes the rest of the toolbutton area smaller. Fixed by including the menu indicator area into tool button. Task-number: QTBUG-5266 Reviewed-by: Alessandro Portale
* | Make button margins bigger in QS60StyleSami Merilä2009-11-041-0/+7
|/ | | | | | | | | | | Currenly QS60Style relies on QCommonStyle to calculate correct button content size. Unfortunately, common style does not understand frames, so it is possible that the frame-border of theme graphic gets under button content. This change makes both QPushButton and QToolButton bigger. Task-number: None Reviewed-by: Alessandro Portale
* QS60Style: impossible to open menu from styled QToolButtonSami Merilä2009-11-031-2/+34
| | | | | | | | | | | | | QS60Style ignores toolButton's menu indicator rect. This means that the button's menu cannot be triggered by the user, as the style does not draw the indicator at all. With this fix, style calculates a rect (including margins) for menu indicator and draws that (arrow down) into toolButton (by making the button bevel larger). Task-number: QTBUG-5266 Reviewed-by: Alessandro Portale
* QS60Style - TabWidget text changes color when widget becomes dimmedSami Merilä2009-11-021-8/+8
| | | | | | | | Style sets the tabWidget palette hash only for QPalette::Active. So, when widget becomes disabled, text color changes back to default. Task-number: QTBUG-4625 Reviewed-by: Alessandro Portale
* Style's theme palette hash is lost after orientation switchSami Merilä2009-11-021-1/+1
| | | | | | | | | | | | | Currently, after orientation switch when new theme background is applied, it is done using QApplication::setPalette(). This unfortunately tosses away the palette hash. So instead directly calling QApplication::setPalette(), the fix is to call the style's internal setThemePalette(), which copies the hash also to QApplication palette. This is related to bug QT-1478 in Private JIRA. Task-number: QT-1478 Reviewed-by: Shane Kearns
* S60Style: User set header view palettes are ignoredSami Merilä2009-10-301-8/+36
| | | | | | | | | QS60Style ignores user defined palettes for QHeaderViews. With this fix, style takes palette changes into account and also draws QTableCornerButton correctly. Task-number: QTBUG-4522 Reviewed-by: Alessandro Portale
* S60Style: List items should be taller for touch use (5th Edition)Sami Merilä2009-10-301-3/+12
| | | | | | | | | | | | This fixes private JIRA issue: QT-1479. The change makes itemview items taller by twice the QStyle::PM_FocusFrameVMargin amount (both margins) when touch is in use. It is rather curious that the QCommonStyle modifies QRect for itemviews in horizontal direction by twice the QStyle::PM_FocusFrameHMargin amount, but does not do it in vertical direction. Task-number: QT-1479 (private) Reviewed-by: Alessandro Portale
* QS60Style does not mix well with the stylesheetsSami Merilä2009-10-291-81/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QS60Style basically ignores user set / stylesheet set palettes. Now, tested with: * QLineEdit * QPushButton * QSpinBox * QComboBox * QAbstractScrollArea * QCheckBox * QRadioButton * QGroupBox * QFrame * QTreeView * QTableView * QHeaderView * QProgressBar * QScrollBar * QSplitter * QSlider * QTabWidget * QToolButton * QToolBar and fixed QS60Style so that it obeys externally set palettes. Task-number: QTBUG-4820 Reviewed-by: Janne Koskinen
* Draw QSplitter in QS60StyleSami Merilä2009-10-271-0/+11
| | | | | | | | | | | Previously QS60Style did not draw CE_Splitter control at all. With this change, the style draws it when user presses the splitter down to make a drag. Since native side does not have splitter at all, we are drawing splitter rect as partially transparent rounded rect with QPalette::Light (which has been picked from active theme). Task-number: QT-686 Reviewed-by: Shane Kearns
* Use PM_SplitterWidth in QS60StyleSami Merilä2009-10-271-19/+20
| | | | | | | | Updated pixel metrics values from latest S60 layouts. Also, updated pixel metrics harvester to collect pixel metric for QSplitter. Task-number: QT-686 Reviewed-by: Shane Kearns
* Remove compilation warning from QtGuiSami Merilä2009-10-261-1/+1
| | | | | | | | | | | QS60Style causes a compilation warning due to using incorrect parameter when adjusting rect size in adjusted() call. The problematic line is using twice same parameter and thus leaves one pre-set parameter unused, which causes a compilation warning. Fixed by using the correct parameter. Task-number: N/A Reviewed-by: Trust Me
* S60Style's tab widget is too small for touch useSami Merilä2009-10-211-4/+10
| | | | | | | | | | TabWidget for S60Style is too small for touch use, it is rather hard to accurately touch the tabpane to switch the active tab. To fix this, we ask the native tabpane height from AVKON and set the QTabWiget's pane height to native height (or bigger). Task-number: QTBUG-4243 Reviewed-by: Alessandro Portale
* QT-693 QS60Style does not regard selection beahviors with itemviewsSami Merilä2009-10-201-2/+22
| | | | | | | | | | | QS60Style disregards all selection behaviors for itemviews. This leads to error when showing a highlighted selection rect; rect is only shown for cell having focus. Fixed by setting the highlight to all 'selected' cells. Task-number: QT-693 Reviewed-by: Alessandro Portale
* Color role with higher contrast for focusrectAlessandro Portale2009-10-081-1/+1
| | | | | | | | | | | | | Low-risk, high value change. Beta worthy! As much as QPalette::Highlight sounds like a suitable color role for drawing a focus rect... It simply did not work well with a lot of S60 themes (e.g. the default N95 theme). QPalette::Text is a better candidate, since the S60 themes promise a good contrast of text on background graphics. Reviewed-By: Sami Merilä
* QS60Style: Re-enable color-from-skin-part extractionAlessandro Portale2009-10-081-5/+4
| | | | | | | | | | | After introducing native pixmap support, we had some crashes on certain setups (e.g. 3.2 Emulator) when accessing data that came from native pixmaps (FBServ). However, after fix 064674426ef0c446561b0c338441bb7d5ca091bf this is not reproducable, anymore. Therefore let's re-enable color extraction and enjoy better color palettes. Reviewed-By: Sami Merilä
* Symbian specific fixes to QComboBoxJani Hautakangas2009-09-301-9/+10
| | | | | | | | Fixes QComboBox edit field geometry in s60style Fixes softkey crash when setting a custom itemview to QComboBox Fixes Symbian keyboard input interval in tst_QComboBox::virtualAutocompletion() Reviewed-by: Sami Merila
* Making Keypad Navigation more usableAlessandro Portale2009-09-191-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | All changes of this commit are #ifdef'ed in QT_KEYPAD_NAVIGATION. Most desktop Qts won't notice any change. Navigating between QWidgets was not alwys a pleasure on keypad devices. This commit fixes the navigation behavior for some widgets, mostly itemviews. Furthermore, it adds a 'directional' navigation mode. Until now, the existing keypad navigation used the tab order do go back and forth between widgets. The new mode is supposed to provide a more intuitive navigation. It is the new default mode on Symbian. Screens (and their resolutions) become bigger, and also low resolution screens can be used in landscape mode. That's why the directional mode was requested. Another popular request was to put some more convenience into QSlider: If a (horizontal) slider has focus and the user presses left/right, the value of the slider may directing change without being selected (edit mode). This commit also adds the manual test 'keypadnavigation'. Reviewed-by: Shane Kearns
* Update license headers again.Jason McDonald2009-09-091-4/+4
| | | | Reviewed-by: Trust Me
* Update tech preview license header for files that are new in 4.6.Jason McDonald2009-08-311-13/+13
| | | | Reviewed-by: Trust Me
* doc: Fixed several qdoc errors.Martin Smith2009-08-311-0/+31
|