31 HbStyleLoader::registerFilePath(FILE_PATH_WIDGETML); |
31 HbStyleLoader::registerFilePath(FILE_PATH_WIDGETML); |
32 HbStyleLoader::registerFilePath(FILE_PATH_CSS); |
32 HbStyleLoader::registerFilePath(FILE_PATH_CSS); |
33 |
33 |
34 mCustomTextColor = QPair<bool, QColor>(false, Qt::black); |
34 mCustomTextColor = QPair<bool, QColor>(false, Qt::black); |
35 |
35 |
36 // Enable scrolling using cursor |
36 // Disable HbTextEdit scrolling. Background scroll area will handle scrolling. |
37 setScrollable(true); |
37 setScrollable(false); |
38 scrollArea()->setScrollDirections(Qt::Horizontal); |
38 scrollArea()->setScrollDirections(0); |
39 |
39 |
40 // set background colour to plain white |
40 // set background colour to plain white |
41 QPixmap whitePixmap(10,10); |
41 QPixmap whitePixmap(10,10); |
42 whitePixmap.fill(Qt::white); |
42 whitePixmap.fill(Qt::white); |
43 QGraphicsPixmapItem *pixmapItem = new QGraphicsPixmapItem (whitePixmap); |
43 QGraphicsPixmapItem *pixmapItem = new QGraphicsPixmapItem (whitePixmap); |
44 setBackgroundItem(pixmapItem); |
44 setBackgroundItem(pixmapItem); |
45 |
45 |
46 // disables highlight frame for now - new api to set the frame item should be release somewhere wk26 |
46 // disables highlight frame for now - new api to set the frame item should be release somewhere wk26 |
47 setFocusHighlight(HbStyle::P_TextEdit_frame_highlight, HbWidget::FocusHighlightNone); |
47 setFocusHighlight(HbStyle::P_TextEdit_frame_highlight, HbWidget::FocusHighlightNone); |
48 |
48 |
|
49 // Create custom palette based on the current one |
|
50 QPalette testPalette = QApplication::palette(); |
|
51 |
|
52 // Sets the selection background colour |
|
53 testPalette.setColor(QPalette::Active, QPalette::Highlight, Qt::cyan); |
|
54 testPalette.setColor(QPalette::Inactive, QPalette::Highlight, Qt::cyan); |
|
55 |
|
56 // Sets the link and visited link colours |
|
57 testPalette.setColor(QPalette::Active, QPalette::Link, Qt::darkBlue); |
|
58 testPalette.setColor(QPalette::Inactive, QPalette::Link, Qt::darkBlue); |
|
59 testPalette.setColor(QPalette::Active, QPalette::LinkVisited, Qt::darkMagenta); |
|
60 testPalette.setColor(QPalette::Inactive, QPalette::LinkVisited, Qt::darkMagenta); |
|
61 |
|
62 // Update custom palette for this widget |
|
63 setPalette(testPalette); |
|
64 |
49 connect(this, SIGNAL(contentsChanged()), this, SLOT(updateCustomTextColor())); |
65 connect(this, SIGNAL(contentsChanged()), this, SLOT(updateCustomTextColor())); |
50 } |
66 } |
51 |
67 |
52 /*! |
68 /*! |
53 Destructor |
69 Destructor |