Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-client-qt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-client-qt
Commits
58a96d14
Commit
58a96d14
authored
1 year ago
by
Aline Gondim Santos
Browse files
Options
Downloads
Patches
Plain Diff
RTL: fix layout width resizing
Change-Id: I65234d22ecd1e3cb3fc6544a449ec8fc1e78aee0 GitLab:
#235
parent
e073c6f8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app/commoncomponents/DualPaneView.qml
+29
-14
29 additions, 14 deletions
src/app/commoncomponents/DualPaneView.qml
src/app/commoncomponents/JamiSplitView.qml
+12
-7
12 additions, 7 deletions
src/app/commoncomponents/JamiSplitView.qml
with
41 additions
and
21 deletions
src/app/commoncomponents/DualPaneView.qml
+
29
−
14
View file @
58a96d14
...
...
@@ -25,6 +25,8 @@ BaseView {
required
property
Item
leftPaneItem
required
property
Item
rightPaneItem
property
bool
isRTL
:
UtilsAdapter
.
isRTL
property
alias
leftPane
:
leftPane
property
alias
rightPane
:
rightPane
...
...
@@ -33,34 +35,34 @@ BaseView {
property
real
minorPaneMinWidth
:
JamiTheme
.
mainViewLeftPaneMinWidth
property
real
majorPaneMinWidth
:
JamiTheme
.
mainViewPaneMinWidth
property
real
previousMinorPaneWidth
:
leftPane
.
width
property
real
previousMajorPaneWidth
:
rightPane
.
width
property
real
previousMinorPaneWidth
:
isRTL
?
leftPane
.
width
:
rightPane
.
width
property
real
previousMajorPaneWidth
:
isRTL
?
rightPane
.
width
:
leftPane
.
width
property
bool
isSinglePane
onPresented
:
{
if
(
leftPaneItem
)
leftPaneItem
.
parent
=
leftPane
;
leftPaneItem
.
parent
=
leftPane
if
(
rightPaneItem
)
rightPaneItem
.
parent
=
rightPane
;
splitView
.
restoreSplitViewState
()
;
resolvePanes
()
;
rightPaneItem
.
parent
=
rightPane
splitView
.
restoreSplitViewState
()
resolvePanes
()
}
onDismissed
:
splitView
.
saveSplitViewState
()
Component.onCompleted
:
{
// Avoid double triggering this handler during instantiation.
onIsSinglePaneChanged
.
connect
(
isSinglePaneChangedHandler
)
;
onIsSinglePaneChanged
.
connect
(
isSinglePaneChangedHandler
)
}
onWidthChanged
:
resolvePanes
()
function
resolvePanes
()
{
isSinglePane
=
width
<
majorPaneMinWidth
+
previousMinorPaneWidth
;
isSinglePane
=
width
<
majorPaneMinWidth
+
previousMinorPaneWidth
}
// Override this if needed.
property
var
isSinglePaneChangedHandler
:
function
()
{
rightPaneItem
.
parent
=
isSinglePane
?
leftPane
:
rightPane
;
rightPaneItem
.
parent
=
isSinglePane
?
leftPane
:
rightPane
}
JamiSplitView
{
...
...
@@ -83,11 +85,24 @@ BaseView {
clip
:
true
required
property
bool
isMinorPane
onWidthChanged
:
{
if
(
!
isSinglePane
&&
isMinorPane
)
previousMinorPaneWidth
=
width
;
if
(
!
isSinglePane
&&
((
isRTL
&&
!
isMinorPane
)
||
(
!
isRTL
&&
isMinorPane
)))
previousMinorPaneWidth
=
width
if
(
!
isSinglePane
&&
((
isRTL
&&
isMinorPane
)
||
(
!
isRTL
&&
!
isMinorPane
)))
previousMajorPaneWidth
=
width
}
SplitView.minimumWidth
:
isSinglePane
?
viewNode
.
width
:
(
isMinorPane
?
minorPaneMinWidth
:
majorPaneMinWidth
)
SplitView.maximumWidth
:
isSinglePane
?
viewNode
.
width
:
viewNode
.
width
-
(
isMinorPane
?
majorPaneMinWidth
:
minorPaneMinWidth
)
SplitView.preferredWidth
:
isMinorPane
?
minorPaneMinWidth
:
majorPaneMinWidth
Connections
{
target
:
UtilsAdapter
function
onIsRTLChanged
()
{
var
bck
=
previousMinorPaneWidth
previousMinorPaneWidth
=
previousMajorPaneWidth
previousMajorPaneWidth
=
bck
}
}
SplitView.minimumWidth
:
isSinglePane
?
viewNode
.
width
:
(
isMinorPane
&&
!
isRTL
?
minorPaneMinWidth
:
majorPaneMinWidth
)
SplitView.maximumWidth
:
isSinglePane
?
viewNode
.
width
:
viewNode
.
width
-
(
isMinorPane
&&
!
isRTL
?
majorPaneMinWidth
:
minorPaneMinWidth
)
SplitView.preferredWidth
:
isMinorPane
&&
!
isRTL
?
minorPaneMinWidth
:
majorPaneMinWidth
}
}
This diff is collapsed.
Click to expand it.
src/app/commoncomponents/JamiSplitView.qml
+
12
−
7
View file @
58a96d14
...
...
@@ -24,10 +24,18 @@ SplitView {
property
bool
isRTL
:
UtilsAdapter
.
isRTL
property
bool
isSinglePane
:
false
property
bool
isSwapped
:
UtilsAdapter
.
isRTL
property
bool
isSwapped
:
false
onIsRTLChanged
:
swapItems
()
onIsSinglePaneChanged
:
swapItems
()
onIsRTLChanged
:
{
if
(
isRTL
&&
isSinglePane
&&
!
isSwapped
)
return
if
((
isRTL
&&
!
isSwapped
)
||
(
!
isRTL
&&
isSwapped
))
swapItems
()
}
onIsSinglePaneChanged
:
{
if
(
isSwapped
||
isRTL
)
swapItems
()
}
property
string
splitViewStateKey
:
objectName
property
bool
autoManageState
:
!
(
parent
instanceof
BaseView
)
...
...
@@ -49,16 +57,13 @@ SplitView {
}
function
swapItems
()
{
if
((
isSinglePane
&&
!
isSwapped
)
// Do not swap in isSinglePane mode
||
(
!
isRTL
&&
!
isSwapped
))
// Do not swap if not RTL
return
;
isSwapped
=
!
isSwapped
var
qqci
=
children
[
0
];
if
(
qqci
.
children
.
length
>
1
)
{
// swap the children
var
tempPane
=
qqci
.
children
[
0
];
qqci
.
children
[
0
]
=
qqci
.
children
[
1
];
qqci
.
children
.
push
(
tempPane
);
isSwapped
=
true
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment