mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 21:14:33 -04:00
add drag and drop onto app icon (dock etc.) support for MacOS platform.
This commit is contained in:
50
YACReaderLibrary/qml/InfoRating.qml
Normal file
50
YACReaderLibrary/qml/InfoRating.qml
Normal file
@ -0,0 +1,50 @@
|
||||
import QtQuick 2.6
|
||||
|
||||
import QtGraphicalEffects 1.0
|
||||
|
||||
Row {
|
||||
spacing: 0
|
||||
property int rating : 0
|
||||
property int mouseIndex : 0
|
||||
|
||||
signal ratingChangedByUser(int rating)
|
||||
|
||||
Repeater {
|
||||
id: rating_compact
|
||||
model: 5
|
||||
Item {
|
||||
width: 25
|
||||
height: 20
|
||||
|
||||
Image {
|
||||
id: star
|
||||
source: "info-rating.png"
|
||||
}
|
||||
|
||||
ColorOverlay {
|
||||
anchors.fill: star
|
||||
source: star
|
||||
color: index < (mouseIndex > 0 ? mouseIndex : rating) ? "#ffffff" : "#1c1c1c"
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
|
||||
onPositionChanged: {
|
||||
mouseIndex = index + 1;
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
ratingChangedByUser(mouseIndex);
|
||||
}
|
||||
|
||||
onExited: {
|
||||
mouseIndex = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user