[ui] Viewer2D: display image source path

* display selectable-by-mouse source filepath
* add radius property to FloatingPane to control border radius from outside
* use FloatingPane in ImageMetadataView
This commit is contained in:
Yann Lanthony 2018-04-16 12:14:04 +02:00
parent b81cf89ffe
commit cfaa0bc012
3 changed files with 27 additions and 13 deletions

View file

@ -10,8 +10,9 @@ Pane {
id: root
property bool opaque: false
property int radius: 1
padding: 6
anchors.margins: 2
background: Rectangle { color: root.palette.base; opacity: opaque ? 1.0 : 0.7; radius: 1 }
background: Rectangle { color: root.palette.base; opacity: opaque ? 1.0 : 0.7; radius: root.radius }
}

View file

@ -11,7 +11,7 @@ import Utils 1.0
/**
* ImageMetadataView displays a JSON model representing an image"s metadata as a ListView.
*/
Pane {
FloatingPane {
id: root
property alias metadata: metadataModel.metadata
@ -22,8 +22,6 @@ Pane {
SystemPalette { id: palette }
background: Rectangle { color: palette.window; opacity: 0.9 }
/**
* Convert GPS metadata to degree coordinates.
*

View file

@ -2,7 +2,8 @@ import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
import MaterialIcons 2.2
import Utils 1.0
import Controls 1.0
FocusScope {
id: root
@ -115,14 +116,30 @@ FocusScope {
}
}
FloatingPane {
id: topToolbar
width: parent.width
radius: 0
padding: 4
// selectable filepath to source image
TextField {
width: parent.width
padding: 0
background: Item {}
font.pointSize: 8
readOnly: true
selectByMouse: true
text: Filepath.urlToString(source)
}
}
// Image Metadata overlay Pane
ImageMetadataView {
width: 350
anchors {
top: parent.top
top: topToolbar.bottom
right: parent.right
bottom: bottomToolbar.top
margins: 2
}
visible: metadataCB.checked
@ -130,15 +147,13 @@ FocusScope {
metadata: visible ? root.metadata : {}
}
Pane {
FloatingPane {
id: bottomToolbar
anchors.bottom: parent.bottom
anchors.margins: 0
width: parent.width
padding: 2
leftPadding: 4
rightPadding: leftPadding
background: Rectangle { color: palette.base; opacity: 0.6 }
topPadding: 2
bottomPadding: topPadding
RowLayout {
anchors.fill: parent