diff --git a/components/ChoiceList.qml b/components/ChoiceList.qml deleted file mode 100644 index 82e624039f58e0079091b0ec94a865d1e0aadbfe..0000000000000000000000000000000000000000 --- a/components/ChoiceList.qml +++ /dev/null @@ -1,61 +0,0 @@ -import QtQuick 1.1 -import "custom" as Components - -Components.ChoiceList { - - id: choicelist - - property int buttonHeight: backgroundItem.sizeFromContents(100, 18).height - property int buttonWidth: backgroundItem.sizeFromContents(100, 18).width - - property string styleHint - - implicitWidth: buttonHeight - implicitHeight: buttonWidth - - topMargin: 4 - bottomMargin: 4 - - background: StyleItem { - anchors.fill: parent - elementType: "combobox" - sunken: pressed - raised: !pressed - hover: containsMouse - enabled: choicelist.enabled - text: currentItemText - hasFocus: choicelist.focus - hint: choicelist.styleHint - } - - listItem: Item { - id:item - - height: 22 - anchors.left: parent.left - width: choicelist.width - StyleItem { - anchors.fill: parent - elementType: "comboboxitem" - text: itemText - selected: highlighted - - } - } - popupFrame: StyleItem { - property string popupLocation: backgroundItem.styleHint("comboboxpopup") ? "center" : "below" - property int fw: backgroundItem.pixelMetric("menupanelwidth"); - anchors.leftMargin: backgroundItem.pixelMetric("menuhmargin") + fw - anchors.rightMargin: backgroundItem.pixelMetric("menuhmargin") + fw - anchors.topMargin: backgroundItem.pixelMetric("menuvmargin") + fw - anchors.bottomMargin: backgroundItem.pixelMetric("menuvmargin") + fw - elementType: "menu" - - effect: DropShadow { - blurRadius: 18 - color: "#90000000" - xOffset: 1 - yOffset: 1 - } - } -} diff --git a/components/components.pro b/components/components.pro index 60f178fccf1cc1eddbf7b6e6dd699ce59f0f6689..a761830d018660891baa349c535d069994ea1e59 100644 --- a/components/components.pro +++ b/components/components.pro @@ -34,7 +34,6 @@ QML_FILES = \ SpinBox.qml \ TabFrame.qml \ TextArea.qml \ - ChoiceList.qml \ ScrollArea.qml \ SplitterRow.qml \ SplitterColumn.qml \ diff --git a/components/custom/ChoiceList.qml b/components/custom/ChoiceList.qml deleted file mode 100644 index 2f88184941964a66df97d75f5654303f343e9b1f..0000000000000000000000000000000000000000 --- a/components/custom/ChoiceList.qml +++ /dev/null @@ -1,49 +0,0 @@ -import QtQuick 1.1 -import "./private" as Private - -Item { - id: choiceList - - property alias model: popup.model - property alias currentIndex: popup.currentIndex - property alias currentText: popup.currentText - property alias popupOpen: popup.popupOpen - property alias containsMouse: popup.containsMouse - property alias pressed: popup.buttonPressed - - property Component background: null - property Item backgroundItem: backgroundLoader.item - property Component listItem: null - property Component popupFrame: null - - property int leftMargin: 0 - property int topMargin: 0 - property int rightMargin: 0 - property int bottomMargin: 0 - - property string popupBehavior - width: 0 - height: 0 - - property bool activeFocusOnPress: true - - Loader { - id: backgroundLoader - property alias styledItem: choiceList - sourceComponent: background - anchors.fill: parent - property string currentItemText: model.get(currentIndex).text - } - - Private.ChoiceListPopup { - // NB: This ChoiceListPopup is also the mouse area - // for the component (to enable drag'n'release) - id: popup - listItem: choiceList.listItem - popupFrame: choiceList.popupFrame - } - - Keys.onSpacePressed: { choiceList.popupOpen = !choiceList.popupOpen } - Keys.onUpPressed: { if (currentIndex < model.count - 1) currentIndex++ } - Keys.onDownPressed: {if (currentIndex > 0) currentIndex-- } -} diff --git a/components/custom/components.pro b/components/custom/components.pro index 4b4dffd48562fb077fe096b7ff31bec39721a4aa..e063d91d5aabacbd1cb33aa55a9ad67dbf3b4421 100644 --- a/components/custom/components.pro +++ b/components/custom/components.pro @@ -17,7 +17,6 @@ QML_FILES = \ ButtonGroup.js \ Button.qml \ CheckBox.qml \ - ChoiceList.qml \ Splitter.qml \ ProgressBar.qml \ RadioButton.qml \ diff --git a/components/custom/qmldir b/components/custom/qmldir index fb12b4aea42ae2493687bba4b57fa554b3e9efaf..716e44fa057d624b35295d3ba7cdbafaeefca4aa 100644 --- a/components/custom/qmldir +++ b/components/custom/qmldir @@ -6,7 +6,6 @@ Button 1.0 Button.qml ButtonColumn 1.0 ButtonColumn.qml ButtonRow 1.0 ButtonRow.qml CheckBox 1.0 CheckBox.qml -ChoiceList 1.0 ChoiceList.qml ProgressBar 1.0 ProgressBar.qml Slider 1.0 Slider.qml SpinBox 1.0 SpinBox.qml diff --git a/components/qmldir b/components/qmldir index 433bfdf98583ba96faaf1a41a502769bd757f7e1..000c0218d933945806f18b77f8ec8bdf903d4456 100644 --- a/components/qmldir +++ b/components/qmldir @@ -10,7 +10,6 @@ Tab 0.1 Tab.qml Frame 0.1 Frame.qml ScrollArea 0.1 ScrollArea.qml ScrollBar 0.1 ScrollBar.qml -ChoiceList 0.1 ChoiceList.qml ComboBox 0.1 ComboBox.qml ToolButton 0.1 ToolButton.qml TextArea 0.1 TextArea.qml diff --git a/examples/TableViewGallery.qml b/examples/TableViewGallery.qml index cd642d2e1f5c339833e17150de1cbab40952253a..e64a4429c68ec2886f3628704570605af544c527 100644 --- a/examples/TableViewGallery.qml +++ b/examples/TableViewGallery.qml @@ -17,7 +17,7 @@ Rectangle { onPressed: editmenu.show(mouseX, mouseY) } - ChoiceList { + ComboBox { id: delegateChooser enabled: frame.current == 4 ? 1 : 0 model: delegatemenu @@ -117,7 +117,7 @@ Rectangle { title: "DirModel" TableView { - model: FileSystemModel{} +// model: FileSystemModel{} anchors.fill: parent anchors.margins: 12