Skip to content

Commit

Permalink
Various UI impovements
Browse files Browse the repository at this point in the history
  • Loading branch information
emericg committed Nov 19, 2019
1 parent 30e5a59 commit c267c54
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 16 deletions.
17 changes: 16 additions & 1 deletion qml/About.qml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,22 @@ Item {
anchors.topMargin: 8
anchors.rightMargin: 16
anchors.leftMargin: 16

/*
ListView {
// helper to list available fonts
anchors.fill: parent;
model: Qt.fontFamilies()
delegate: Item {
height: 40;
width: ListView.view.width
Text {
anchors.centerIn: parent
text: modelData;
}
}
}
*/
Item {
height: 48
anchors.left: parent.left
Expand Down
2 changes: 1 addition & 1 deletion qml/Application.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import "qrc:/js/UtilsPath.js" as UtilsPath
ApplicationWindow {
id: applicationWindow
minimumWidth: 480
minimumHeight: 800
minimumHeight: 900

flags: Qt.Window | Qt.MaximizeUsingFullscreenGeometryHint
color: Theme.colorBackground
Expand Down
11 changes: 5 additions & 6 deletions qml/InfosExport.qml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@ Item {

Item { ////
id: titleExport
x: 0
y: 16
height: 32
anchors.right: parent.right
anchors.rightMargin: 0
anchors.top: parent.top
anchors.topMargin: 16
anchors.left: parent.left
anchors.right: parent.right

ImageSvg {
width: 32
Expand All @@ -54,10 +53,10 @@ Item {

ButtonWireframe {
id: buttonExport
width: 96
width: 128
height: 32
anchors.right: parent.right
anchors.rightMargin: 24
anchors.rightMargin: 16
anchors.verticalCenter: parent.verticalCenter

text: qsTr("SAVE")
Expand Down
6 changes: 6 additions & 0 deletions qml/InfosGeneric.qml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ ScrollView {
repeaterOther.model = mediaItem.getOtherTracks()
}

////////////////////////////////////////////////////////////////////////////

Column {
anchors.top: parent.top
anchors.topMargin: 16
Expand Down Expand Up @@ -618,6 +620,10 @@ ScrollView {
autoTransform: true
fillMode: Image.PreserveAspectFit
}
MouseArea {
anchors.fill: parent
onPressAndHold: utils.openWith(mediaItem.fullpath);
}
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/minivideo_textexport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,15 @@ int textExport::generateExportDatas_text(MediaFile_t &media, QString &exportData
{
if (t->pixel_aspect_ratio_h || t->pixel_aspect_ratio_v)
{
exportDatas += "\nPixel Aspect ratio : ";
exportDatas += "\nPixel Aspect Ratio : ";
exportDatas += QString::number(t->pixel_aspect_ratio_h) + ":" + QString::number(t->pixel_aspect_ratio_v);
}
if (t->video_aspect_ratio > 0.0)
{
exportDatas += "\nVideo Aspect ratio : ";
exportDatas += "\nVideo Aspect Ratio : ";
exportDatas += getAspectRatioString(t->video_aspect_ratio, false);
}
exportDatas += "\nDisplay Aspect ratio : ";
exportDatas += "\nDisplay Aspect Ratio : ";
exportDatas += getAspectRatioString(t->display_aspect_ratio, true);
}
else
Expand Down
37 changes: 34 additions & 3 deletions src/utils_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,45 @@ UtilsApp::~UtilsApp()

/* ************************************************************************** */

void UtilsApp::openWith(const QString path)
void UtilsApp::openWith(const QString &path)
{
QDesktopServices::openUrl(QUrl::fromLocalFile(path));
QUrl url;

#if defined (Q_OS_ANDROID)
// Starting from API 24, open will only accept path begining by "content://"

if (path.startsWith("/"))
{
url = "content://" + path;
}
else if (path.startsWith("file://"))
{
QString newpath = path;
newpath = newpath.replace("file://", "content://");
url = newpath;
}
else if (path.startsWith("content://"))
{
url = path;
}

#elif defined (Q_OS_IOS)

url = QUrl::fromLocalFile(path);

#else // defined(Q_OS_LINUX) || defined(Q_OS_MACOS) || defined(Q_OS_WINDOWS)

url = QUrl::fromLocalFile(path);

#endif

//qDebug() << "url:" << url;
QDesktopServices::openUrl(url);
}

/* ************************************************************************** */

QUrl UtilsApp::getStandardPath(const QString type)
QUrl UtilsApp::getStandardPath(const QString &type)
{
android_ask_storage_permissions();

Expand Down
5 changes: 3 additions & 2 deletions src/utils_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include <QUrl>
#include <QSize>
#include <QString>
#include <QObject>
#include <QVariantMap>

Expand All @@ -37,9 +38,9 @@ class UtilsApp : public QObject
explicit UtilsApp(QObject* parent = nullptr);
~UtilsApp();

static Q_INVOKABLE void openWith(const QString path);
static Q_INVOKABLE void openWith(const QString &path);

static Q_INVOKABLE QUrl getStandardPath(const QString type);
static Q_INVOKABLE QUrl getStandardPath(const QString &type);

static Q_INVOKABLE bool getMobileStoragePermission();
static Q_INVOKABLE int getMobileStorageCount();
Expand Down

0 comments on commit c267c54

Please sign in to comment.