Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions Desktop/components/JASP/Widgets/AnalysesPanel.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import QtQuick
import JASP
import QtQuick.Controls
import JASP.Controls as JC


Item
{
id: analysesPane
implicitWidth: analysesForm.width + extraBorder.width
height: parent.height

Rectangle
{
// When there is an analysis without data, add an extra border at the left side of the analysis form
id: extraBorder
width: visible ? jaspTheme.splitHandleWidth : 0
visible: !hasData && hasAnalysis && analysesModel.visible
color: jaspTheme.uiBackground
border.width: 1
border.color: jaspTheme.uiBorder
anchors
{
top: parent.top
bottom: parent.bottom
left: parent.left
leftMargin: -1
topMargin: -1
bottomMargin: -1
}

}

AnalysisForms
{
id: analysesForm
visible: hasAnalysis && analysesModel.visible
width: hasAnalysis ? implicitWidth : 0
height: parent.height
x: extraBorder.width
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,22 @@ import QtQuick.Window
import QtWebEngine
import JASP.Widgets
import JASP.Controls
import QtQuick.Layouts

Window
FocusScope
{
id: enginesWindow
width: 400 * jaspTheme.uiScale
height: Screen.height
minimumWidth: 200 * preferencesModel.uiScale
minimumHeight: minimumWidth
title: qsTr("Engines Overview")
color: jaspTheme.uiBackground
visible: true
Layout.minimumWidth: 200 * preferencesModel.uiScale
Layout.maximumWidth: 600 * preferencesModel.uiScale
Layout.minimumHeight: minimumWidth
//title: qsTr("Engines Overview")
//color: jaspTheme.uiBackground
x: 0
y: 0

Shortcut { onActivated: enginesWindow.close(); sequences: ["Ctrl+W", Qt.Key_Close]; }


Connections
{
target: mainWindow
function onCloseWindows() { enginesWindow.close(); }
}

Shortcut { onActivated: engineSync.showEngines = false; sequences: ["Ctrl+W", Qt.Key_Close]; }

ListView
{
Expand Down
106 changes: 106 additions & 0 deletions Desktop/components/JASP/Widgets/HelpPanel.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
import QtQuick
import QtWebEngine
import JASP.Widgets
import JASP.Controls
import QtQuick.Layouts

FocusScope
{
id: helpWindowRoot
width: 400 * preferencesModel.uiScale
height: Math.min(700 * preferencesModel.uiScale, Screen.desktopAvailableHeight) //If bigger than screenheight weird jumping behaviour observed by Rens

//title: qsTr("JASP Help")
//color: jaspTheme.uiBackground

Shortcut { onActivated: helpModel.visible = false; sequences: ["Ctrl+W", Qt.Key_Close]; }
//Shortcut { onActivated: helpWindowRoot.toggleFullScreen(); sequences: ["Ctrl+M"]; }
Shortcut { onActivated: searchBar.startSearching(); sequences: ["Ctrl+F", Qt.Key_Search]; }

/*onClosing: { helpModel.markdown = ""; } //break binding

Connections
{
target: mainWindow
function onCloseWindows() { helpWindowRoot.close(); }
}

UIScaleNotifier { anchors.centerIn: parent }*/

WebEngineView
{
id: helpView
url: helpModel.indexURL()
anchors.fill: parent
anchors.bottomMargin: searchBar.height + (jaspTheme.generalAnchorMargin * 2)
zoomFactor: preferencesModel.uiScale
backgroundColor: jaspTheme.uiBackground
onLoadingChanged: (loadRequest)=>
{
if(loadRequest.status === WebEngineView.LoadSucceededStatus)
helpModel.loadingSucceeded()
searchBar.search();
}

onNavigationRequested: (request)=>
{
if(request.navigationType === WebEngineNavigationRequest.LinkClickedNavigation)
{
Qt.openUrlExternally(request.url);
request.reject();
}
}

Connections
{
target: helpModel
function onRunJavaScriptSignal(helpJS)
{
helpView.runJavaScript(helpJS);
searchBar.search();
}
}
}

Row
{
CheckBox
{
id: trackAnalyses
label: qsTr("Follow")
checked: preferencesModel.helpFollowsAnalyses
onCheckedChanged: preferencesModel.helpFollowsAnalyses = checked
}

TextField
{
id: searchBar
label: qsTr("Search for:")
value: ""
onValueChanged: search()
Keys.onEscapePressed: value = ""
fieldWidth: parent.width - (controlLabel.width + control.anchors.leftMargin + jaspTheme.generalAnchorMargin * 2)

function startSearching()
{
forceActiveFocus();
control.selectAll()
}

function search()
{
helpView.findText(value)
}
}


anchors
{
left: parent.left
right: parent.right
bottom: parent.bottom
margins: jaspTheme.generalAnchorMargin
}

}
}
98 changes: 0 additions & 98 deletions Desktop/components/JASP/Widgets/HelpWindow.qml

This file was deleted.

24 changes: 7 additions & 17 deletions Desktop/components/JASP/Widgets/JASPSplitHandle.qml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Rectangle
id: handleRoot

signal arrowClicked
signal handleDragging(bool active, var mouseArea)

property bool pointingLeft: true
property bool showArrow: true
property bool dragEnabled: true
Expand All @@ -18,25 +18,15 @@ Rectangle
property string toolTipDrag: ""
property string toolTipArrow: ""
property bool hovered: hoverMouse.containsMouse
property alias dragging: hoverMouse.drag.active
property alias dragX: hoverMouse.x


width: jaspTheme.splitHandleWidth
anchors
{
top: parent.top
bottom: parent.bottom
topMargin: -1
bottomMargin: -1
leftMargin: removeLeftBorder ? -1 : 0
}
implicitWidth: jaspTheme.splitHandleWidth
width: implicitWidth

color: handleRoot.dragEnabled && handleRoot.hovered ? jaspTheme.grayLighter : jaspTheme.uiBackground
border.color: jaspTheme.uiBorder
border.width: 1

Drag.active: hoverMouse.drag.active


ToolTip
{
Expand Down Expand Up @@ -65,9 +55,9 @@ Rectangle
cursorShape: handleRoot.dragEnabled ? Qt.SplitHCursor : Qt.ArrowCursor //Take into account resizing? styleData.resizing
//onPositionChanged: (mouse)=>{ mouse.accepted = true; }

drag.target: parent
drag.axis: Drag.XAxis
drag.onActiveChanged: handleDragging(drag.active, hoverMouse)
//drag.target: parent
//drag.axis: Drag.XAxis
//drag.onActiveChanged: handleDragging(drag.active, hoverMouse)
}

Item
Expand Down
Loading
Loading