Compare commits
No commits in common. "3f107f1ba4f68b5bc418f7aa1786f29b0f5e4699" and "e23a8755e9afb1c6b2400ab4e0d3bec48c9a95b5" have entirely different histories.
3f107f1ba4
...
e23a8755e9
4 changed files with 94 additions and 133 deletions
|
@ -18,7 +18,6 @@
|
|||
|
||||
import QtQuick.Controls 2.12
|
||||
import QtQuick 2.12
|
||||
import eu.ad5001.LogarithmPlotter.Setting 1.0 as Setting
|
||||
import "../js/utils.js" as Utils
|
||||
|
||||
|
||||
|
@ -33,9 +32,11 @@ import "../js/utils.js" as Utils
|
|||
|
||||
\sa LogarithmPlotter, Settings, ObjectLists
|
||||
*/
|
||||
Item {
|
||||
ScrollView {
|
||||
id: historyBrowser
|
||||
|
||||
ScrollBar.horizontal.visible: false
|
||||
|
||||
/*!
|
||||
\qmlproperty int HistoryBrowser::actionWidth
|
||||
Width of the actions.
|
||||
|
@ -48,108 +49,89 @@ Item {
|
|||
*/
|
||||
property bool darkTheme: isDarkTheme()
|
||||
|
||||
Setting.TextSetting {
|
||||
id: filterInput
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
placeholderText: "Filter..."
|
||||
}
|
||||
|
||||
ScrollView {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.top: filterInput.bottom
|
||||
|
||||
ScrollBar.horizontal.visible: false
|
||||
Flickable {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
contentHeight: redoColumn.height + nowRect.height + undoColumn.height
|
||||
contentWidth: parent.width
|
||||
|
||||
Flickable {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
contentHeight: redoColumn.height + nowRect.height + undoColumn.height
|
||||
contentWidth: parent.width
|
||||
Column {
|
||||
id: redoColumn
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
width: actionWidth
|
||||
|
||||
Column {
|
||||
id: redoColumn
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
width: actionWidth
|
||||
|
||||
Repeater {
|
||||
model: history.redoCount
|
||||
|
||||
HistoryItem {
|
||||
id: redoButton
|
||||
width: actionWidth
|
||||
//height: actionHeight
|
||||
isRedo: true
|
||||
idx: index
|
||||
darkTheme: historyBrowser.darkTheme
|
||||
hidden: !(filterInput.value == "" || content.includes(filterInput.value))
|
||||
}
|
||||
Repeater {
|
||||
model: history.redoCount
|
||||
|
||||
HistoryItem {
|
||||
id: redoButton
|
||||
width: actionWidth
|
||||
//height: actionHeight
|
||||
isRedo: true
|
||||
idx: index
|
||||
darkTheme: historyBrowser.darkTheme
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.left: parent.left
|
||||
anchors.bottom: nowRect.top
|
||||
text: qsTr("Redo >")
|
||||
color: sysPaletteIn.windowText
|
||||
transform: Rotation { origin.x: 30; origin.y: 30; angle: 270}
|
||||
height: 70
|
||||
width: 20
|
||||
visible: history.redoCount > 0
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: nowRect
|
||||
anchors.right: parent.right
|
||||
anchors.top: redoColumn.bottom
|
||||
width: actionWidth
|
||||
height: 40
|
||||
color: sysPalette.highlight
|
||||
Text {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: parent.left
|
||||
anchors.bottom: nowRect.top
|
||||
text: qsTr("Redo >")
|
||||
color: sysPaletteIn.windowText
|
||||
transform: Rotation { origin.x: 30; origin.y: 30; angle: 270}
|
||||
height: 70
|
||||
width: 20
|
||||
visible: history.redoCount > 0
|
||||
anchors.leftMargin: 5
|
||||
text: qsTr("> Now")
|
||||
color: sysPalette.windowText
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
id: undoColumn
|
||||
anchors.right: parent.right
|
||||
anchors.top: nowRect.bottom
|
||||
width: actionWidth
|
||||
|
||||
Rectangle {
|
||||
id: nowRect
|
||||
anchors.right: parent.right
|
||||
anchors.top: redoColumn.bottom
|
||||
width: actionWidth
|
||||
height: 40
|
||||
color: sysPalette.highlight
|
||||
Text {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 5
|
||||
text: qsTr("> Now")
|
||||
color: sysPalette.windowText
|
||||
Repeater {
|
||||
model: history.undoCount
|
||||
|
||||
|
||||
HistoryItem {
|
||||
id: undoButton
|
||||
width: actionWidth
|
||||
//height: actionHeight
|
||||
isRedo: false
|
||||
idx: index
|
||||
darkTheme: historyBrowser.darkTheme
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
id: undoColumn
|
||||
anchors.right: parent.right
|
||||
anchors.top: nowRect.bottom
|
||||
width: actionWidth
|
||||
|
||||
Repeater {
|
||||
model: history.undoCount
|
||||
|
||||
|
||||
HistoryItem {
|
||||
id: undoButton
|
||||
width: actionWidth
|
||||
//height: actionHeight
|
||||
isRedo: false
|
||||
idx: index
|
||||
darkTheme: historyBrowser.darkTheme
|
||||
hidden: !(filterInput.value == "" || content.includes(filterInput.value))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.left: parent.left
|
||||
anchors.top: undoColumn.top
|
||||
text: qsTr("< Undo")
|
||||
color: sysPaletteIn.windowText
|
||||
transform: Rotation { origin.x: 30; origin.y: 30; angle: 270}
|
||||
height: 60
|
||||
width: 20
|
||||
visible: history.undoCount > 0
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.left: parent.left
|
||||
anchors.top: undoColumn.top
|
||||
text: qsTr("< Undo")
|
||||
color: sysPaletteIn.windowText
|
||||
transform: Rotation { origin.x: 30; origin.y: 30; angle: 270}
|
||||
height: 60
|
||||
width: 20
|
||||
visible: history.undoCount > 0
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -49,15 +49,10 @@ Button {
|
|||
*/
|
||||
property int idx
|
||||
/*!
|
||||
\qmlproperty bool HistoryItem::darkTheme
|
||||
\qmlproperty int HistoryItem::idx
|
||||
true when the system is running with a dark theme, false otherwise.
|
||||
*/
|
||||
property bool darkTheme
|
||||
/*!
|
||||
\qmlproperty bool HistoryItem::hidden
|
||||
true when the item is filtered out, false otherwise.
|
||||
*/
|
||||
property bool hidden: false
|
||||
/*!
|
||||
\qmlproperty int HistoryItem::historyAction
|
||||
Associated history action.
|
||||
|
@ -74,18 +69,12 @@ Button {
|
|||
Color of the history action.
|
||||
*/
|
||||
readonly property color clr: historyAction.color(darkTheme)
|
||||
/*!
|
||||
\qmlproperty string HistoryItem::clr
|
||||
Label description of the history item.
|
||||
*/
|
||||
readonly property string content: historyAction.getReadableString()
|
||||
|
||||
height: hidden ? 8 : Math.max(actionHeight, label.height + 15)
|
||||
height: Math.max(actionHeight, label.height + 15)
|
||||
|
||||
|
||||
LinearGradient {
|
||||
anchors.fill: parent
|
||||
visible: !hidden
|
||||
start: Qt.point(0, 0)
|
||||
end: Qt.point(parent.width, 0)
|
||||
gradient: Gradient {
|
||||
|
@ -96,12 +85,11 @@ Button {
|
|||
|
||||
Setting.Icon {
|
||||
id: icon
|
||||
width: 18
|
||||
height: 18
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 6
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: !hidden
|
||||
width: 18
|
||||
height: 18
|
||||
|
||||
color: sysPalette.windowText
|
||||
source: `../icons/history/${historyAction.icon()}.svg`
|
||||
|
@ -114,7 +102,6 @@ Button {
|
|||
anchors.leftMargin: 6
|
||||
anchors.rightMargin: 20
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: !hidden
|
||||
font.pixelSize: 14
|
||||
text: historyAction.getHTMLString().replace(/\$\{tag_color\}/g, clr)
|
||||
textFormat: Text.RichText
|
||||
|
@ -122,21 +109,11 @@ Button {
|
|||
wrapMode: Text.WordWrap
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: hiddenDot
|
||||
anchors.centerIn: parent
|
||||
visible: hidden
|
||||
width: 5
|
||||
height: 5
|
||||
radius: 5
|
||||
color: sysPalette.windowText
|
||||
}
|
||||
|
||||
//text: content
|
||||
//text: historyAction.getReadableString()
|
||||
|
||||
ToolTip.visible: hovered
|
||||
ToolTip.delay: 200
|
||||
ToolTip.text: content
|
||||
ToolTip.text: historyAction.getReadableString()
|
||||
|
||||
onClicked: {
|
||||
if(isRedo)
|
||||
|
@ -144,6 +121,14 @@ Button {
|
|||
else
|
||||
history.undoMultipleDefered(+idx+1)
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
color: sysPalette. window
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
height: 1
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ ListView {
|
|||
Label {
|
||||
id: typeHeaderText
|
||||
verticalAlignment: TextInput.AlignVCenter
|
||||
text: qsTranslate("control", "%1: ").arg(Objects.types[objType].displayTypeMultiple())
|
||||
text: Objects.types[objType].displayTypeMultiple() + ":"
|
||||
font.pixelSize: 20
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,11 +63,6 @@ Item {
|
|||
Value of the input.
|
||||
*/
|
||||
property alias value: input.text
|
||||
/*!
|
||||
\qmlproperty string TextSetting::placeholderText
|
||||
Value of the input.
|
||||
*/
|
||||
property alias placeholderText: input.placeholderText
|
||||
/*!
|
||||
\qmlproperty string TextSetting::label
|
||||
Label of the setting.
|
||||
|
@ -97,8 +92,7 @@ Item {
|
|||
anchors.top: parent.top
|
||||
verticalAlignment: TextInput.AlignVCenter
|
||||
//color: sysPalette.windowText
|
||||
text: visible ? qsTranslate("control", "%1: ").arg(control.label) : ""
|
||||
visible: control.label != ""
|
||||
text: qsTranslate("control", "%1: ").arg(control.label)
|
||||
}
|
||||
|
||||
|
||||
|
@ -107,10 +101,10 @@ Item {
|
|||
anchors.top: parent.top
|
||||
anchors.left: labelItem.right
|
||||
anchors.leftMargin: 5
|
||||
width: control.width - (labelItem.visible ? labelItem.width + 5 : 0) - iconLabel.width - 5
|
||||
width: control.width - labelItem.width - iconLabel.width - 10
|
||||
height: parent.height
|
||||
verticalAlignment: TextInput.AlignVCenter
|
||||
horizontalAlignment: control.label == "" ? TextInput.AlignLeft : TextInput.AlignHCenter
|
||||
horizontalAlignment: TextInput.AlignHCenter
|
||||
color: sysPalette.windowText
|
||||
focus: true
|
||||
text: control.defValue
|
||||
|
|
Loading…
Reference in a new issue