mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
Add workaround for rating context menu crashing in macos
For now we will have two different versions of the rating component.
This commit is contained in:
parent
59604218f4
commit
786c28bba0
@ -345,36 +345,8 @@ Rectangle {
|
||||
}
|
||||
|
||||
//rating icon
|
||||
Image {
|
||||
id: ratingImage
|
||||
anchors {bottom: realCell.bottom; right: pageImage.left; bottomMargin: 5; rightMargin: Math.floor(pages.width)+12}
|
||||
source: "star.png"
|
||||
width: 13
|
||||
height: 11
|
||||
RatingContextMenu {
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onPressed: {
|
||||
console.log("rating");
|
||||
comicsSelectionHelper.clear();
|
||||
comicsSelectionHelper.selectIndex(index);
|
||||
grid.currentIndex = index;
|
||||
ratingConextMenu.popup();
|
||||
}
|
||||
}
|
||||
|
||||
MenuBar
|
||||
{
|
||||
Menu {
|
||||
id: ratingConextMenu
|
||||
MenuItem { text: "1"; enabled: true; iconSource:"star_menu.png"; onTriggered: comicRatingHelper.rate(index,1) }
|
||||
MenuItem { text: "2"; enabled: true; iconSource:"star_menu.png"; onTriggered: comicRatingHelper.rate(index,2) }
|
||||
MenuItem { text: "3"; enabled: true; iconSource:"star_menu.png"; onTriggered: comicRatingHelper.rate(index,3) }
|
||||
MenuItem { text: "4"; enabled: true; iconSource:"star_menu.png"; onTriggered: comicRatingHelper.rate(index,4) }
|
||||
MenuItem { text: "5"; enabled: true; iconSource:"star_menu.png"; onTriggered: comicRatingHelper.rate(index,5) }
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//comic rating
|
||||
|
32
YACReaderLibrary/qml/RatingContextMenu-osx.qml
Normal file
32
YACReaderLibrary/qml/RatingContextMenu-osx.qml
Normal file
@ -0,0 +1,32 @@
|
||||
import QtQuick 2.9
|
||||
|
||||
import QtQuick.Controls 1.4
|
||||
|
||||
Image {
|
||||
id: ratingImage
|
||||
anchors {bottom: realCell.bottom; right: pageImage.left; bottomMargin: 5; rightMargin: Math.floor(pages.width)+12}
|
||||
source: "star.png"
|
||||
width: 13
|
||||
height: 11
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onPressed: {
|
||||
console.log("rating");
|
||||
comicsSelectionHelper.clear();
|
||||
comicsSelectionHelper.selectIndex(index);
|
||||
grid.currentIndex = index;
|
||||
ratingConextMenu.popup();
|
||||
}
|
||||
}
|
||||
|
||||
Menu {
|
||||
id: ratingConextMenu
|
||||
MenuItem { text: "1"; enabled: true; iconSource:"star_menu.png"; onTriggered: comicRatingHelper.rate(index,1) }
|
||||
MenuItem { text: "2"; enabled: true; iconSource:"star_menu.png"; onTriggered: comicRatingHelper.rate(index,2) }
|
||||
MenuItem { text: "3"; enabled: true; iconSource:"star_menu.png"; onTriggered: comicRatingHelper.rate(index,3) }
|
||||
MenuItem { text: "4"; enabled: true; iconSource:"star_menu.png"; onTriggered: comicRatingHelper.rate(index,4) }
|
||||
MenuItem { text: "5"; enabled: true; iconSource:"star_menu.png"; onTriggered: comicRatingHelper.rate(index,5) }
|
||||
}
|
||||
}
|
||||
|
36
YACReaderLibrary/qml/RatingContextMenu-win.qml
Normal file
36
YACReaderLibrary/qml/RatingContextMenu-win.qml
Normal file
@ -0,0 +1,36 @@
|
||||
import QtQuick 2.9
|
||||
|
||||
import QtQuick.Controls 1.4
|
||||
|
||||
Image {
|
||||
id: ratingImage
|
||||
anchors {bottom: realCell.bottom; right: pageImage.left; bottomMargin: 5; rightMargin: Math.floor(pages.width)+12}
|
||||
source: "star.png"
|
||||
width: 13
|
||||
height: 11
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onPressed: {
|
||||
console.log("rating");
|
||||
comicsSelectionHelper.clear();
|
||||
comicsSelectionHelper.selectIndex(index);
|
||||
grid.currentIndex = index;
|
||||
ratingConextMenu.popup();
|
||||
}
|
||||
}
|
||||
|
||||
MenuBar
|
||||
{
|
||||
Menu {
|
||||
id: ratingConextMenu
|
||||
MenuItem { text: "1"; enabled: true; iconSource:"star_menu.png"; onTriggered: comicRatingHelper.rate(index,1) }
|
||||
MenuItem { text: "2"; enabled: true; iconSource:"star_menu.png"; onTriggered: comicRatingHelper.rate(index,2) }
|
||||
MenuItem { text: "3"; enabled: true; iconSource:"star_menu.png"; onTriggered: comicRatingHelper.rate(index,3) }
|
||||
MenuItem { text: "4"; enabled: true; iconSource:"star_menu.png"; onTriggered: comicRatingHelper.rate(index,4) }
|
||||
MenuItem { text: "5"; enabled: true; iconSource:"star_menu.png"; onTriggered: comicRatingHelper.rate(index,5) }
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,5 +4,6 @@
|
||||
<file alias="qml/page.png">qml/page-macosx@2x.png</file>
|
||||
<file alias="qml/star.png">qml/star-macosx.png</file>
|
||||
<file alias="qml/star.png">qml/star-macosx@2x.png</file>
|
||||
<file alias="qml/RatingContextMenu.qml">qml/RatingContextMenu-osx.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@ -2,5 +2,6 @@
|
||||
<qresource prefix="/">
|
||||
<file>qml/page.png</file>
|
||||
<file>qml/star.png</file>
|
||||
<file alias="qml/RatingContextMenu.qml">qml/RatingContextMenu-win.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
Loading…
x
Reference in New Issue
Block a user