Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Maui
Pix
Commits
afecb73d
Commit
afecb73d
authored
Nov 07, 2021
by
camilo higuita
Browse files
add holder actions
parent
4039d8dd
Changes
5
Hide whitespace changes
Inline
Side-by-side
.clang-format
View file @
afecb73d
...
...
@@ -56,7 +56,7 @@ BinPackArguments: false
# don't move parameters to own lines if they are not all on the same
BinPackParameters: false
# In case we have an if statement w
h
ith multiple lines the operator should be at the beginning of the line
# In case we have an if statement with multiple lines the operator should be at the beginning of the line
# but we do not want to break assignments
BreakBeforeBinaryOperators: NonAssignment
...
...
@@ -79,7 +79,7 @@ SpaceAfterTemplateKeyword: false
AlwaysBreakTemplateDeclarations: true
# macros for which the opening brace stays attached.
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH, forever, Q_FOREVER, QBENCHMARK, QBENCHMARK_ONCE ]
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH, forever, Q_FOREVER, QBENCHMARK, QBENCHMARK_ONCE
, wl_resource_for_each, wl_resource_for_each_safe
]
# keep lambda formatting multi-line if not empty
AllowShortLambdasOnASingleLine: Empty
...
...
src/main.qml
View file @
afecb73d
...
...
@@ -125,30 +125,15 @@ Maui.ApplicationWindow
{
text
:
i18n
(
"
Open
"
)
icon.name
:
"
folder-open
"
onTriggered
:
{
dialogLoader
.
sourceComponent
=
fmDialogComponent
dialog
.
mode
=
dialog
.
modes
.
OPEN
dialog
.
settings
.
filterType
=
FB
.
FMList
.
IMAGE
dialog
.
settings
.
onlyDirs
=
false
dialog
.
callback
=
function
(
paths
)
{
console
.
log
(
"
OPEN THIS PATHS
"
,
paths
)
Pix
.
Collection
.
openPics
(
paths
)
};
dialog
.
open
()
}
onTriggered
:
openFileDialog
()
}
MenuItem
{
text
:
i18n
(
"
Settings
"
)
icon.name
:
"
settings-configure
"
onTriggered
:
{
dialogLoader
.
sourceComponent
=
_settingsDialogComponent
dialog
.
open
()
}
onTriggered
:
openSettingsDialog
()
}
MenuItem
...
...
@@ -405,4 +390,24 @@ Maui.ApplicationWindow
selectionBox
.
append
(
item
.
url
,
item
)
}
function
openFileDialog
()
{
dialogLoader
.
sourceComponent
=
fmDialogComponent
dialog
.
mode
=
dialog
.
modes
.
OPEN
dialog
.
settings
.
filterType
=
FB
.
FMList
.
IMAGE
dialog
.
settings
.
onlyDirs
=
false
dialog
.
callback
=
function
(
paths
)
{
Pix
.
Collection
.
openPics
(
paths
)
dialogLoader
.
sourceComponent
=
null
};
dialog
.
open
()
}
function
openSettingsDialog
()
{
dialogLoader
.
sourceComponent
=
_settingsDialogComponent
dialog
.
open
()
}
}
src/models/gallery/gallery.cpp
View file @
afecb73d
...
...
@@ -2,6 +2,7 @@
#include <QFileSystemWatcher>
#include <QDateTime>
#include <QDebug>
#include <QDir>
#include <MauiKit/FileBrowsing/fileloader.h>
#include <MauiKit/FileBrowsing/fmstatic.h>
#include <MauiKit/FileBrowsing/tagging.h>
...
...
@@ -11,12 +12,12 @@ static FMH::MODEL picInfo(const QUrl &url)
{
const
QFileInfo
info
(
url
.
toLocalFile
());
return
FMH
::
MODEL
{{
FMH
::
MODEL_KEY
::
URL
,
url
.
toString
()},
{
FMH
::
MODEL_KEY
::
TITLE
,
info
.
bas
eName
()},
{
FMH
::
MODEL_KEY
::
TITLE
,
info
.
fil
eName
()},
{
FMH
::
MODEL_KEY
::
SIZE
,
QString
::
number
(
info
.
size
())},
{
FMH
::
MODEL_KEY
::
SOURCE
,
FMStatic
::
fileDir
(
url
).
toString
()},
{
FMH
::
MODEL_KEY
::
SOURCE
,
QUrl
::
fromLocalFile
(
info
.
absoluteDir
().
absolutePath
()
).
toString
()},
{
FMH
::
MODEL_KEY
::
DATE
,
info
.
birthTime
().
toString
(
Qt
::
TextDate
)},
{
FMH
::
MODEL_KEY
::
MODIFIED
,
info
.
lastModified
().
toString
(
Qt
::
TextDate
)},
{
FMH
::
MODEL_KEY
::
FORMAT
,
info
.
s
uffix
()}};
{
FMH
::
MODEL_KEY
::
FORMAT
,
info
.
completeS
uffix
()}};
}
static
FMH
::
MODEL
picInfo2
(
const
QUrl
&
url
)
...
...
@@ -25,13 +26,13 @@ static FMH::MODEL picInfo2(const QUrl &url)
const
Exiv2Extractor
exiv2
(
url
);
return
FMH
::
MODEL
{{
FMH
::
MODEL_KEY
::
URL
,
url
.
toString
()},
{
FMH
::
MODEL_KEY
::
TITLE
,
info
.
bas
eName
()},
{
FMH
::
MODEL_KEY
::
TITLE
,
info
.
fil
eName
()},
{
FMH
::
MODEL_KEY
::
SIZE
,
QString
::
number
(
info
.
size
())},
{
FMH
::
MODEL_KEY
::
SOURCE
,
FMStatic
::
fileDir
(
url
).
toString
()},
{
FMH
::
MODEL_KEY
::
SOURCE
,
QUrl
::
fromLocalFile
(
info
.
absoluteDir
().
absolutePath
()
).
toString
()},
{
FMH
::
MODEL_KEY
::
DATE
,
info
.
birthTime
().
toString
(
Qt
::
TextDate
)},
{
FMH
::
MODEL_KEY
::
MODIFIED
,
info
.
lastModified
().
toString
(
Qt
::
TextDate
)},
{
FMH
::
MODEL_KEY
::
CITY
,
exiv2
.
cityId
()},
{
FMH
::
MODEL_KEY
::
FORMAT
,
info
.
s
uffix
()}};
{
FMH
::
MODEL_KEY
::
FORMAT
,
info
.
completeS
uffix
()}};
}
Gallery
::
Gallery
(
QObject
*
parent
)
...
...
src/view_models/PixGrid.qml
View file @
afecb73d
...
...
@@ -33,14 +33,6 @@ Maui.Page
autoReload
:
browserSettings
.
autoReload
}
Maui.Holder
{
id
:
_holder
anchors.fill
:
parent
visible
:
_gridView
.
count
===
0
emojiSize
:
Maui
.
Style
.
iconSizes
.
huge
}
showTitle
:
false
headBar.forceCenterMiddleContent
:
false
headBar.visible
:
true
...
...
@@ -257,6 +249,14 @@ Maui.Page
}
}
Maui.Holder
{
id
:
_holder
anchors.fill
:
parent
visible
:
_gridView
.
count
===
0
emojiSize
:
Maui
.
Style
.
iconSizes
.
huge
}
function
filterSelectedItems
(
path
)
{
if
(
selectionBox
&&
selectionBox
.
count
>
0
&&
selectionBox
.
contains
(
path
))
...
...
src/widgets/views/Gallery/GalleryView.qml
View file @
afecb73d
...
...
@@ -21,7 +21,20 @@ PixGrid
holder.emoji
:
"
qrc:/assets/image-multiple.svg
"
holder.emojiSize
:
Maui
.
Style
.
iconSizes
.
huge
holder.title
:
i18n
(
"
No Pics!
"
)
holder.body
:
mainGalleryList
.
status
===
GalleryList
.
Error
?
mainGalleryList
.
error
:
i18n
(
"
Nothing here. Try something different!
"
)
holder.body
:
mainGalleryList
.
status
===
GalleryList
.
Error
?
mainGalleryList
.
error
:
i18n
(
"
Nothing here. You can add new sources or open an image.
"
)
holder.actions
:[
Action
{
text
:
i18n
(
"
Open
"
)
onTriggered
:
openFileDialog
()
},
Action
{
text
:
i18n
(
"
Add sources
"
)
onTriggered
:
openSettingsDialog
()
}
]
footerColumn
:
RowLayout
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment