-
-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0281f91
commit bc65990
Showing
15 changed files
with
227 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,6 @@ | |
"website": "https://librumreader.com", | ||
"newsWebsite": "https://librumreader.com/news", | ||
"companyEmail": "[email protected]", | ||
"githubLink": "https://github.com/Librum-Reader/Librum" | ||
"githubLink": "https://github.com/Librum-Reader/Librum", | ||
"feedbackLink": "https://forms.gle/bzmMgN4ucmtzAM1XA" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
pragma Singleton | ||
|
||
import QtCore | ||
|
||
Settings { | ||
location: "last_run_settings" | ||
|
||
property string theme: "Dark" | ||
property string lastFeedbackQuery: new Date().toString() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,31 @@ | ||
function checkIfNewPageIsTheSameAsOld(sidebarItem) | ||
{ | ||
return sidebar.currentItem === sidebarItem; | ||
function checkIfNewPageIsTheSameAsOld(sidebarItem) { | ||
return sidebar.currentItem === sidebarItem | ||
} | ||
|
||
function terminateActionOfCurrentPage(page, sidebarItem) | ||
{ | ||
let currentPage = pageManager.currentItem; | ||
if(currentPage instanceof MSettings) | ||
{ | ||
if(!currentPage.saveSettingsPage(switchPage, page, sidebarItem)) | ||
return false; | ||
function terminateActionOfCurrentPage(page, sidebarItem) { | ||
let currentPage = pageManager.currentItem | ||
if (currentPage instanceof MSettings) { | ||
if (!currentPage.saveSettingsPage(switchPage, page, sidebarItem)) | ||
return false | ||
} | ||
return true; | ||
|
||
return true | ||
} | ||
|
||
function switchPage(page, sidebarItem) | ||
{ | ||
pageManager.replace(page); | ||
function switchPage(page, sidebarItem) { | ||
pageManager.prevPage = pageManager.currentItem | ||
pageManager.replace(page) | ||
|
||
// Set sidebar | ||
pageManager.pageHasSidebar = sidebarItem !== undefined; | ||
if(pageManager.pageHasSidebar) | ||
sidebar.changeSelectedItem(sidebarItem); | ||
pageManager.pageHasSidebar = sidebarItem !== undefined | ||
if (pageManager.pageHasSidebar) | ||
sidebar.changeSelectedItem(sidebarItem) | ||
|
||
// The reading page can have a lower minimum width than the other pages | ||
if(page === readingPage) | ||
baseRoot.minimumWidth = baseRoot.readingPageMinWidth; | ||
else if(sidebar.open) | ||
baseRoot.minimumWidth = baseRoot.sidebarOpenedMinWidth; | ||
if (page === readingPage) | ||
baseRoot.minimumWidth = baseRoot.readingPageMinWidth | ||
else if (sidebar.open) | ||
baseRoot.minimumWidth = baseRoot.sidebarOpenedMinWidth | ||
else | ||
baseRoot.minimumWidth = baseRoot.defaultMinWidth; | ||
} | ||
baseRoot.minimumWidth = baseRoot.defaultMinWidth | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
106 changes: 106 additions & 0 deletions
106
src/presentation/modules/CustomComponents/MFeedbackPopup.qml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
import QtQuick | ||
import QtQuick.Controls | ||
import QtQuick.Layouts | ||
import Librum.fonts | ||
import Librum.style | ||
import Librum.icons | ||
import Librum.controllers | ||
import CustomComponents | ||
import Librum.globalSettings | ||
|
||
Popup { | ||
id: root | ||
implicitWidth: 560 | ||
implicitHeight: layout.height + 32 | ||
horizontalPadding: 36 | ||
verticalPadding: 24 | ||
closePolicy: Popup.CloseOnPressOutside | Popup.CloseOnEscape | ||
focus: true | ||
background: Rectangle { | ||
color: Style.colorPopupBackground | ||
border.width: 1 | ||
border.color: Style.colorContainerBorder | ||
radius: 6 | ||
antialiasing: true | ||
} | ||
|
||
ColumnLayout { | ||
id: layout | ||
width: parent.width | ||
spacing: 0 | ||
|
||
LayoutMirroring.enabled: baseRoot.rightAlign | ||
LayoutMirroring.childrenInherit: true | ||
|
||
Label { | ||
id: popupTitle | ||
Layout.alignment: Qt.AlignLeft | ||
Layout.topMargin: 12 | ||
Layout.fillWidth: true | ||
text: qsTr("Got some feedback?") | ||
elide: Text.ElideRight | ||
font.weight: Font.Medium | ||
font.pointSize: Fonts.size18 | ||
color: Style.colorTitle | ||
} | ||
|
||
Label { | ||
id: infoText | ||
Layout.alignment: Qt.AlignHCenter | ||
Layout.topMargin: 16 | ||
font.pointSize: Fonts.size12dot25 | ||
Layout.fillWidth: true | ||
wrapMode: Text.WordWrap | ||
color: Style.colorText | ||
text: qsTr("Your feedback is crucial for improving Librum. Would you mind sharing your experience by taking a quick survey?") | ||
} | ||
|
||
RowLayout { | ||
Layout.fillWidth: true | ||
Layout.topMargin: 36 | ||
Layout.bottomMargin: 18 | ||
height: cancelButton.height | ||
spacing: 12 | ||
|
||
MButton { | ||
id: cancelButton | ||
Layout.fillWidth: true | ||
Layout.preferredHeight: 40 | ||
borderWidth: 1 | ||
backgroundColor: "transparent" | ||
fontSize: Fonts.size11 | ||
opacityOnPressed: 0.85 | ||
textColor: Style.colorText | ||
text: qsTr("No, Thanks") | ||
|
||
onClicked: root.close() | ||
} | ||
|
||
MButton { | ||
id: acceptButton | ||
Layout.fillWidth: true | ||
Layout.preferredHeight: 40 | ||
borderWidth: 0 | ||
backgroundColor: Style.colorBasePurple | ||
fontSize: Fonts.size11 | ||
opacityOnPressed: 0.85 | ||
textColor: Style.colorFocusedButtonText | ||
text: qsTr("Let's do this!") | ||
|
||
onClicked: { | ||
Qt.openUrlExternally(AppInfoController.feedbackLink) | ||
|
||
// Ask the user again in half a year after they've taken the survey | ||
var date = new Date() | ||
date.setDate((new Date()).getDate() + 183) | ||
GlobalSettings.lastFeedbackQuery = date.toString() | ||
root.close() | ||
} | ||
} | ||
} | ||
} | ||
|
||
function giveFocus() { | ||
root.forceActiveFocus() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.