Source

Target

Commits (7)
Showing with 383 additions and 107 deletions
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
import QtQuick 2.1 import QtQuick 2.1
import QtQuick.Controls 1.0 import QtQuick.Controls 1.0
import QtQuick.Controls.Styles 1.0 import QtQuick.Controls.Styles 1.0
import QtQuick.Particles 2.0
import QtQuick.Layouts 1.0 import QtQuick.Layouts 1.0
Item { Item {
...@@ -67,7 +68,12 @@ Item { ...@@ -67,7 +68,12 @@ Item {
} }
Button { Button {
text: "Push me" text: "Push me"
style: ButtonStyle { } style: ButtonStyle {
background: BorderImage {
source: control.pressed ? "../images/button-pressed.png" : "../images/button.png"
border.left: 4 ; border.right: 4 ; border.top: 4 ; border.bottom: 4
}
}
implicitWidth: columnWidth implicitWidth: columnWidth
} }
Button { Button {
...@@ -82,7 +88,12 @@ Item { ...@@ -82,7 +88,12 @@ Item {
implicitWidth: columnWidth implicitWidth: columnWidth
} }
TextField { TextField {
style: TextFieldStyle { } style: TextFieldStyle {
background: BorderImage {
source: "../images/textfield.png"
border.left: 4 ; border.right: 4 ; border.top: 4 ; border.bottom: 4
}
}
implicitWidth: columnWidth implicitWidth: columnWidth
} }
TextField { TextField {
...@@ -91,43 +102,65 @@ Item { ...@@ -91,43 +102,65 @@ Item {
} }
Slider { Slider {
id: slider1
Layout.row: 2 Layout.row: 2
value: 50 value: 0.5
maximumValue: 100
implicitWidth: columnWidth implicitWidth: columnWidth
style: SliderStyle { } style: SliderStyle { }
} }
Slider { Slider {
value: 50 id: slider2
maximumValue: 100 value: 0.5
implicitWidth: columnWidth implicitWidth: columnWidth
style: SliderStyle { } style: SliderStyle {
groove: BorderImage {
height: 6
border.top: 1
border.bottom: 1
source: "../images/progress-background.png"
border.left: 6
border.right: 6
BorderImage {
anchors.verticalCenter: parent.verticalCenter
source: "../images/progress-fill.png"
border.left: 5 ; border.top: 1
border.right: 5 ; border.bottom: 1
width: styleData.handlePosition
height: parent.height
}
}
handle: Item {
width: 13
height: 13
Image {
anchors.centerIn: parent
source: "../images/slider-handle.png"
}
}
}
} }
Slider { Slider {
value: 50 id: slider3
maximumValue: 100 value: 0.5
implicitWidth: columnWidth implicitWidth: columnWidth
style: sliderStyle style: sliderStyle
} }
ProgressBar { ProgressBar {
Layout.row: 3 Layout.row: 3
value: 50 value: slider1.value
maximumValue: 100
implicitWidth: columnWidth implicitWidth: columnWidth
style: ProgressBarStyle{ } style: ProgressBarStyle{ }
} }
ProgressBar { ProgressBar {
value: 50 value: slider2.value
maximumValue: 100
implicitWidth: columnWidth implicitWidth: columnWidth
style: ProgressBarStyle{ } style: progressBarStyle
} }
ProgressBar { ProgressBar {
value: 50 value: slider3.value
maximumValue: 100
implicitWidth: columnWidth implicitWidth: columnWidth
style: progressbarStyle style: progressBarStyle2
} }
CheckBox { CheckBox {
...@@ -177,64 +210,144 @@ Item { ...@@ -177,64 +210,144 @@ Item {
property Component buttonStyle: ButtonStyle { property Component buttonStyle: ButtonStyle {
background: Rectangle { background: Rectangle {
implicitHeight: 20 implicitHeight: 22
implicitWidth: columnWidth implicitWidth: columnWidth
color: control.pressed ? "darkGray" : "lightGray" color: control.pressed ? "darkGray" : control.activeFocus ? "#cdd" : "#ccc"
antialiasing: true antialiasing: true
border.color: "gray" border.color: "gray"
radius: height/2 radius: height/2
Rectangle {
anchors.fill: parent
anchors.margins: 1
color: "transparent"
antialiasing: true
visible: !control.pressed
border.color: "#aaffffff"
radius: height/2
}
} }
} }
property Component textfieldStyle: TextFieldStyle { property Component textfieldStyle: TextFieldStyle {
background: Rectangle { background: Rectangle {
implicitWidth: columnWidth implicitWidth: columnWidth
implicitHeight: 20 implicitHeight: 22
color: "#f0f0f0" color: "#f0f0f0"
antialiasing: true antialiasing: true
border.color: "gray" border.color: "gray"
radius: height/2 radius: height/2
Rectangle {
anchors.fill: parent
anchors.margins: 1
color: "transparent"
antialiasing: true
border.color: "#aaffffff"
radius: height/2
}
} }
} }
property Component sliderStyle: SliderStyle { property Component sliderStyle: SliderStyle {
handle: Rectangle { handle: Rectangle {
width: 14 width: 18
height: 14 height: 18
color: control.pressed ? "darkGray" : "lightGray" color: control.pressed ? "darkGray" : "lightGray"
border.color: "gray" border.color: "gray"
antialiasing: true antialiasing: true
radius: height/2 radius: height/2
Rectangle {
anchors.fill: parent
anchors.margins: 1
color: "transparent"
antialiasing: true
border.color: "#eee"
radius: height/2
}
} }
groove: Rectangle { groove: Rectangle {
height: 8 height: 8
implicitWidth: columnWidth implicitWidth: columnWidth
implicitHeight: 20 implicitHeight: 22
antialiasing: true antialiasing: true
color: "darkGray" color: "#ccc"
border.color: "gray" border.color: "#777"
radius: height/2 radius: height/2
Rectangle {
anchors.fill: parent
anchors.margins: 1
color: "transparent"
antialiasing: true
border.color: "#66ffffff"
radius: height/2
}
} }
} }
property Component progressbarStyle: ProgressBarStyle { property Component progressBarStyle: ProgressBarStyle {
background: BorderImage {
source: "../images/progress-background.png"
border.left: 2 ; border.right: 2 ; border.top: 2 ; border.bottom: 2
}
progress: Item {
clip: true
BorderImage {
anchors.fill: parent
anchors.rightMargin: (control.value < control.maximumValue) ? -4 : 0
source: "../images/progress-fill.png"
border.left: 10 ; border.right: 10
Rectangle {
width: 1
color: "#a70"
opacity: 0.8
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.bottomMargin: 1
anchors.right: parent.right
visible: control.value < control.maximumValue
anchors.rightMargin: -parent.anchors.rightMargin
}
}
ParticleSystem{ id: bubbles }
ImageParticle{
id: fireball
system: bubbles
source: "../images/bubble.png"
opacity: 0.7
}
Emitter{
system: bubbles
anchors.bottom: parent.bottom
anchors.margins: 4
anchors.bottomMargin: -4
anchors.left: parent.left
anchors.right: parent.right
size: 4
sizeVariation: 4
acceleration: PointDirection{ y: -6; xVariation: 3 }
emitRate: 6 * control.value
lifeSpan: 3000
}
}
}
property Component progressBarStyle2: ProgressBarStyle {
background: Rectangle { background: Rectangle {
implicitWidth: columnWidth implicitWidth: columnWidth
implicitHeight: 20 implicitHeight: 24
color: "#f0f0f0" color: "#f0f0f0"
border.color: "gray" border.color: "gray"
antialiasing: true
radius: height/2
} }
progress: Rectangle { progress: Rectangle {
implicitWidth: columnWidth color: "#ccc"
implicitHeight: 20
color: "#c0c0c0"
border.color: "gray" border.color: "gray"
antialiasing: true Rectangle {
radius: height/2 color: "transparent"
border.color: "#44ffffff"
anchors.fill: parent
anchors.margins: 1
}
} }
} }
......
examples/quick/controls/gallery/images/bubble.png

214 Bytes

examples/quick/controls/gallery/images/button-pressed.png

3.02 KB

examples/quick/controls/gallery/images/button.png

3.09 KB

examples/quick/controls/gallery/images/progress-background.png

456 Bytes

examples/quick/controls/gallery/images/progress-fill.png

507 Bytes

examples/quick/controls/gallery/images/slider-handle.png

3.44 KB

examples/quick/controls/gallery/images/textfield.png

2.95 KB

...@@ -16,5 +16,12 @@ ...@@ -16,5 +16,12 @@
<file>images/tab_selected.png</file> <file>images/tab_selected.png</file>
<file>images/window-new.png</file> <file>images/window-new.png</file>
<file>images/window-new@2x.png</file> <file>images/window-new@2x.png</file>
<file>images/bubble.png</file>
<file>images/button-pressed.png</file>
<file>images/button.png</file>
<file>images/progress-background.png</file>
<file>images/progress-fill.png</file>
<file>images/textfield.png</file>
<file>images/slider-handle.png</file>
</qresource> </qresource>
</RCC> </RCC>
...@@ -85,32 +85,34 @@ ApplicationWindow { ...@@ -85,32 +85,34 @@ ApplicationWindow {
} }
Action { Action {
id: cut id: cutAction
text: "Cut" text: "Cut"
shortcut: "ctrl+x" shortcut: "ctrl+x"
iconSource: "images/editcut.png" iconSource: "images/editcut.png"
iconName: "edit-cut" iconName: "edit-cut"
onTriggered: textArea.cut()
} }
Action { Action {
id: copy id: copyAction
text: "Copy" text: "Copy"
shortcut: "Ctrl+C" shortcut: "Ctrl+C"
iconSource: "images/editcopy.png" iconSource: "images/editcopy.png"
iconName: "edit-copy" iconName: "edit-copy"
onTriggered: console.log("Ctrl C pressed - in action...") onTriggered: textArea.copy()
} }
Action { Action {
id: paste id: pasteAction
text: "Paste" text: "Paste"
shortcut: "ctrl+v" shortcut: "ctrl+v"
iconSource: "qrc:images/editpaste.png" iconSource: "qrc:images/editpaste.png"
iconName: "edit-paste" iconName: "edit-paste"
onTriggered: textArea.paste()
} }
Action { Action {
id: alignLeft id: alignLeftAction
text: "&Left" text: "&Left"
iconSource: "images/textleft.png" iconSource: "images/textleft.png"
iconName: "format-justify-left" iconName: "format-justify-left"
...@@ -120,16 +122,16 @@ ApplicationWindow { ...@@ -120,16 +122,16 @@ ApplicationWindow {
checked: document.alignment == Qt.AlignLeft checked: document.alignment == Qt.AlignLeft
} }
Action { Action {
id: alignCenter id: alignCenterAction
text: "C&enter" text: "C&enter"
iconSource: "images/textcenter.png" iconSource: "images/textcenter.png"
iconName: "format-justify-center" iconName: "format-justify-center"
onTriggered: document.alignment = Qt.AlignCenter onTriggered: document.alignment = Qt.AlignHCenter
checkable: true checkable: true
checked: document.alignment == Qt.AlignCenter checked: document.alignment == Qt.AlignHCenter
} }
Action { Action {
id: alignRight id: alignRightAction
text: "&Right" text: "&Right"
iconSource: "images/textright.png" iconSource: "images/textright.png"
iconName: "format-justify-right" iconName: "format-justify-right"
...@@ -138,7 +140,7 @@ ApplicationWindow { ...@@ -138,7 +140,7 @@ ApplicationWindow {
checked: document.alignment == Qt.AlignRight checked: document.alignment == Qt.AlignRight
} }
Action { Action {
id: alignJustify id: alignJustifyAction
text: "&Justify" text: "&Justify"
iconSource: "images/textjustify.png" iconSource: "images/textjustify.png"
iconName: "format-justify-fill" iconName: "format-justify-fill"
...@@ -148,7 +150,7 @@ ApplicationWindow { ...@@ -148,7 +150,7 @@ ApplicationWindow {
} }
Action { Action {
id: bold id: boldAction
text: "&Bold" text: "&Bold"
iconSource: "images/textbold.png" iconSource: "images/textbold.png"
iconName: "format-text-bold" iconName: "format-text-bold"
...@@ -156,8 +158,9 @@ ApplicationWindow { ...@@ -156,8 +158,9 @@ ApplicationWindow {
checkable: true checkable: true
checked: document.bold checked: document.bold
} }
Action { Action {
id: italic id: italicAction
text: "&Italic" text: "&Italic"
iconSource: "images/textitalic.png" iconSource: "images/textitalic.png"
iconName: "format-text-italic" iconName: "format-text-italic"
...@@ -166,7 +169,7 @@ ApplicationWindow { ...@@ -166,7 +169,7 @@ ApplicationWindow {
checked: document.italic checked: document.italic
} }
Action { Action {
id: underline id: underlineAction
text: "&Underline" text: "&Underline"
iconSource: "images/textunder.png" iconSource: "images/textunder.png"
iconName: "format-text-underline" iconName: "format-text-underline"
...@@ -176,41 +179,55 @@ ApplicationWindow { ...@@ -176,41 +179,55 @@ ApplicationWindow {
} }
FileDialog { FileDialog {
id: file id: fileDialog
nameFilters: ["Text files (*.txt)", "HTML files (*.html)"] nameFilters: ["Text files (*.txt)", "HTML files (*.html)"]
onAccepted: document.fileUrl = fileUrl onAccepted: document.fileUrl = fileUrl
} }
ColorDialog {
id: colorDialog
color: "black"
onAccepted: document.textColor = color
}
Action { Action {
id: fileOpen id: fileOpenAction
iconSource: "images/fileopen.png" iconSource: "images/fileopen.png"
iconName: "document-open" iconName: "document-open"
text: "Open" text: "Open"
onTriggered: file.open() onTriggered: fileDialog.open()
} }
menuBar: MenuBar { menuBar: MenuBar {
Menu { Menu {
title: "&File" title: "&File"
MenuItem { action: fileOpen } MenuItem { action: fileOpenAction }
MenuItem { text: "Quit"; onTriggered: Qt.quit() } MenuItem { text: "Quit"; onTriggered: Qt.quit() }
} }
Menu { Menu {
title: "&Edit" title: "&Edit"
MenuItem { action: copy } MenuItem { action: copyAction }
MenuItem { action: cut } MenuItem { action: cutAction }
MenuItem { action: paste } MenuItem { action: pasteAction }
} }
Menu { Menu {
title: "F&ormat" title: "F&ormat"
MenuItem { action: bold } MenuItem { action: boldAction }
MenuItem { action: italic } MenuItem { action: italicAction }
MenuItem { action: underline } MenuItem { action: underlineAction }
MenuSeparator {}
MenuItem { action: alignLeftAction }
MenuItem { action: alignCenterAction }
MenuItem { action: alignRightAction }
MenuItem { action: alignJustifyAction }
MenuSeparator {} MenuSeparator {}
MenuItem { action: alignLeft } MenuItem {
MenuItem { action: alignCenter } text: "&Color ..."
MenuItem { action: alignRight } onTriggered: {
MenuItem { action: alignJustify } colorDialog.color = document.textColor
colorDialog.open()
}
}
} }
Menu { Menu {
title: "&Help" title: "&Help"
...@@ -224,26 +241,71 @@ ApplicationWindow { ...@@ -224,26 +241,71 @@ ApplicationWindow {
RowLayout { RowLayout {
anchors.fill: parent anchors.fill: parent
spacing: 0 spacing: 0
ToolButton { action: fileOpen } ToolButton { action: fileOpenAction }
ToolBarSeparator {} ToolBarSeparator {}
ToolButton { action: copy } ToolButton { action: copyAction }
ToolButton { action: cut } ToolButton { action: cutAction }
ToolButton { action: paste } ToolButton { action: pasteAction }
ToolBarSeparator {} ToolBarSeparator {}
ToolButton { action: bold } ToolButton { action: boldAction }
ToolButton { action: italic } ToolButton { action: italicAction }
ToolButton { action: underline } ToolButton { action: underlineAction }
ToolBarSeparator {} ToolBarSeparator {}
ToolButton { action: alignLeft } ToolButton { action: alignLeftAction }
ToolButton { action: alignCenter } ToolButton { action: alignCenterAction }
ToolButton { action: alignRight } ToolButton { action: alignRightAction }
ToolButton { action: alignJustify } ToolButton { action: alignJustifyAction }
ToolBarSeparator {}
ToolButton {
id: colorButton
property var color : document.textColor
Rectangle {
id: colorRect
anchors.fill: parent
anchors.margins: 8
color: Qt.darker(document.textColor, colorButton.pressed ? 1.4 : 1)
border.width: 1
border.color: Qt.darker(colorRect.color, 2)
}
onClicked: {
colorDialog.color = document.textColor
colorDialog.open()
}
}
Item { Layout.fillWidth: true }
}
}
ToolBar {
id: secondaryToolBar
width: parent.width
RowLayout {
anchors.fill: parent
ComboBox {
id: fontFamilyComboBox
implicitWidth: 150
model: Qt.fontFamilies()
property bool special : false
onCurrentTextChanged: {
if (special == false || currentIndex != 0)
document.fontFamily = currentText
}
}
SpinBox {
id: fontSizeSpinBox
implicitWidth: 50
value: 0
onValueChanged: document.fontSize = value
}
Item { Layout.fillWidth: true } Item { Layout.fillWidth: true }
} }
} }
...@@ -253,7 +315,7 @@ ApplicationWindow { ...@@ -253,7 +315,7 @@ ApplicationWindow {
id: textArea id: textArea
frameVisible: false frameVisible: false
width: parent.width width: parent.width
anchors.top: parent.top anchors.top: secondaryToolBar.bottom
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
text: document.text text: document.text
textFormat: Qt.RichText textFormat: Qt.RichText
...@@ -266,5 +328,17 @@ ApplicationWindow { ...@@ -266,5 +328,17 @@ ApplicationWindow {
cursorPosition: textArea.cursorPosition cursorPosition: textArea.cursorPosition
selectionStart: textArea.selectionStart selectionStart: textArea.selectionStart
selectionEnd: textArea.selectionEnd selectionEnd: textArea.selectionEnd
Component.onCompleted: document.fileUrl = "qrc:/example.html"
onFontSizeChanged: fontSizeSpinBox.value = document.fontSize
onFontFamilyChanged: {
var index = Qt.fontFamilies().indexOf(document.fontFamily)
if (index == -1) {
fontFamilyComboBox.currentIndex = 0
fontFamilyComboBox.special = true
} else {
fontFamilyComboBox.currentIndex = index
fontFamilyComboBox.special = false
}
}
} }
} }
...@@ -52,7 +52,6 @@ DocumentHandler::DocumentHandler() ...@@ -52,7 +52,6 @@ DocumentHandler::DocumentHandler()
, m_selectionStart(0) , m_selectionStart(0)
, m_selectionEnd(0) , m_selectionEnd(0)
{ {
setFileUrl(QUrl("qrc:/example.html"));
} }
void DocumentHandler::setTarget(QQuickItem *target) void DocumentHandler::setTarget(QQuickItem *target)
...@@ -91,6 +90,8 @@ void DocumentHandler::setFileUrl(const QUrl &arg) ...@@ -91,6 +90,8 @@ void DocumentHandler::setFileUrl(const QUrl &arg)
emit textChanged(); emit textChanged();
emit documentTitleChanged(); emit documentTitleChanged();
reset();
} }
} }
emit fileUrlChanged(); emit fileUrlChanged();
...@@ -135,12 +136,18 @@ void DocumentHandler::setCursorPosition(int position) ...@@ -135,12 +136,18 @@ void DocumentHandler::setCursorPosition(int position)
m_cursorPosition = position; m_cursorPosition = position;
emit currentFontChanged(); reset();
}
void DocumentHandler::reset()
{
emit fontFamilyChanged();
emit alignmentChanged(); emit alignmentChanged();
emit boldChanged(); emit boldChanged();
emit italicChanged(); emit italicChanged();
emit underlineChanged(); emit underlineChanged();
emit fontSizeChanged(); emit fontSizeChanged();
emit textColorChanged();
} }
QTextCursor DocumentHandler::textCursor() const QTextCursor DocumentHandler::textCursor() const
...@@ -260,13 +267,44 @@ void DocumentHandler::setFontSize(int arg) ...@@ -260,13 +267,44 @@ void DocumentHandler::setFontSize(int arg)
emit fontSizeChanged(); emit fontSizeChanged();
} }
QFont DocumentHandler::currentFont() const QColor DocumentHandler::textColor() const
{
QTextCursor cursor = textCursor();
if (cursor.isNull())
return QColor(Qt::black);
QTextCharFormat format = cursor.charFormat();
return format.foreground().color();
}
void DocumentHandler::setTextColor(const QColor &c)
{
QTextCursor cursor = textCursor();
if (cursor.isNull())
return;
QTextCharFormat format;
format.setForeground(QBrush(c));
mergeFormatOnWordOrSelection(format);
emit textColorChanged();
}
QString DocumentHandler::fontFamily() const
{ {
QTextCursor cursor = textCursor(); QTextCursor cursor = textCursor();
if (cursor.isNull()) if (cursor.isNull())
return QFont(); return QString();
QTextCharFormat format = cursor.charFormat(); QTextCharFormat format = cursor.charFormat();
return format.font(); return format.font().family();
}
void DocumentHandler::setFontFamily(const QString &arg)
{
QTextCursor cursor = textCursor();
if (cursor.isNull())
return;
QTextCharFormat format;
format.setFontFamily(arg);
mergeFormatOnWordOrSelection(format);
emit fontFamilyChanged();
} }
QStringList DocumentHandler::defaultFontSizes() const QStringList DocumentHandler::defaultFontSizes() const
......
...@@ -63,7 +63,8 @@ class DocumentHandler : public QObject ...@@ -63,7 +63,8 @@ class DocumentHandler : public QObject
Q_PROPERTY(int selectionStart READ selectionStart WRITE setSelectionStart NOTIFY selectionStartChanged) Q_PROPERTY(int selectionStart READ selectionStart WRITE setSelectionStart NOTIFY selectionStartChanged)
Q_PROPERTY(int selectionEnd READ selectionEnd WRITE setSelectionEnd NOTIFY selectionEndChanged) Q_PROPERTY(int selectionEnd READ selectionEnd WRITE setSelectionEnd NOTIFY selectionEndChanged)
Q_PROPERTY(QFont currentFont READ currentFont NOTIFY currentFontChanged) Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor NOTIFY textColorChanged)
Q_PROPERTY(QString fontFamily READ fontFamily WRITE setFontFamily NOTIFY fontFamilyChanged)
Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment NOTIFY alignmentChanged) Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment NOTIFY alignmentChanged)
Q_PROPERTY(bool bold READ bold WRITE setBold NOTIFY boldChanged) Q_PROPERTY(bool bold READ bold WRITE setBold NOTIFY boldChanged)
...@@ -93,7 +94,9 @@ public: ...@@ -93,7 +94,9 @@ public:
int selectionStart() const { return m_selectionStart; } int selectionStart() const { return m_selectionStart; }
int selectionEnd() const { return m_selectionEnd; } int selectionEnd() const { return m_selectionEnd; }
QFont currentFont() const; QString fontFamily() const;
QColor textColor() const;
Qt::Alignment alignment() const; Qt::Alignment alignment() const;
void setAlignment(Qt::Alignment a); void setAlignment(Qt::Alignment a);
...@@ -114,6 +117,8 @@ public Q_SLOTS: ...@@ -114,6 +117,8 @@ public Q_SLOTS:
void setItalic(bool arg); void setItalic(bool arg);
void setUnderline(bool arg); void setUnderline(bool arg);
void setFontSize(int arg); void setFontSize(int arg);
void setTextColor(const QColor &arg);
void setFontFamily(const QString &arg);
void setFileUrl(const QUrl &arg); void setFileUrl(const QUrl &arg);
void setText(const QString &arg); void setText(const QString &arg);
...@@ -126,7 +131,8 @@ Q_SIGNALS: ...@@ -126,7 +131,8 @@ Q_SIGNALS:
void selectionStartChanged(); void selectionStartChanged();
void selectionEndChanged(); void selectionEndChanged();
void currentFontChanged(); void fontFamilyChanged();
void textColorChanged();
void alignmentChanged(); void alignmentChanged();
void boldChanged(); void boldChanged();
...@@ -142,6 +148,7 @@ Q_SIGNALS: ...@@ -142,6 +148,7 @@ Q_SIGNALS:
void documentTitleChanged(); void documentTitleChanged();
private: private:
void reset();
QTextCursor textCursor() const; QTextCursor textCursor() const;
void mergeFormatOnWordOrSelection(const QTextCharFormat &format); void mergeFormatOnWordOrSelection(const QTextCharFormat &format);
...@@ -153,9 +160,6 @@ private: ...@@ -153,9 +160,6 @@ private:
int m_selectionEnd; int m_selectionEnd;
QFont m_font; QFont m_font;
bool m_bold;
bool m_italic;
bool m_underline;
int m_fontSize; int m_fontSize;
QUrl m_fileUrl; QUrl m_fileUrl;
QString m_text; QString m_text;
......
...@@ -80,7 +80,7 @@ BasicButton { ...@@ -80,7 +80,7 @@ BasicButton {
/*! \qmlproperty bool BasicButton::pressed /*! \qmlproperty bool BasicButton::pressed
This property holds whether the button is pressed. */ This property holds whether the button is being pressed. */
readonly property bool pressed: __behavior.effectivePressed || menu && menu.__popupVisible readonly property bool pressed: __behavior.effectivePressed || menu && menu.__popupVisible
activeFocusOnTab: true activeFocusOnTab: true
......
...@@ -99,10 +99,17 @@ Control { ...@@ -99,10 +99,17 @@ Control {
The default value is \c false. */ The default value is \c false. */
property bool activeFocusOnPress: false property bool activeFocusOnPress: false
/*! \internal */ /*! \qmlproperty bool ComboBox::pressed
This property holds whether the button is being pressed. */
readonly property bool pressed: mouseArea.pressed && mouseArea.containsMouse || popup.__popupVisible readonly property bool pressed: mouseArea.pressed && mouseArea.containsMouse || popup.__popupVisible
/*! \internal */
property alias __containsMouse: mouseArea.containsMouse /*! \qmlproperty bool ComboBox::hovered
This property indicates whether the control is being hovered.
*/
readonly property alias hovered: mouseArea.containsMouse
/*! \internal */ /*! \internal */
property var __popup: popup property var __popup: popup
......
...@@ -98,6 +98,12 @@ Control { ...@@ -98,6 +98,12 @@ Control {
*/ */
property int orientation: Qt.Horizontal property int orientation: Qt.Horizontal
/*! \qmlproperty bool ProgressBar::hovered
This property indicates whether the control is being hovered.
*/
readonly property alias hovered: hoverArea.containsMouse
/*! \internal */ /*! \internal */
style: Qt.createComponent(Settings.style + "/ProgressBarStyle.qml", progressbar) style: Qt.createComponent(Settings.style + "/ProgressBarStyle.qml", progressbar)
...@@ -123,6 +129,12 @@ Control { ...@@ -123,6 +129,12 @@ Control {
implicitWidth:(__panel ? __panel.implicitWidth : 0) implicitWidth:(__panel ? __panel.implicitWidth : 0)
implicitHeight: (__panel ? __panel.implicitHeight: 0) implicitHeight: (__panel ? __panel.implicitHeight: 0)
MouseArea {
id: hoverArea
anchors.fill: parent
hoverEnabled: true
}
/*! \internal */ /*! \internal */
function setValue(v) { function setValue(v) {
var newval = parseFloat(v) var newval = parseFloat(v)
......
...@@ -108,9 +108,16 @@ Control { ...@@ -108,9 +108,16 @@ Control {
/*! /*!
\qmlproperty bool Slider::pressed \qmlproperty bool Slider::pressed
This property indicates if slider handle is currently being pressed. This property indicates whether the slider handle is being pressed.
*/ */
property alias pressed: mouseArea.pressed readonly property alias pressed: mouseArea.pressed
/*!
\qmlproperty bool Slider::hovered
This property indicates whether the control is being hovered.
*/
readonly property alias hovered: mouseArea.containsMouse
/*! /*!
\qmlproperty real Slider::stepSize \qmlproperty real Slider::stepSize
...@@ -145,7 +152,7 @@ Control { ...@@ -145,7 +152,7 @@ Control {
/*! /*!
\qmlproperty bool Slider::activeFocusOnPress \qmlproperty bool Slider::activeFocusOnPress
This property indicates if the Slider should receive active focus when This property indicates whether the Slider should receive active focus when
pressed. pressed.
*/ */
property bool activeFocusOnPress: false property bool activeFocusOnPress: false
...@@ -153,16 +160,13 @@ Control { ...@@ -153,16 +160,13 @@ Control {
/*! /*!
\qmlproperty bool Slider::tickmarksEnabled \qmlproperty bool Slider::tickmarksEnabled
This property indicates if the Slider should display tickmarks This property indicates whether the Slider should display tickmarks
at step intervals. at step intervals.
The default value is \c false. The default value is \c false.
*/ */
property bool tickmarksEnabled: false property bool tickmarksEnabled: false
/*! \internal */
property bool __containsMouse: mouseArea.containsMouse
/*! \internal */ /*! \internal */
property bool __horizontal: orientation === Qt.Horizontal property bool __horizontal: orientation === Qt.Horizontal
......
...@@ -134,12 +134,19 @@ Control { ...@@ -134,12 +134,19 @@ Control {
*/ */
property alias font: input.font property alias font: input.font
/*! This property indicates if the Spinbox should get active /*! This property indicates whether the Spinbox should get active
focus when pressed. focus when pressed.
The default value is \c true. The default value is \c true.
*/ */
property bool activeFocusOnPress: true property bool activeFocusOnPress: true
/*!
\qmlproperty bool SpinBox::hovered
This property indicates whether the control is being hovered.
*/
readonly property alias hovered: mouseArea.containsMouse
style: Qt.createComponent(Settings.style + "/SpinBoxStyle.qml", spinbox) style: Qt.createComponent(Settings.style + "/SpinBoxStyle.qml", spinbox)
/*! \internal */ /*! \internal */
...@@ -166,8 +173,6 @@ Control { ...@@ -166,8 +173,6 @@ Control {
readonly property alias downPressed: mouseDown.pressed readonly property alias downPressed: mouseDown.pressed
readonly property alias downHovered: mouseDown.containsMouse readonly property alias downHovered: mouseDown.containsMouse
readonly property alias hovered: mouseArea.containsMouse
readonly property int contentHeight: Math.max(input.implicitHeight, 16) readonly property int contentHeight: Math.max(input.implicitHeight, 16)
readonly property int contentWidth: Math.max(maxSizeHint.implicitWidth, minSizeHint.implicitWidth) readonly property int contentWidth: Math.max(maxSizeHint.implicitWidth, minSizeHint.implicitWidth)
} }
......
...@@ -123,6 +123,16 @@ ScrollView { ...@@ -123,6 +123,16 @@ ScrollView {
The default value is \c true. */ The default value is \c true. */
property bool headerVisible: true property bool headerVisible: true
/*! \qmlproperty bool TableView::backgroundVisible
This property determines if the background should be filled or not.
The default value is \c true.
\note The rowDelegate is not affected by this property
*/
property alias backgroundVisible: colorRect.visible
/*! This property defines a delegate to draw a specific cell. /*! This property defines a delegate to draw a specific cell.
In the item delegate you have access to the following special properties: In the item delegate you have access to the following special properties:
...@@ -597,7 +607,7 @@ ScrollView { ...@@ -597,7 +607,7 @@ ScrollView {
anchors.topMargin: viewport.anchors.topMargin anchors.topMargin: viewport.anchors.topMargin
anchors.leftMargin: viewport.anchors.leftMargin anchors.leftMargin: viewport.anchors.leftMargin
anchors.margins: viewport.anchors.margins anchors.margins: viewport.anchors.margins
anchors.rightMargin: __scroller.rightMargin + anchors.rightMargin: (frameVisible ? __scroller.rightMargin : 0) +
(__scroller.outerFrame && __scrollBarTopMargin ? 0 : __verticalScrollBar.width (__scroller.outerFrame && __scrollBarTopMargin ? 0 : __verticalScrollBar.width
+ __scroller.scrollBarSpacing + root.__style.padding.right) + __scroller.scrollBarSpacing + root.__style.padding.right)
......
...@@ -599,14 +599,13 @@ ScrollView { ...@@ -599,14 +599,13 @@ ScrollView {
edit.undo(); edit.undo();
} }
/*! /*! \qmlproperty bool TextArea::backgroundVisible
\qmlproperty color TextArea::backgroundColor
This property sets the background color of the viewport. This property determines if the background should be filled or not.
The default value is the base color of the SystemPalette. The default value is \c true.
*/ */
property alias backgroundColor: colorRect.color property alias backgroundVisible: colorRect.visible
/*! \internal */ /*! \internal */
default property alias data: area.data default property alias data: area.data
...@@ -623,7 +622,7 @@ ScrollView { ...@@ -623,7 +622,7 @@ ScrollView {
/*! /*!
\qmlproperty TextDocument TextArea::textDocument \qmlproperty TextDocument TextArea::textDocument
This property exposes the \l QTextDocument of this TextArea. This property exposes the \l QQuickTextDocument of this TextArea.
\sa TextEdit::textDocument \sa TextEdit::textDocument
*/ */
property alias textDocument: edit.textDocument property alias textDocument: edit.textDocument
......
...@@ -524,8 +524,11 @@ Control { ...@@ -524,8 +524,11 @@ Control {
textInput.undo(); textInput.undo();
} }
/*! \internal */ /*! \qmlproperty bool TextField::hovered
property alias __containsMouse: mouseArea.containsMouse
This property holds whether the control is being hovered.
*/
readonly property alias hovered: mouseArea.containsMouse
/*! \internal */ /*! \internal */
property alias __contentHeight: textInput.contentHeight property alias __contentHeight: textInput.contentHeight
......