<file>button/buttonR.png</file>
<file>button/go-previous.png</file>
<file>progressBar/background.png</file>
+ <file>button/buttonCenterDisabled.png</file>
+ <file>button/buttonCenterPushed.png</file>
+ <file>button/buttonRightDisabled.png</file>
+ <file>button/buttonRightPushed.png</file>
+ <file>button/buttonLeftDisabled.png</file>
+ <file>button/buttonLeftPushed.png</file>
+ <file>button/checkbox.png</file>
+ <file>button/checkboxChecked.png</file>
</qresource>
</RCC>
ctxt = qmlView->rootContext();
refreshDictsList();
- //model = new DictManagerModel(, this);
ctxt->setContextProperty("dictModel", &(*model));
QGraphicsObject *rootObject = qmlView->rootObject();
//closeButton = new QPushButton(tr("Save"));
//buttonGroup->addWidget(closeButton);
- setMinimumWidth(sizeHint().width()*1.2);
- setMaximumWidth(sizeHint().width()*2);
- setMinimumHeight(sizeHint().height());
- setMaximumHeight(sizeHint().height()*2);
+// setMinimumWidth(sizeHint().width()*1.2);
+// setMaximumWidth(sizeHint().width()*2);
+// setMinimumHeight(sizeHint().height());
+// setMaximumHeight(sizeHint().height()*2);
//connect(closeButton, SIGNAL(clicked()), this, SLOT(save()));
#endif
}
QHash<CommonDictInterface*, bool> dicts = guiInterface->getDictionaries();
if (model == 0){
+ qDebug("ok");
model = new DictManagerModel(dicts, this);
} else {
+ qDebug("lol");
model->clear();
model->setDictionaries(dicts);
}
#include "DictManagerModel.h"
#include <QtDeclarative/QDeclarativeView>
#include <QtDeclarative/QDeclarativeContext>
+#include <QDebug>
/*!
style: Text.Sunken; color: "white"; styleColor: "black"; smooth: true
}
- Rectangle {
- id: shade
- anchors.centerIn: parent;
- radius: parent.height*.4;
- color: "black";
- opacity: 0
- width: parent.width;
- height: parent.height;
- }
+// Rectangle {
+// id: shade
+// anchors.centerIn: parent;
+// radius: parent.height*.4;
+// color: "black";
+// opacity: 0
+// width: parent.width;
+// height: parent.height;
+// }
Image {
id: image1
states: [
State {
- name: "pressed"; when: mouseArea.pressed == true
- PropertyChanges { target: shade; opacity: 0.4 }
- PropertyChanges { target: image1; opacity: 0.5 }
- PropertyChanges { target: image3; opacity: 0.5 }
- PropertyChanges { target: image2; opacity: 0.5 }
+ name: "pressed";
+ when: (mouseArea.pressed == true && button.enabled == true);
+
+ PropertyChanges { target: image1; source: "qrc:/button/buttonLeftPushed.png" }
+ PropertyChanges { target: image3; source: "qrc:/button/buttonCenterPushed.png" }
+ PropertyChanges { target: image2; source: "qrc:/button/buttonRightPushed.png" }
+ },
+ State {
+ name: "disabled";
+ when: (button.enabled == false);
+
+ PropertyChanges { target: image1; source: "qrc:/button/buttonLeftDisabled.png" }
+ PropertyChanges { target: image3; source: "qrc:/button/buttonCenterDisabled.png" }
+ PropertyChanges { target: image2; source: "qrc:/button/buttonRightDisabled.png" }
}
]
id: dictListDelegate
Item {
width: rectangle1.width
- height: typeText.height
+ height: {
+ if (nameText.height + 10 > logo.height)
+ return nameText.height + 10;
+ else
+ return logo.height;
+ }
MouseArea{
anchors.fill: parent
onClicked: {
- dictTypeList.currentIndex = number
+ dictList.currentIndex = number
}
onDoubleClicked: {
selectedRow(number)
}
Row {
//image zaznacz/odznacz
- //image logo
+ anchors.fill: parent
+ Image {
+ id: checkbox
+// source: "qrc:/button/checkbox.png"
+ height: {
+ var aspectRatio = sourceSize.height / sourceSize.width
+ return logo.width * aspectRatio
+ }
+ anchors.verticalCenter: parent.verticalCenter
+ width: nameText.height + 10
+ states: [
+ State {
+ name: "checked";
+ when: (isSelected == true);
+
+ PropertyChanges { target: checkbox; source: "qrc:/button/checkboxChecked.png" }
+ },
+ State {
+ name: "unchecked";
+ when: (isSelected == false);
+
+ PropertyChanges { target: checkbox; source: "qrc:/button/checkbox.png" }
+ }
+ ]
+ }
+
Image {
id: logo
source: iconPath
+ height: {
+ var aspectRatio = sourceSize.height / sourceSize.width
+ return logo.width * aspectRatio
+ }
+ anchors.verticalCenter: parent.verticalCenter
+ width: nameText.height + 10
}
Text {
id: nameText
text: name
-// width: rectangle1.width
+ anchors.left: logo.right
+ anchors.leftMargin: 5
+ anchors.verticalCenter: parent.verticalCenter
}
}
}
source: "qrc:/button/buttonR.png"
}
- Rectangle {
- id: shade
- z: 4
- anchors.centerIn: parent;
- color: "black";
- radius: 20;
- opacity: 1;
- width: rectangle.width;
- height: rectangle.height;
- }
states: [
State {
- name: "enable";
- when: (mouseArea.pressed == false && rectangle.enabled == true);
- PropertyChanges { target: shade;
- opacity: 0; }
- },
- State {
name: "disable";
when: (rectangle.enabled == false);
- PropertyChanges { target: shade;
- color: "black";
- opacity: .5; }
+ PropertyChanges { target: image1; source: "qrc:/button/buttonLeftDisabled.png" }
+ PropertyChanges { target: image3; source: "qrc:/button/buttonCenterDisabled.png" }
+ PropertyChanges { target: image2; source: "qrc:/button/buttonRightDisabled.png" }
},
State {
name: "clicked";
when: (mouseArea.pressed == true && rectangle.enabled == true);
- PropertyChanges { target: shade;
- color: "#fffead"
- opacity: 0.5; }
+ PropertyChanges { target: image1; source: "qrc:/button/buttonLeftPushed.png" }
+ PropertyChanges { target: image3; source: "qrc:/button/buttonCenterPushed.png" }
+ PropertyChanges { target: image2; source: "qrc:/button/buttonRightPushed.png" }
}
]
}