diff --git a/components/Button.qml b/components/Button.qml index 36345014d75644cbd28a0b1792e7d791554c7081..53d56b65d21303a3b2bd4e32333ad72c52480a4b 100644 --- a/components/Button.qml +++ b/components/Button.qml @@ -11,7 +11,7 @@ Components.Button { property bool defaultbutton property string hint - background: QStyleItem { + background: StyleItem { id: styleitem anchors.fill: parent elementType: "button" diff --git a/components/CheckBox.qml b/components/CheckBox.qml index bf40d529b6d9040ce571a26f6b707c147c771c5b..cd4ad29c3e07332275d0d1df3149f57c2f092681 100644 --- a/components/CheckBox.qml +++ b/components/CheckBox.qml @@ -10,7 +10,7 @@ Components.CheckBox{ width: Math.max(110, backgroundItem.textWidth(text) + 40) height: 20 - background: QStyleItem { + background: StyleItem { id:styleitem elementType:"checkbox" sunken:pressed diff --git a/components/ChoiceList.qml b/components/ChoiceList.qml index 1582cc9ff0b6f9fde2fbaecc8e311d7c9b9afe1e..381db9ee042e7c676050c11c98e03ca6d57fa128 100644 --- a/components/ChoiceList.qml +++ b/components/ChoiceList.qml @@ -15,7 +15,7 @@ Components.ChoiceList { topMargin: 4 bottomMargin: 4 - background: QStyleItem { + background: StyleItem { anchors.fill: parent elementType: "combobox" sunken: pressed @@ -33,7 +33,7 @@ Components.ChoiceList { height: 22 anchors.left: parent.left width: choicelist.width - QStyleItem { + StyleItem { anchors.fill: parent elementType: "comboboxitem" text: itemText @@ -41,7 +41,7 @@ Components.ChoiceList { } } - popupFrame: QStyleItem { + popupFrame: StyleItem { property string popupLocation: backgroundItem.styleHint("comboboxpopup") ? "center" : "below" property int fw: backgroundItem.pixelMetric("menupanelwidth"); anchors.leftMargin: backgroundItem.pixelMetric("menuhmargin") + fw diff --git a/components/ComboBox.qml b/components/ComboBox.qml index ebc537f3a236819802c7ce6d4fda24b6bb75863f..3b80b39fc9ff2e398644365eb695dfa683ee3807 100644 --- a/components/ComboBox.qml +++ b/components/ComboBox.qml @@ -64,7 +64,7 @@ Custom.BasicButton { property alias hoveredText: popup.hoveredText property string hint - background: QStyleItem { + background: StyleItem { anchors.fill: parent elementType: "combobox" sunken: comboBox.pressed diff --git a/components/Dial.qml b/components/Dial.qml index 95560cb86007731807babbef43b99952a8c41418..3e42ccf2d9095f57205656ff6b1a2c05657ac3c1 100644 --- a/components/Dial.qml +++ b/components/Dial.qml @@ -3,7 +3,7 @@ import "custom" as Components // jens: ContainsMouse breaks drag functionality -QStyleItem { +StyleItem { id: dial width:100 diff --git a/components/Frame.qml b/components/Frame.qml index 8233c455e96675fefa9b4c4c754715e507f18a2a..9c9d4aa8fc8e4b260ec285e8d667cd82a7a1ab27 100644 --- a/components/Frame.qml +++ b/components/Frame.qml @@ -6,7 +6,7 @@ Item { height: Math.max(100, content.childrenRect.height + 2 * content.frameWidth) property alias raised: style.raised property alias sunken: style.sunken - QStyleItem { + StyleItem { id: style anchors.fill: parent elementType: "frame" diff --git a/components/GroupBox.qml b/components/GroupBox.qml index 0afcfc47692b367ef71115d7d996571626410f00..098bc1c4583918b9bf23305c265baea0e7292f5d 100644 --- a/components/GroupBox.qml +++ b/components/GroupBox.qml @@ -7,7 +7,7 @@ Components.GroupBox { height: contentHeight + sizeHint.height + 4 property variant sizeHint: backgroundItem.sizeFromContents(0, 24) property bool flat: false - background : QStyleItem { + background : StyleItem { id: styleitem elementType: "groupbox" anchors.fill: parent diff --git a/components/ProgressBar.qml b/components/ProgressBar.qml index 9099076c8c7e441d9ad7af9fa8ccfd80564f134e..676518421dd03d6460fae208080720d3cffd543f 100644 --- a/components/ProgressBar.qml +++ b/components/ProgressBar.qml @@ -13,7 +13,7 @@ Components.ProgressBar { SystemPalette {id: syspal} - background: QStyleItem { + background: StyleItem { anchors.fill: parent elementType: "progressbar" // XXX: since desktop uses int instead of real, the progressbar diff --git a/components/RadioButton.qml b/components/RadioButton.qml index 552c9ad8c4e4c3ad8ac661d81ee95dc53b8ec6b5..8d490c0024e347d6b3570cc1504a77f9adcf469a 100644 --- a/components/RadioButton.qml +++ b/components/RadioButton.qml @@ -10,7 +10,7 @@ Components.CheckBox { width:110 height:20 - background: QStyleItem { + background: StyleItem { elementType:"radiobutton" sunken:pressed on:checked || pressed diff --git a/components/ScrollArea.qml b/components/ScrollArea.qml index 00b01c961da6b24bf0a69a348788a87b48cd9da5..ee069965230bbeb8881244ba9f1d051803857f03 100644 --- a/components/ScrollArea.qml +++ b/components/ScrollArea.qml @@ -48,7 +48,7 @@ FocusScope { anchors.margins: frameWidth } - QStyleItem { + StyleItem { id: styleitem elementType: "frame" onElementTypeChanged: scrollarea.frameWidth = styleitem.pixelMetric("defaultframewidth"); @@ -146,7 +146,7 @@ FocusScope { color: syspal.window } - QStyleItem { + StyleItem { z: 2 anchors.fill: parent anchors.margins: -3 diff --git a/components/ScrollBar.qml b/components/ScrollBar.qml index 2df691122a126e527f346aaaee43fd1c05774d38..e496afab6eeee7a4722d324e88f917cd8d1c7efd 100644 --- a/components/ScrollBar.qml +++ b/components/ScrollBar.qml @@ -131,7 +131,7 @@ Item { value = minimumValue } - QStyleItem { + StyleItem { id: styleitem anchors.fill:parent elementType: "scrollbar" diff --git a/components/Slider.qml b/components/Slider.qml index 69f678b225a6583e731a4e2c5501eaaeb33ad8e3..6c8aa0034b5c8b81a09e359ff3b9d60d90331192 100644 --- a/components/Slider.qml +++ b/components/Slider.qml @@ -9,7 +9,7 @@ Components.Slider{ property bool tickmarksEnabled: true property string tickPosition: "Below" // "Above", "Below", "BothSides" - QStyleItem { id:buttonitem; elementType: "slider" } + StyleItem { id:buttonitem; elementType: "slider" } property variant sizehint: buttonitem.sizeFromContents(23, 23) property int orientation: Qt.Horizontal @@ -18,7 +18,7 @@ Components.Slider{ width: orientation === Qt.Horizontal ? 200 : sizehint.height property string hint; - groove: QStyleItem { + groove: StyleItem { anchors.fill:parent elementType: "slider" sunken: pressed diff --git a/components/SpinBox.qml b/components/SpinBox.qml index 525ade6fd1801b6a0598a720134a8ae35c846627..a7cba6bd0ca89fb0f10809e8815fae43be55a4f9 100644 --- a/components/SpinBox.qml +++ b/components/SpinBox.qml @@ -16,7 +16,7 @@ Components.SpinBox { leftMargin:6 rightMargin:6 - QStyleItem { id:edititem ; elementType:"edit" ; visible:false } + StyleItem { id:edititem ; elementType:"edit" ; visible:false } property int buttonHeight: edititem.sizeFromContents(70, 20).height property int buttonWidth: edititem.sizeFromContents(70, 20).width @@ -40,7 +40,7 @@ Components.SpinBox { id: focusFrame anchors.fill: editBackground visible: frameitem.styleHint("focuswidget") - QStyleItem { + StyleItem { id: frameitem anchors.margins: -6 anchors.leftMargin: -6 @@ -63,7 +63,7 @@ Components.SpinBox { onWidthChanged: updateRect() onHeightChanged: updateRect() - QStyleItem { + StyleItem { id: styleitem anchors.fill: parent elementType: "spinbox" diff --git a/components/SplitterRow.qml b/components/SplitterRow.qml index 7477ec82ce1af8b4e1693aceb837b0ecd0bab7f4..783bc23a4f7c948567909906e620f93effa91aee 100644 --- a/components/SplitterRow.qml +++ b/components/SplitterRow.qml @@ -2,7 +2,7 @@ import QtQuick 1.1 import "custom" as Components Components.SplitterRow { - handleBackground: QStyleItem { + handleBackground: StyleItem { id: styleitem elementType: "splitter" width: pixelMetric("splitterwidth") @@ -17,7 +17,7 @@ Components.SplitterRow { drag.axis: Qt.YAxis drag.target: handle - QStyleItem { + StyleItem { anchors.fill: parent cursor: "splithcursor" } diff --git a/components/Switch.qml b/components/Switch.qml index 08518b13b51274c34ca29e9f7179ce36618a2e25..45bdfd84ef6045d5f267710c8488a70f79bcaf02 100644 --- a/components/Switch.qml +++ b/components/Switch.qml @@ -6,12 +6,12 @@ Components.Switch { minimumWidth:100 minimumHeight:30 - groove:QStyleItem { + groove:StyleItem { elementType:"edit" sunken: true } - handle: QStyleItem { + handle: StyleItem { elementType:"button" width:widget.width/2 height:widget.height-4 diff --git a/components/TabBar.qml b/components/TabBar.qml index 1b78aa653da33d9fec43bdfe56f6ec497e80ec6a..4a1504575ec06a0925f795410f4c5543e5676233 100644 --- a/components/TabBar.qml +++ b/components/TabBar.qml @@ -38,7 +38,7 @@ Item { return null; } - QStyleItem { + StyleItem { visible:false id:styleitem elementType: "tab" @@ -75,7 +75,7 @@ Item { height = rect.height } // Component.onCompleted: print("taboverlap" + tabOverlap + " tabbaseoverlap " + tabBaseOverlap + " overlap " +__overlap + " hspace " + tabHSpace) - QStyleItem { + StyleItem { id: style elementType: "tab" selected: tab.selected diff --git a/components/TabFrame.qml b/components/TabFrame.qml index ae3c73c00e0bb632bea9b431f1bd43b942640028..841e9659e638eee6e7bc20519fb73ec88f659e91 100644 --- a/components/TabFrame.qml +++ b/components/TabFrame.qml @@ -43,7 +43,7 @@ Item { current-=1 } - QStyleItem { + StyleItem { id: frameitem z: style == "oxygen" ? 1 : 0 elementType: "tabframe" diff --git a/components/TableView.qml b/components/TableView.qml index 1ca44d9348f2b93ee76f7686ab1d7cbf9540de0c..4549d02f073f3ecf178950ad70caf072c98b29c1 100644 --- a/components/TableView.qml +++ b/components/TableView.qml @@ -116,7 +116,7 @@ FocusScope{ Component { id: nativeDelegate // This gives more native styling, but might be less performant - QStyleItem { + StyleItem { elementType: "item" text: itemValue selected: itemSelected @@ -125,7 +125,7 @@ FocusScope{ Component { id: headerDelegate - QStyleItem { + StyleItem { elementType: "header" activeControl: itemSort raised: true @@ -137,7 +137,7 @@ FocusScope{ Component { id: rowDelegate - QStyleItem { + StyleItem { id: rowstyle elementType: "itemrow" activeControl: itemAlternateBackground ? "alternate" : "" @@ -154,7 +154,7 @@ FocusScope{ anchors.bottomMargin: (!frameAroundContents && hscrollbar.visible ? hscrollbar.height : 0) +frameWidth } - QStyleItem { + StyleItem { id: frameitem elementType: "frame" onElementTypeChanged: scrollarea.frameWidth = styleitem.pixelMetric("defaultframewidth"); @@ -457,7 +457,7 @@ FocusScope{ header[index].width = minWidth } onPressedChanged: if(pressed)offset=mouseX - QStyleItem { + StyleItem { anchors.fill: parent cursor: "splithcursor" } @@ -557,7 +557,7 @@ FocusScope{ onTriggered:contentY = vscrollbar.value } - QStyleItem { + StyleItem { z: 2 anchors.fill: parent anchors.margins: -4 @@ -565,13 +565,13 @@ FocusScope{ elementType: "focusframe" } - QStyleItem { + StyleItem { id: styleitem elementType: "header" visible:false property int frameoffset: style === "mac" ? -1 : 0 } - QStyleItem { + StyleItem { id: rowstyleitem elementType: "item" visible:false diff --git a/components/TextField.qml b/components/TextField.qml index 0c06824558463eb173dd5659df3757edadca656f..9ff7debf44ceedbb784c8d50472bfda66fe1920d 100644 --- a/components/TextField.qml +++ b/components/TextField.qml @@ -15,7 +15,7 @@ Components.TextField { width: 200 clip: false - background: QStyleItem { + background: StyleItem { anchors.fill: parent elementType: "edit" sunken: true @@ -28,7 +28,7 @@ Components.TextField { anchors.fill: textfield parent: textfield visible: framestyle.styleHint("focuswidget") - QStyleItem { + StyleItem { id: framestyle anchors.margins: -2 anchors.rightMargin:-4 diff --git a/components/ToolBar.qml b/components/ToolBar.qml index 6185cc6ca1c38841241332ba5916509ef3de03ef..67fc21d6b8f9037645e10736e95ca7ca6a4ad810 100644 --- a/components/ToolBar.qml +++ b/components/ToolBar.qml @@ -1,7 +1,7 @@ import QtQuick 1.0 import "custom" as Components -QStyleItem{ +StyleItem{ id: toolbar width: 200 height: sizeFromContents(32, 32).height diff --git a/components/ToolButton.qml b/components/ToolButton.qml index 82593bc55246fb17031adbcc655ee0b1e3922a3c..68a07e97f916caf4813745ca0e79b4f3255a3645 100644 --- a/components/ToolButton.qml +++ b/components/ToolButton.qml @@ -7,9 +7,9 @@ Components.Button { height: 40; //styleitem.sizeFromContents(32, 32).height width: 40; //styleitem.sizeFromContents(32, 32).width - QStyleItem {elementType: "toolbutton"; id:styleitem } + StyleItem {elementType: "toolbutton"; id:styleitem } - background: QStyleItem { + background: StyleItem { anchors.fill: parent id: styleitem elementType: "toolbutton" diff --git a/examples/Gallery.qml b/examples/Gallery.qml index 50af1aa8acb20b843d8da8c43964fd4401122758..e559a4155ed3a40a51aebb0bfd6d721710823feb 100644 --- a/examples/Gallery.qml +++ b/examples/Gallery.qml @@ -205,7 +205,7 @@ Rectangle { } SystemPalette {id: syspal} - QStyleItem{ id: styleitem} + StyleItem{ id: styleitem} color: syspal.window ListModel { id: choices diff --git a/examples/TableViewGallery.qml b/examples/TableViewGallery.qml index 033acf0294e515f109fe8c747ecc752ee76da282..41a966c3c1a1f2cc516fdc8a6f2633c21a27da85 100644 --- a/examples/TableViewGallery.qml +++ b/examples/TableViewGallery.qml @@ -36,7 +36,7 @@ Rectangle { } SystemPalette {id: syspal} - QStyleItem{ id: styleitem} + StyleItem{ id: styleitem} color: syspal.window XmlListModel { diff --git a/src/styleitem/qstyleplugin.cpp b/src/styleitem/qstyleplugin.cpp index 7bf9c846101b26beabdaf7e4c2dbcad8f6423a68..6a0273af7165ec53366e8356179da19773e15bb9 100644 --- a/src/styleitem/qstyleplugin.cpp +++ b/src/styleitem/qstyleplugin.cpp @@ -79,8 +79,7 @@ public: void StylePlugin::registerTypes(const char *uri) { - qDebug() << "register" << uri; - qmlRegisterType<QStyleItem>(uri, 0, 1, "QStyleItem"); + qmlRegisterType<QStyleItem>(uri, 0, 1, "StyleItem"); qmlRegisterType<QRangeModel>(uri, 0, 1, "RangeModel"); qmlRegisterType<QGraphicsDropShadowEffect>(uri, 0, 1, "DropShadow"); qmlRegisterType<QDeclarativeFolderListModel>(uri, 0, 1, "FileSystemModel");