Skip to content

Commit

Permalink
fix tooltip delay being instant
Browse files Browse the repository at this point in the history
  • Loading branch information
moonshadow565 committed Aug 27, 2022
1 parent 4b70b07 commit af57c49
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/qml/CSLOLDialogEditMod.qml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ Dialog {
checked: true
text: qsTr("Remove unknown")
Layout.leftMargin: 5
ToolTip {
CSLOLToolTip {
text: qsTr("Uncheck this if you are adding new files to game!")
visible: parent.hovered
}
Expand Down
2 changes: 1 addition & 1 deletion src/qml/CSLOLDialogError.qml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Dialog {
logTextArea.copy()
logTextArea.deselect()
}
ToolTip {
CSLOLToolTip {
text: qsTr("Puts log contents in your clipboard")
visible: parent.hovered
}
Expand Down
4 changes: 3 additions & 1 deletion src/qml/CSLOLDialogUpdate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ Dialog {
function checkForUpdates() {
let url = "https://api.github.com/repos/LoL-Fantome/cslol-manager";
makeRequest(url + "/releases", function(releases) {
for (let release in releases) {
for (let index in releases) {
let release = releases[index]
switch (enableUpdates) {
case Qt.Unchecked:
// recieve only mandatory updates
Expand Down Expand Up @@ -79,6 +80,7 @@ Dialog {
}
})
})
break;
}
})
}
Expand Down
20 changes: 10 additions & 10 deletions src/qml/CSLOLModsView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ ColumnLayout {
cslolModsView.checkedUpdate()
}
}
ToolTip {
CSLOLToolTip {
text: qsTr("Enable this mod")
visible: parent.hovered
}
Expand Down Expand Up @@ -358,7 +358,7 @@ ColumnLayout {
cslolModsViewModel.remove(index, 1)
cslolModsView.modRemoved(modName)
}
ToolTip {
CSLOLToolTip {
text: qsTr("Remove this mod")
visible: parent.hovered
}
Expand All @@ -370,7 +370,7 @@ ColumnLayout {
let modName = model.FileName
cslolModsView.modExport(modName)
}
ToolTip {
CSLOLToolTip {
text: qsTr("Export this mod")
visible: parent.hovered
}
Expand All @@ -382,7 +382,7 @@ ColumnLayout {
let modName = model.FileName
cslolModsView.modEdit(modName)
}
ToolTip {
CSLOLToolTip {
text: qsTr("Edit this mod")
visible: parent.hovered
}
Expand All @@ -396,7 +396,7 @@ ColumnLayout {
Qt.openUrlExternally(url)
}
}
ToolTip {
CSLOLToolTip {
text: qsTr("Mod updates")
visible: parent.hovered
}
Expand All @@ -410,7 +410,7 @@ ColumnLayout {
Qt.openUrlExternally(url)
}
}
ToolTip {
CSLOLToolTip {
text: qsTr("Support this author")
visible: parent.hovered
}
Expand All @@ -434,7 +434,7 @@ ColumnLayout {
nextCheckState: function() {
return checkState === Qt.Checked ? Qt.Unchecked : Qt.Checked
}
ToolTip {
CSLOLToolTip {
text: qsTr("Enable all mods")
visible: parent.hovered
}
Expand All @@ -460,7 +460,7 @@ ColumnLayout {
font.family: "FontAwesome"
onClicked: cslolModsView.tryRefresh()
Material.background: Material.primaryColor
ToolTip {
CSLOLToolTip {
text: qsTr("Refresh")
visible: parent.hovered
}
Expand All @@ -471,7 +471,7 @@ ColumnLayout {
font.family: "FontAwesome"
onClicked: cslolModsView.createNewMod()
Material.background: Material.primaryColor
ToolTip {
CSLOLToolTip {
text: qsTr("Create new mod")
visible: parent.hovered
}
Expand All @@ -482,7 +482,7 @@ ColumnLayout {
font.family: "FontAwesome"
onClicked: cslolModsView.installFantomeZip()
Material.background: Material.primaryColor
ToolTip {
CSLOLToolTip {
text: qsTr("Import new mod")
visible: parent.hovered
}
Expand Down
14 changes: 7 additions & 7 deletions src/qml/CSLOLToolBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ToolBar {
text: "\uf013"
font.family: "FontAwesome"
onClicked: cslolToolBar.openSideMenu()
ToolTip {
CSLOLToolTip {
text: qsTr("Open settings dialog")
visible: parent.hovered
}
Expand All @@ -38,7 +38,7 @@ ToolBar {
currentIndex: 0
enabled: !isBussy
model: cslolToolBar.profilesModel
ToolTip {
CSLOLToolTip {
text: qsTr("Select a profile to save, load or remove")
visible: parent.hovered
}
Expand All @@ -55,7 +55,7 @@ ToolBar {
text: qsTr("Save")
onClicked: cslolToolBar.saveProfileAndRun(false)
enabled: !isBussy
ToolTip {
CSLOLToolTip {
text: qsTr("Save enabled mods for selected profile")
visible: parent.hovered
}
Expand All @@ -64,7 +64,7 @@ ToolBar {
text: qsTr("Load")
onClicked: cslolToolBar.loadProfile()
enabled: !isBussy
ToolTip {
CSLOLToolTip {
text: qsTr("Load enabled mods for selected profile")
visible: parent.hovered
}
Expand All @@ -73,7 +73,7 @@ ToolBar {
text: qsTr("Delete")
onClicked: cslolToolBar.removeProfile()
enabled: !isBussy
ToolTip {
CSLOLToolTip {
text: qsTr("Delete selected profile")
visible: parent.hovered
}
Expand All @@ -82,7 +82,7 @@ ToolBar {
text: qsTr("New")
onClicked: cslolToolBar.newProfile()
enabled: !isBussy
ToolTip {
CSLOLToolTip {
text: qsTr("Create new profile")
visible: parent.hovered
}
Expand All @@ -97,7 +97,7 @@ ToolBar {
}
}
enabled: !isBussy || window.patcherRunning
ToolTip {
CSLOLToolTip {
text: qsTr("Runs patcher for currently selected mods")
visible: parent.hovered
}
Expand Down
7 changes: 7 additions & 0 deletions src/qml/CSLOLToolTip.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import QtQuick 2.15
import QtQuick.Controls 2.15

ToolTip {
visible: parent.hovered
delay: 2000
}
1 change: 1 addition & 0 deletions src/qml/qml.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@
<file>CSLOLDialogSettings.qml</file>
<file>CSLOLModInfoEdit.qml</file>
<file>CSLOLDialogGame.qml</file>
<file>CSLOLToolTip.qml</file>
</qresource>
</RCC>

0 comments on commit af57c49

Please sign in to comment.