Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit eb057874 authored by camilo higuita's avatar camilo higuita

Work on the editor layout and ui papercuts on info and settings dialog

parent 3ebb0074
......@@ -113,7 +113,7 @@ Q_DECL_EXPORT int main(int argc, char *argv[])
app.setWindowIcon(QIcon(":/img/assets/pix.png"));
MauiApp::instance()->setHandleAccounts(false); //for now index can not handle cloud accounts
MauiApp::instance()->setCredits ({QVariantMap({{"name", "Camilo Higuita"}, {"email", "milo.h@aol.com"}, {"year", "2019-2020"}})});
MauiApp::instance()->setDescription("Pix is a convergent gallery manager and image viewer. Supports GNU Linux, Android and Windows.");
MauiApp::instance()->setDescription("Pix organizes and manages your images gallery collection");
MauiApp::instance()->setIconName("qrc:/assets/pix.svg");
MauiApp::instance()->setHandleAccounts(false);
MauiApp::instance()->setWebPage("https://mauikit.org");
......
......@@ -106,7 +106,7 @@ Maui.ApplicationWindow
headBar.visible: !fullScreen
floatingHeader: swipeView.currentIndex === views.viewer && !pixViewer.editing
floatingHeader: swipeView.currentIndex === views.viewer ? !pixViewer.editing : false
autoHideHeader: swipeView.currentIndex === views.viewer
headerPositioning: ListView.InlineHeader
......
......@@ -17,17 +17,23 @@ PicInfoModel::~PicInfoModel()
static FMH::MODEL_LIST basicInfo(const QUrl &url)
{
FMH::MODEL_LIST res;
const FMH::MODEL model = FMH::getFileInfoModel(url);
for(const auto key : model.keys())
{
FMH::MODEL m_model;
auto value = FMH::MODEL_NAME[key];
m_model.insert(FMH::MODEL_KEY::KEY, value.replace(0, 1, value[0].toUpper()));
m_model.insert(FMH::MODEL_KEY::VALUE, model[key]);
res << m_model;
}
QFileInfo file(url.toLocalFile());
res << FMH::MODEL {{FMH::MODEL_KEY::KEY, "Name"}, {FMH::MODEL_KEY::VALUE, file.fileName()}, {FMH::MODEL_KEY::ICON, "edit-rename"}};
res << FMH::MODEL {{FMH::MODEL_KEY::KEY, "Path"}, {FMH::MODEL_KEY::VALUE, url.toLocalFile()}, {FMH::MODEL_KEY::ICON, "folder"}};
res << FMH::MODEL {{FMH::MODEL_KEY::KEY, "Last Modified"}, {FMH::MODEL_KEY::VALUE, file.lastModified().toString()}, {FMH::MODEL_KEY::ICON, "view-media-recent"}};
res << FMH::MODEL {{FMH::MODEL_KEY::KEY, "Date"}, {FMH::MODEL_KEY::VALUE, file.birthTime().toString()}, {FMH::MODEL_KEY::ICON, "view-calendar-birthday"}};
res << FMH::MODEL {{FMH::MODEL_KEY::KEY, "Type"}, {FMH::MODEL_KEY::VALUE, FMH::getMime(url)}, {FMH::MODEL_KEY::ICON, "documentinfo"}};
res << FMH::MODEL {{FMH::MODEL_KEY::KEY, "Location"}, {FMH::MODEL_KEY::VALUE, "Blah"}, {FMH::MODEL_KEY::ICON, "gps"}};
res << FMH::MODEL {{FMH::MODEL_KEY::KEY, "Aperture"}, {FMH::MODEL_KEY::VALUE, "Blah"}, {FMH::MODEL_KEY::ICON, "documentinfo"}};
res << FMH::MODEL {{FMH::MODEL_KEY::KEY, "Camera"}, {FMH::MODEL_KEY::VALUE, "Blah"}, {FMH::MODEL_KEY::ICON, "camera-video"}};
res << FMH::MODEL {{FMH::MODEL_KEY::KEY, "Camera Model"}, {FMH::MODEL_KEY::VALUE, "Blah"}, {FMH::MODEL_KEY::ICON, "documentinfo"}};
res << FMH::MODEL {{FMH::MODEL_KEY::KEY, "Focal Length"}, {FMH::MODEL_KEY::VALUE, "Blah"}, {FMH::MODEL_KEY::ICON, "documentinfo"}};
res << FMH::MODEL {{FMH::MODEL_KEY::KEY, "ISO"}, {FMH::MODEL_KEY::VALUE, "Blah"}, {FMH::MODEL_KEY::ICON, "documentinfo"}};
res << FMH::MODEL {{FMH::MODEL_KEY::KEY, "Aperture"}, {FMH::MODEL_KEY::VALUE, "Blah"}, {FMH::MODEL_KEY::ICON, "documentinfo"}};
res << FMH::MODEL {{FMH::MODEL_KEY::KEY, "Notes"}, {FMH::MODEL_KEY::VALUE, "Blah"}, {FMH::MODEL_KEY::ICON, "note"}};
res << FMH::MODEL {{FMH::MODEL_KEY::KEY, "Author"}, {FMH::MODEL_KEY::VALUE, "Blah"}, {FMH::MODEL_KEY::ICON, "user"}};
res << FMH::MODEL {{FMH::MODEL_KEY::KEY, "Other"}, {FMH::MODEL_KEY::VALUE, "Blah"}, {FMH::MODEL_KEY::ICON, "documentinfo"}};
return res;
}
......
import QtQuick 2.13
import org.kde.mauikit 1.0 as Maui
import org.kde.kirigami 2.8 as Kirigami
import QtQuick.Layouts 1.12
import QtQuick.Controls 2.12
import org.maui.pix 1.0 as Pix
import QtQuick.Shapes 1.12
import org.kde.mauikit 1.2 as Maui
import org.kde.kirigami 2.8 as Kirigami
import org.maui.pix 1.0 as Pix
Maui.Dialog
{
id: control
......@@ -68,14 +70,22 @@ Maui.Dialog
color: "white"
}
}
}
}
}
Kirigami.Separator
Maui.TagsBar
{
Layout.fillWidth: true
position: ToolBar.Footer
allowEditMode: false
list.urls: [control.url]
list.strict: false
}
Kirigami.Separator
{
Layout.fillWidth: true
}
ListView
{
Layout.preferredHeight: contentHeight
......@@ -90,28 +100,22 @@ Maui.Dialog
}
}
delegate: Rectangle
delegate: Maui.AlternateListItem
{
visible: model.value.length
width: visible ? parent.width : 0
height: visible ? _delegateColumnInfo.implicitHeight + Maui.Style.space.large : 0
color: index % 2 === 0 ? Kirigami.Theme.backgroundColor : Qt.darker(Kirigami.Theme.backgroundColor, 1.1)
Kirigami.Separator
{
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
}
alt: index % 2 === 0
Maui.ListItemTemplate
{
id: _delegateColumnInfo
width: parent.width
iconSource: "documentinfo"
iconSource: model.icon
iconSizeHint: Maui.Style.iconSizes.medium
spacing: Maui.Style.space.medium
anchors.centerIn: parent
anchors.margins: Maui.Style.space.medium
......@@ -119,8 +123,6 @@ Maui.Dialog
label1.font.weight: Font.Bold
label1.font.bold: true
label2.text: model.value
label2.elide: Qt.ElideMiddle
label2.wrapMode: Text.Wrap
label2.font.weight: Font.Light
}
}
......
......@@ -5,14 +5,227 @@ import QtQuick.Layouts 1.3
import org.kde.kirigami 2.6 as Kirigami
import org.kde.mauikit 1.0 as Maui
import org.kde.mauikit 1.1 as MauiLab
import org.kde.kquickimageeditor 1.0 as KQuickImageEditor
Maui.Page
{
id: control
property url url
property bool resizing : false
title: i18n("Edit")
leftPadding: 0
rightPadding: 0
headBar.farLeftContent: ToolButton
{
icon.name: "go-previous"
onClicked: control.parent.pop()
}
headBar.rightContent: Maui.ToolActions
{
autoExclusive: false
checkable: false
expanded: true
Action
{
text: qsTr("Save")
icon.name: "document-save"
}
Action
{
icon.name: "document-save-as"
text: qsTr("Save as...")
}
}
footBar.leftContent: Maui.ToolActions
{
expanded: true
autoExclusive: true
checkable: false
Action
{
icon.name: "edit-undo"
onTriggered: imageDoc.undo();
enabled: imageDoc.edited
}
Action
{
icon.name: "edit-redo"
}
}
// Kirigami.Action {
// iconName: rootEditorView.resizing ? "dialog-cancel" : "transform-crop"
// text: rootEditorView.resizing ? i18n("Cancel") : i18nc("@action:button Crop an image", "Crop");
// onTriggered: rootEditorView.resizing = !rootEditorView.resizing;
// },
// Kirigami.Action {
// iconName: "dialog-ok"
// visible: rootEditorView.resizing
// text: i18nc("@action:button Rotate an image to the right", "Crop");
// onTriggered: rootEditorView.crop();
// },
footBar.rightContent: [
ToolButton
{
icon.name: "draw-freehand"
onClicked:
{
_doodleDialog.sourceItem = editImage
_doodleDialog.open()
}
}
]
footBar.middleContent: [
Maui.ToolActions
{
expanded: true
autoExclusive: false
checkable: false
display: ToolButton.TextBesideIcon
Action
{
icon.name: "object-rotate-left"
text: i18nc("@action:button Rotate an image to the left", "Rotate left");
onTriggered: imageDoc.rotate(-90);
enabled: !control.resizing
}
Action
{
icon.name: "object-rotate-right"
text: i18nc("@action:button Rotate an image to the right", "Rotate right");
onTriggered: imageDoc.rotate(90);
enabled: !control.resizing
}
},
Maui.ToolActions
{
expanded: true
autoExclusive: false
checkable: false
display: ToolButton.TextBesideIcon
Action
{
icon.name: "object-flip-vertical"
text: i18nc("@action:button Mirror an image vertically", "Flip");
onTriggered: imageDoc.mirror(false, true);
enabled: !control.resizing
}
Action
{
icon.name: "object-flip-horizontal"
text: i18nc("@action:button Mirror an image horizontally", "Mirror");
onTriggered: imageDoc.mirror(true, false);
enabled: !control.resizing
}
},
Maui.ToolActions
{
expanded: true
autoExclusive: false
checkable: false
display: ToolButton.TextBesideIcon
Action
{
icon.name: control.resizing ? "dialog-cancel" : "transform-crop"
text: control.resizing ? i18n("Cancel") : i18nc("@action:button Crop an image", "Crop");
onTriggered: control.resizing = !control.resizing;
}
}
]
MauiLab.Doodle
{
id: _doodleDialog
}
KQuickImageEditor.ImageDocument
{
id: imageDoc
path: control.url
}
Flickable
{
anchors.fill: parent
KQuickImageEditor.ImageItem
{
id: editImage
fillMode: KQuickImageEditor.ImageItem.PreserveAspectFit
image: imageDoc.image
anchors.fill: parent
}
}
KQuickImageEditor.ResizeRectangle
{
id: resizeRectangle
visible: control.resizing
width: 300
height: 300
x: 200
y: 200
onAcceptSize: crop();
Rectangle {
color: "#3daee9"
opacity: 0.6
anchors.fill: parent
}
KQuickImageEditor.BasicResizeHandle {
rectangle: resizeRectangle
resizeCorner: KQuickImageEditor.ResizeHandle.TopLeft
anchors {
horizontalCenter: parent.left
verticalCenter: parent.top
}
}
KQuickImageEditor.BasicResizeHandle {
rectangle: resizeRectangle
resizeCorner: KQuickImageEditor.ResizeHandle.BottomLeft
anchors {
horizontalCenter: parent.left
verticalCenter: parent.bottom
}
}
KQuickImageEditor.BasicResizeHandle {
rectangle: resizeRectangle
resizeCorner: KQuickImageEditor.ResizeHandle.BottomRight
anchors {
horizontalCenter: parent.right
verticalCenter: parent.bottom
}
}
KQuickImageEditor.BasicResizeHandle {
rectangle: resizeRectangle
resizeCorner: KQuickImageEditor.ResizeHandle.TopRight
anchors {
horizontalCenter: parent.right
verticalCenter: parent.top
}
}
}
}
......@@ -14,7 +14,6 @@ import org.kde.mauikit 1.1 as MauiLab
import org.maui.pix 1.0 as Pix
import GalleryList 1.0
StackView
{
id: control
......@@ -23,7 +22,7 @@ StackView
property alias holder : holder
property alias tagBar : tagBar
property alias roll : galleryRoll
readonly property bool editing : true
readonly property bool editing : control.currentItem.objectName === "imageEditor"
property bool currentPicFav: false
property var currentPic : ({})
......@@ -36,7 +35,11 @@ StackView
Component
{
id: _editorComponent
Editor {}
Editor
{
objectName: "imageEditor"
url: control.currentPic.url
}
}
initialItem: Maui.Page
......@@ -52,10 +55,6 @@ StackView
model: control.model
}
MauiLab.Doodle
{
id: _doodleDialog
}
footBar.visible: !holder.visible
autoHideFooter: true
......@@ -84,36 +83,15 @@ StackView
dialog.urls = [control.currentPic.url]
dialog.open()
}
},
ToolButton
{
visible: !Kirigami.Settings.isMobile
icon.name: "view-fullscreen"
onClicked: control.toogleFullscreen()
checked: fullScreen
}
]
footBar.leftContent: Maui.ToolActions
footBar.leftContent: ToolButton
{
expanded: true
autoExclusive: false
checkable: false
Action
{
icon.name: "object-rotate-left"
text: i18n("Rotate Left")
onTriggered: viewer.currentItem.item.rotateLeft()
}
Action
{
icon.name: "object-rotate-right"
text: i18n("Rotate Right")
onTriggered: viewer.currentItem.item.rotateRight()
}
visible: !Kirigami.Settings.isMobile
icon.name: "view-fullscreen"
onClicked: control.toogleFullscreen()
checked: fullScreen
}
footBar.middleContent: Maui.ToolActions
......@@ -243,7 +221,7 @@ StackView
allowEditMode: true
list.urls: [currentPic.url]
list.strict: false
onTagClicked: PIX.searchFor(tag)
// onTagClicked: PIX.searchFor(tag)
onAddClicked:
{
dialogLoader.sourceComponent = tagsDialogComponent
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment