diff --git a/linux/install_local.sh b/linux/install_local.sh index 4f6b58c..a6855df 100644 --- a/linux/install_local.sh +++ b/linux/install_local.sh @@ -1,8 +1,11 @@ #!/bin/bash APPROOT="$(cd -P "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +echo "Adding desktop file..." mkdir -p ~/.local/share/applications -sed "s+/home/ad5001/Apps/LogarithmPlotter/+$APPROOT+g" "$APPROOT/linux/logplotter.desktop" > ~/.local/share/applications/logplotter.desktop -sed "s+/home/ad5001/Apps/LogarithmPlotter/+$APPROOT+g" "$APPROOT/linux/x-logarithm-plotter.xml" > ~/.local/share/mime/x-logarithm-plotter.xml +sed "s+/home/ad5001/Apps/LogarithmPlotter/+$APPROOT/+g" "$APPROOT/linux/logplotter.desktop" > ~/.local/share/applications/logplotter.desktop +echo "Installing mime-type..." +mkdir -p ~/.local/share/applications +sed "s+/home/ad5001/Apps/LogarithmPlotter/+$APPROOT/+g" "$APPROOT/linux/x-logarithm-plotter.xml" > ~/.local/share/mime/packages/x-logarithm-plotter.xml mkdir -p ~/.local/share/icons/hicolor/scalable/mimetypes cp "$APPROOT/linux/logplotterfile.svg" ~/.local/share/icons/hicolor/scalable/mimetypes/application-x-logarithm-plotter.svg update-mime-database ~/.local/share/mime/ diff --git a/linux/logplotterfile.svg b/linux/logplotterfile.svg index ff8353f..690a823 100644 --- a/linux/logplotterfile.svg +++ b/linux/logplotterfile.svg @@ -14,18 +14,18 @@ version="1.1" id="SVGRoot" sodipodi:docname="logplotterfile.svg" - inkscape:version="1.0.2 (e86c870879, 2021-01-15)"> + inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"> @@ -73,7 +73,12 @@ inkscape:document-units="px" inkscape:current-layer="layer1" inkscape:document-rotation="0" - showgrid="true"> + showgrid="true" + inkscape:window-width="1920" + inkscape:window-height="1011" + inkscape:window-x="1920" + inkscape:window-y="0" + inkscape:window-maximized="1"> diff --git a/linux/x-logarithm-plotter.xml b/linux/x-logarithm-plotter.xml index d235081..1c91bc9 100644 --- a/linux/x-logarithm-plotter.xml +++ b/linux/x-logarithm-plotter.xml @@ -1,10 +1,11 @@ - - - Logarithm Plot/Graph - - - - - - + + + Logarithm Plot/Graph + + + + + + + diff --git a/qml/LogGraph.qml b/qml/LogGraph.qml index 2dff24f..ab70ebb 100644 --- a/qml/LogGraph.qml +++ b/qml/LogGraph.qml @@ -68,12 +68,13 @@ ApplicationWindow { } StackLayout { + id: sidebarContents anchors.top: sidebarSelector.bottom anchors.left: parent.left anchors.topMargin: 5 anchors.leftMargin: 5 width: parent.width - 10 - height: parent.height - sidebarSelector.height + height: parent.height - sidebarContents.x; currentIndex: sidebarSelector.currentIndex z: -1 clip: true diff --git a/qml/Settings.qml b/qml/Settings.qml index c73caa5..4a540b1 100644 --- a/qml/Settings.qml +++ b/qml/Settings.qml @@ -20,11 +20,8 @@ import QtQuick.Controls 2.12 import QtQuick 2.12 import "js/utils.js" as Utils -Column { +ScrollView { id: settings - height: 30*9 //30*Math.max(1, Math.ceil(7 / columns)) - //columns: Math.floor(width / settingWidth) - spacing: 10 signal changed() @@ -43,220 +40,225 @@ Column { property bool showxgrad: true property bool showygrad: true - FileDialog { - id: fdiag - onAccepted: { - var filePath = fileUrl.toString().substr(7) - settings.saveFilename = filePath - if(exportMode) { - root.saveDiagram(filePath) - } else { - root.loadDiagram(filePath) - if(xAxisLabel.find(settings.xaxislabel) == -1) xAxisLabel.model.append({text: settings.xaxislabel}) - xAxisLabel.editText = settings.xaxislabel - if(yAxisLabel.find(settings.yaxislabel) == -1) yAxisLabel.model.append({text: settings.yaxislabel}) - yAxisLabel.editText = settings.yaxislabel + Column { + height: 30*9 //30*Math.max(1, Math.ceil(7 / columns)) + //columns: Math.floor(width / settingWidth) + spacing: 10 + FileDialog { + id: fdiag + onAccepted: { + var filePath = fileUrl.toString().substr(7) + settings.saveFilename = filePath + if(exportMode) { + root.saveDiagram(filePath) + } else { + root.loadDiagram(filePath) + if(xAxisLabel.find(settings.xaxislabel) == -1) xAxisLabel.model.append({text: settings.xaxislabel}) + xAxisLabel.editText = settings.xaxislabel + if(yAxisLabel.find(settings.yaxislabel) == -1) yAxisLabel.model.append({text: settings.yaxislabel}) + yAxisLabel.editText = settings.yaxislabel + } } } - } - - // Line 1 - // Zoom - TextSetting { - id: zoomX - height: 30 - isInt: true - label: "X Zoom" - min: 1 - width: settings.settingWidth - defValue: settings.xzoom - onChanged: function(newValue) { - settings.xzoom = newValue - settings.changed() + + // Line 1 + // Zoom + TextSetting { + id: zoomX + height: 30 + isInt: true + label: "X Zoom" + min: 1 + width: settings.settingWidth + defValue: settings.xzoom + onChanged: function(newValue) { + settings.xzoom = newValue + settings.changed() + } } - } - TextSetting { - id: zoomY - height: 30 - isInt: true - label: "Y Zoom" - width: settings.settingWidth - defValue: settings.yzoom - onChanged: function(newValue) { - settings.yzoom = newValue - settings.changed() + TextSetting { + id: zoomY + height: 30 + isInt: true + label: "Y Zoom" + width: settings.settingWidth + defValue: settings.yzoom + onChanged: function(newValue) { + settings.yzoom = newValue + settings.changed() + } } - } - // Positioning the graph - TextSetting { - id: minX - height: 30 - isDouble: true - min: -Infinity - label: "Min X" - width: settings.settingWidth - defValue: settings.xmin - onChanged: function(newValue) { - settings.xmin = newValue - settings.changed() + // Positioning the graph + TextSetting { + id: minX + height: 30 + isDouble: true + min: -Infinity + label: "Min X" + width: settings.settingWidth + defValue: settings.xmin + onChanged: function(newValue) { + settings.xmin = newValue + settings.changed() + } } - } - TextSetting { - id: maxY - height: 30 - isDouble: true - label: "Max Y" - width: settings.settingWidth - defValue: settings.ymax - onChanged: function(newValue) { - settings.ymax = newValue - settings.changed() + TextSetting { + id: maxY + height: 30 + isDouble: true + label: "Max Y" + width: settings.settingWidth + defValue: settings.ymax + onChanged: function(newValue) { + settings.ymax = newValue + settings.changed() + } } - } - TextSetting { - id: yAxisStep - height: 30 - label: "Y Axis Step" - width: settings.settingWidth - defValue: settings.yaxisstep - onChanged: function(newValue) { - settings.yaxisstep = newValue - settings.changed() + TextSetting { + id: yAxisStep + height: 30 + label: "Y Axis Step" + width: settings.settingWidth + defValue: settings.yaxisstep + onChanged: function(newValue) { + settings.yaxisstep = newValue + settings.changed() + } } - } - - TextSetting { - id: xAxisStep - height: 30 - label: "X Axis Step" - width: settings.settingWidth - defValue: settings.xaxisstep - visible: !settings.logscalex - onChanged: function(newValue) { - settings.xaxisstep = newValue - settings.changed() + + TextSetting { + id: xAxisStep + height: 30 + label: "X Axis Step" + width: settings.settingWidth + defValue: settings.xaxisstep + visible: !settings.logscalex + onChanged: function(newValue) { + settings.xaxisstep = newValue + settings.changed() + } } - } - - ComboBoxSetting { - id: xAxisLabel - height: 30 - width: settings.settingWidth - label: 'X Label' - model: ListModel { - ListElement { text: "" } - ListElement { text: "x" } - ListElement { text: "ω (rad/s)" } + + ComboBoxSetting { + id: xAxisLabel + height: 30 + width: settings.settingWidth + label: 'X Label' + model: ListModel { + ListElement { text: "" } + ListElement { text: "x" } + ListElement { text: "ω (rad/s)" } + } + currentIndex: find(settings.xaxislabel) + editable: true + onAccepted: function(){ + editText = Utils.parseName(editText, false) + if (find(editText) === -1) model.append({text: editText}) + settings.xaxislabel = editText + settings.changed() + } + onActivated: function(selectedId) { + settings.xaxislabel = model.get(selectedId).text + settings.changed() + } + Component.onCompleted: editText = settings.xaxislabel } - currentIndex: find(settings.xaxislabel) - editable: true - onAccepted: function(){ - editText = Utils.parseName(editText, false) - if (find(editText) === -1) model.append({text: editText}) - settings.xaxislabel = editText - settings.changed() + + ComboBoxSetting { + id: yAxisLabel + height: 30 + width: settings.settingWidth + label: 'Y Label' + model: ListModel { + ListElement { text: "" } + ListElement { text: "y" } + ListElement { text: "G (dB)" } + ListElement { text: "φ (°)" } + ListElement { text: "φ (deg)" } + ListElement { text: "φ (rad)" } + } + currentIndex: find(settings.yaxislabel) + editable: true + onAccepted: function(){ + editText = Utils.parseName(editText, false) + if (find(editText) === -1) model.append({text: editText, yaxisstep: root.yaxisstep}) + settings.yaxislabel = editText + settings.changed() + } + onActivated: function(selectedId) { + settings.yaxislabel = model.get(selectedId).text + settings.changed() + } + Component.onCompleted: editText = settings.yaxislabel } - onActivated: function(selectedId) { - settings.xaxislabel = model.get(selectedId).text - settings.changed() + + CheckBox { + id: logScaleX + checked: settings.logscalex + text: 'X Log scale' + onClicked: { + settings.logscalex = checked + settings.changed() + } } - Component.onCompleted: editText = settings.xaxislabel - } - - ComboBoxSetting { - id: yAxisLabel - height: 30 - width: settings.settingWidth - label: 'Y Label' - model: ListModel { - ListElement { text: "" } - ListElement { text: "y" } - ListElement { text: "G (dB)" } - ListElement { text: "φ (°)" } - ListElement { text: "φ (deg)" } - ListElement { text: "φ (rad)" } + + CheckBox { + id: showXGrad + checked: settings.showxgrad + text: 'Show X graduation' + onClicked: { + settings.showxgrad = checked + settings.changed() + } } - currentIndex: find(settings.yaxislabel) - editable: true - onAccepted: function(){ - editText = Utils.parseName(editText, false) - if (find(editText) === -1) model.append({text: editText, yaxisstep: root.yaxisstep}) - settings.yaxislabel = editText - settings.changed() + + CheckBox { + id: showYGrad + checked: settings.showygrad + text: 'Show Y graduation' + onClicked: { + settings.showygrad = checked + settings.changed() + } } - onActivated: function(selectedId) { - settings.yaxislabel = model.get(selectedId).text - settings.changed() + + Button { + id: copyToClipboard + height: 30 + width: settings.settingWidth + text: "Copy to clipboard" + icon.name: 'editcopy' + onClicked: root.copyDiagramToClipboard() } - Component.onCompleted: editText = settings.yaxislabel - } - - CheckBox { - id: logScaleX - checked: settings.logscalex - text: 'X Log scale' - onClicked: { - settings.logscalex = checked - settings.changed() + + Button { + id: saveDiagram + height: 30 + width: settings.settingWidth + text: "Save diagram" + icon.name: 'filesave' + onClicked: save() } - } - - CheckBox { - id: showXGrad - checked: settings.showxgrad - text: 'Show X graduation' - onClicked: { - settings.showxgrad = checked - settings.changed() + + Button { + id: saveDiagramAs + height: 30 + width: settings.settingWidth + text: "Save diagram as" + icon.name: 'filesaveas' + onClicked: saveAs() } - } - - CheckBox { - id: showYGrad - checked: settings.showygrad - text: 'Show Y graduation' - onClicked: { - settings.showygrad = checked - settings.changed() + + Button { + id: loadDiagram + height: 30 + width: settings.settingWidth + text: "Load diagram" + icon.name: 'fileopen' + onClicked: load() } } - Button { - id: copyToClipboard - height: 30 - width: settings.settingWidth - text: "Copy to clipboard" - icon.name: 'editcopy' - onClicked: root.copyDiagramToClipboard() - } - - Button { - id: saveDiagram - height: 30 - width: settings.settingWidth - text: "Save diagram" - icon.name: 'filesave' - onClicked: save() - } - - Button { - id: saveDiagramAs - height: 30 - width: settings.settingWidth - text: "Save diagram as" - icon.name: 'filesaveas' - onClicked: saveAs() - } - - Button { - id: loadDiagram - height: 30 - width: settings.settingWidth - text: "Load diagram" - icon.name: 'fileopen' - onClicked: load() - } - function save() { if(settings.saveFilename == "") { fdiag.exportMode = true