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
d42d1cd3
Commit
d42d1cd3
authored
1 year ago
by
Andreas Traczyk
Browse files
Options
Downloads
Patches
Plain Diff
misc: homogenize line-endings in ConversationExtrasPanel
Change-Id: I5b58db9d6e9254a177d9b86575f6dd670a086bd9
parent
762cbbff
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/app/mainview/components/ConversationExtrasPanel.qml
+90
-90
90 additions, 90 deletions
src/app/mainview/components/ConversationExtrasPanel.qml
with
90 additions
and
90 deletions
src/app/mainview/components/ConversationExtrasPanel.qml
+
90
−
90
View file @
d42d1cd3
/*
/*
* Copyright (C) 2023 Savoir-faire Linux Inc.
* Copyright (C) 2023 Savoir-faire Linux Inc.
*
*
* This program is free software; you can redistribute it and/or modify
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
*/
import
QtQuick
import
QtQuick
import
QtQuick
.
Layouts
import
QtQuick
.
Layouts
import
net
.
jami
.
Adapters
1.1
import
net
.
jami
.
Adapters
1.1
StackLayout
{
StackLayout
{
id
:
root
id
:
root
// We need to set the currentIndex to -1 to make sure the
// We need to set the currentIndex to -1 to make sure the
// panel is closed when the application starts.
// panel is closed when the application starts.
Component.onCompleted
:
closePanel
()
Component.onCompleted
:
closePanel
()
// The index of the tab in the swarm details panel.
// The index of the tab in the swarm details panel.
property
int
detailsIndex
:
-
1
property
int
detailsIndex
:
-
1
// Best to avoid using the visible property directly.
// Best to avoid using the visible property directly.
// Pass through the following open/close wrappers instead.
// Pass through the following open/close wrappers instead.
function
openPanel
(
panel
)
{
function
openPanel
(
panel
)
{
currentIndex
=
panel
;
currentIndex
=
panel
;
visible
=
true
;
visible
=
true
;
}
}
function
closePanel
()
{
function
closePanel
()
{
currentIndex
=
-
1
;
currentIndex
=
-
1
;
visible
=
false
;
visible
=
false
;
}
}
function
isOpen
(
panel
)
{
function
isOpen
(
panel
)
{
return
visible
&&
currentIndex
===
panel
;
return
visible
&&
currentIndex
===
panel
;
}
}
// This will open the details panel if it's not already visible.
// This will open the details panel if it's not already visible.
// Additionally, `toggle` being true (default) will close the panel
// Additionally, `toggle` being true (default) will close the panel
// if it is already open to `panel`.
// if it is already open to `panel`.
function
switchToPanel
(
panel
,
toggle
=
true
)
{
function
switchToPanel
(
panel
,
toggle
=
true
)
{
console
.
debug
(
"
switchToPanel: %1, toggle: %2
"
.
arg
(
panel
).
arg
(
toggle
));
console
.
debug
(
"
switchToPanel: %1, toggle: %2
"
.
arg
(
panel
).
arg
(
toggle
));
if
(
visible
)
{
if
(
visible
)
{
// We need to close the panel if it's open and we're switching to
// We need to close the panel if it's open and we're switching to
// the same panel.
// the same panel.
if
(
toggle
&&
currentIndex
===
panel
)
{
if
(
toggle
&&
currentIndex
===
panel
)
{
// Toggle off.
// Toggle off.
closePanel
();
closePanel
();
}
else
{
}
else
{
// Switch to the new panel.
// Switch to the new panel.
openPanel
(
panel
);
openPanel
(
panel
);
}
}
}
else
{
}
else
{
openPanel
(
panel
);
openPanel
(
panel
);
}
}
}
}
Connections
{
Connections
{
target
:
CurrentConversationMembers
target
:
CurrentConversationMembers
function
onCountChanged
()
{
function
onCountChanged
()
{
// Close the panel if there are 8 or more members in the
// Close the panel if there are 8 or more members in the
// conversation AND the "Add Member" panel is currently open.
// conversation AND the "Add Member" panel is currently open.
if
(
CurrentConversationMembers
.
count
>=
8
&&
isOpen
(
ChatView
.
AddMemberPanel
))
{
if
(
CurrentConversationMembers
.
count
>=
8
&&
isOpen
(
ChatView
.
AddMemberPanel
))
{
closePanel
();
closePanel
();
}
}
}
}
}
}
SwarmDetailsPanel
{
SwarmDetailsPanel
{
id
:
detailsPanel
id
:
detailsPanel
property
int
parentIndex
:
root
.
currentIndex
property
int
parentIndex
:
root
.
currentIndex
// When we change to the details panel we should load the tab index.
// When we change to the details panel we should load the tab index.
onParentIndexChanged
:
tabBarIndex
=
Math
.
min
(
tabBarItemsLength
-
1
,
Math
.
max
(
0
,
root
.
detailsIndex
))
onParentIndexChanged
:
tabBarIndex
=
Math
.
min
(
tabBarItemsLength
-
1
,
Math
.
max
(
0
,
root
.
detailsIndex
))
// Save it when it changes.
// Save it when it changes.
onTabBarIndexChanged
:
root
.
detailsIndex
=
tabBarIndex
onTabBarIndexChanged
:
root
.
detailsIndex
=
tabBarIndex
}
}
MessagesResearchPanel
{}
MessagesResearchPanel
{}
AddMemberPanel
{}
AddMemberPanel
{}
}
}
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