mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -04:00
Use a Loader to create the rating menu on demand to improve performance
This commit is contained in:
parent
3b54012d90
commit
44ae4cc2a6
@ -376,30 +376,38 @@ SplitView {
|
|||||||
comicsSelectionHelper.clear();
|
comicsSelectionHelper.clear();
|
||||||
comicsSelectionHelper.selectIndex(index);
|
comicsSelectionHelper.selectIndex(index);
|
||||||
grid.currentIndex = index;
|
grid.currentIndex = index;
|
||||||
ratingConextMenu.popup();
|
ratingLoader.active = true;
|
||||||
}
|
ratingLoader.item.popup();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Menu {
|
Loader {
|
||||||
background: Rectangle {
|
id: ratingLoader
|
||||||
implicitWidth: 42
|
active: false
|
||||||
implicitHeight: 100
|
sourceComponent: ratingConextMenuComponent
|
||||||
//border.color: "#222"
|
}
|
||||||
//color: "#444"
|
|
||||||
}
|
|
||||||
|
|
||||||
id: ratingConextMenu
|
Component {
|
||||||
|
id: ratingConextMenuComponent
|
||||||
|
Menu {
|
||||||
|
background: Rectangle {
|
||||||
|
implicitWidth: 42
|
||||||
|
implicitHeight: 100
|
||||||
|
}
|
||||||
|
|
||||||
Action { text: "1"; enabled: true; onTriggered: comicRatingHelper.rate(index,1) }
|
id: ratingConextMenu
|
||||||
Action { text: "2"; enabled: true; onTriggered: comicRatingHelper.rate(index,2) }
|
|
||||||
Action { text: "3"; enabled: true; onTriggered: comicRatingHelper.rate(index,3) }
|
|
||||||
Action { text: "4"; enabled: true; onTriggered: comicRatingHelper.rate(index,4) }
|
|
||||||
Action { text: "5"; enabled: true; onTriggered: comicRatingHelper.rate(index,5) }
|
|
||||||
|
|
||||||
delegate: MenuItem {
|
Action { text: "1"; enabled: true; onTriggered: comicRatingHelper.rate(index,1) }
|
||||||
implicitHeight: 30
|
Action { text: "2"; enabled: true; onTriggered: comicRatingHelper.rate(index,2) }
|
||||||
}
|
Action { text: "3"; enabled: true; onTriggered: comicRatingHelper.rate(index,3) }
|
||||||
}
|
Action { text: "4"; enabled: true; onTriggered: comicRatingHelper.rate(index,4) }
|
||||||
|
Action { text: "5"; enabled: true; onTriggered: comicRatingHelper.rate(index,5) }
|
||||||
|
|
||||||
|
delegate: MenuItem {
|
||||||
|
implicitHeight: 30
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//comic rating
|
//comic rating
|
||||||
|
Loading…
Reference in New Issue
Block a user