Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
c2881ac6
Commit
c2881ac6
authored
Sep 13, 2016
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(DropZone): new DropZone component, supports filedialog and DropArea
parent
f940f53d
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
94 additions
and
23 deletions
+94
-23
en.ts
tests/languages/en.ts
+7
-0
fr.ts
tests/languages/fr.ts
+7
-0
resources.qrc
tests/resources.qrc
+2
-1
Avatar.qml
tests/ui/components/contact/Avatar.qml
+2
-2
CheckBoxText.qml
tests/ui/components/form/CheckBoxText.qml
+2
-0
DropZone.qml
tests/ui/components/form/DropZone.qml
+67
-0
ExclusiveButtons.qml
tests/ui/components/form/ExclusiveButtons.qml
+2
-2
TransparentComboBox.qml
tests/ui/components/form/TransparentComboBox.qml
+2
-0
conversation.qml
tests/ui/views/mainWindow/conversation.qml
+2
-17
home.qml
tests/ui/views/mainWindow/home.qml
+1
-1
No files found.
tests/languages/en.ts
View file @
c2881ac6
<
?
xml
version
=
"
1.0
"
encoding
=
"
utf-8
"
?
>
<!
DOCTYPE
TS
>
<
TS
version
=
"
2.1
"
>
<
context
>
<
name
>
DropZone
<
/name
>
<
message
>
<
source
>
fileChooserTitle
<
/source
>
<
translation
>
Please
choose
one
or
many
files
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
SelectContact
<
/name
>
<
message
>
...
...
tests/languages/fr.ts
View file @
c2881ac6
<
?
xml
version
=
"
1.0
"
encoding
=
"
utf-8
"
?
>
<!
DOCTYPE
TS
>
<
TS
version
=
"
2.1
"
>
<
context
>
<
name
>
DropZone
<
/name
>
<
message
>
<
source
>
fileChooserTitle
<
/source
>
<
translation
>
Merci
de
choisir
un
ou
plusieurs
fichiers
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
SelectContact
<
/name
>
<
message
>
...
...
tests/resources.qrc
View file @
c2881ac6
...
...
@@ -11,7 +11,8 @@
<file>
ui/components/dialog/DialogDescription.qml
</file>
<file>
ui/components/dialog/DialogPlus.qml
</file>
<file>
ui/components/form/DarkButton.qml
</file>
<file>
ui/components/form/DialogCheckBox.qml
</file>
<file>
ui/components/form/CheckBoxText.qml
</file>
<file>
ui/components/form/DropZone.qml
</file>
<file>
ui/components/form/ExclusiveButtons.qml
</file>
<file>
ui/components/form/LightButton.qml
</file>
<file>
ui/components/form/SmallButton.qml
</file>
...
...
tests/ui/components/contact/Avatar.qml
View file @
c2881ac6
...
...
@@ -19,7 +19,7 @@ Item {
Text
{
anchors.centerIn
:
parent
color
:
'
#FFFFFF
'
text
:
(
function
()
{
text
:
{
var
spaceIndex
=
username
.
indexOf
(
'
'
)
var
firstLetter
=
username
.
charAt
(
0
)
...
...
@@ -28,7 +28,7 @@ Item {
}
return
firstLetter
+
username
.
charAt
(
spaceIndex
+
1
)
}
)()
}
}
Image
{
...
...
tests/ui/components/form/
DialogCheckBox
.qml
→
tests/ui/components/form/
CheckBoxText
.qml
View file @
c2881ac6
import
QtQuick
2.7
import
QtQuick
.
Controls
2.0
// ===================================================================
// Checkbox with clickable text.
// ===================================================================
CheckBox
{
...
...
tests/ui/components/form/DropZone.qml
0 → 100644
View file @
c2881ac6
import
QtQuick
2.7
import
QtQuick
.
Dialogs
1.2
// ===================================================================
Rectangle
{
signal
dropped
(
variant
files
)
color
:
'
#DDDDDD
'
id
:
dropZone
function
emitFiles
(
files
)
{
// Filtering files, urls are forbidden.
files
=
files
.
reduce
(
function
(
files
,
file
)
{
var
result
=
file
.
match
(
/^file:
\/\/(
.*
)
/
)
if
(
result
)
{
files
.
push
(
result
[
1
])
}
return
files
},
[])
if
(
files
.
length
>
0
)
{
dropped
(
files
)
}
}
DropArea
{
anchors.fill
:
parent
onDropped
:
{
dropZone
.
state
=
''
if
(
drop
.
hasUrls
)
{
emitFiles
(
drop
.
urls
)
}
}
onEntered
:
dropZone
.
state
=
'
hover
'
onExited
:
dropZone
.
state
=
''
}
MouseArea
{
anchors.fill
:
parent
onClicked
:
fileDialog
.
visible
=
true
}
Image
{
anchors.centerIn
:
parent
fillMode
:
Image
.
PreserveAspectFit
height
:
parent
.
height
source
:
'
qrc:/imgs/chat_attachment.svg
'
width
:
parent
.
width
}
FileDialog
{
folder
:
shortcuts
.
home
id
:
fileDialog
title
:
qsTr
(
'
fileChooserTitle
'
)
onAccepted
:
emitFiles
(
fileDialog
.
fileUrls
)
}
states
:
State
{
name
:
'
hover
'
PropertyChanges
{
target
:
dropZone
;
color
:
'
#BBBBBB
'
}
}
}
tests/ui/components/form/ExclusiveButtons.qml
View file @
c2881ac6
...
...
@@ -6,7 +6,7 @@ Row {
property
int
selectedButton
:
0
property
variant
texts
signal
buttonChang
ed
(
int
button
)
signal
click
ed
(
int
button
)
spacing
:
8
...
...
@@ -26,7 +26,7 @@ Row {
onClicked
:
{
if
(
selectedButton
!==
index
)
{
selectedButton
=
index
buttonChang
ed
(
index
)
click
ed
(
index
)
}
}
}
...
...
tests/ui/components/form/TransparentComboBox.qml
View file @
c2881ac6
import
QtQuick
2.7
import
QtQuick
.
Controls
2.0
// ===================================================================
// Discrete ComboBox which can be integrated in text.
// ===================================================================
ComboBox
{
...
...
tests/ui/views/mainWindow/conversation.qml
View file @
c2881ac6
...
...
@@ -130,6 +130,7 @@ ColumnLayout {
}
}
// Send area.
Rectangle
{
Layout.fillWidth
:
true
Layout.preferredHeight
:
70
...
...
@@ -140,7 +141,6 @@ ColumnLayout {
RowLayout
{
anchors.fill
:
parent
// Message to send.
Flickable
{
Layout.preferredHeight
:
parent
.
height
Layout.fillWidth
:
true
...
...
@@ -151,24 +151,9 @@ ColumnLayout {
}
}
// DropArea.
Rectangle
{
DropZone
{
Layout.preferredHeight
:
parent
.
height
-
newMessageArea
.
border
.
width
*
2
Layout.preferredWidth
:
40
color
:
'
#DDDDDD
'
DropArea
{
anchors.fill
:
parent
}
Image
{
anchors.right
:
parent
.
right
anchors.top
:
parent
.
top
fillMode
:
Image
.
PreserveAspectFit
height
:
parent
.
height
source
:
'
qrc:/imgs/chat_attachment.svg
'
width
:
parent
.
width
}
}
}
}
...
...
tests/ui/views/mainWindow/home.qml
View file @
c2881ac6
...
...
@@ -59,7 +59,7 @@ ColumnLayout {
Layout.fillWidth
:
true
Layout.preferredHeight
:
70
DialogCheckBox
{
CheckBoxText
{
anchors.left
:
parent
.
left
anchors.leftMargin
:
50
anchors.verticalCenter
:
parent
.
verticalCenter
...
...
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