Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nheko
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
Container 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
Nheko Reborn
nheko
Commits
7f4656d3
Verified
Commit
7f4656d3
authored
3 years ago
by
Nicolas Werner
Browse files
Options
Downloads
Patches
Plain Diff
Refactor to use Instantiator instead of doing it manually
parent
53fcf7f4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#1139
failed
3 years ago
Stage: build
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
resources/qml/ChatPage.qml
+1
-1
1 addition, 1 deletion
resources/qml/ChatPage.qml
resources/qml/RoomList.qml
+22
-41
22 additions, 41 deletions
resources/qml/RoomList.qml
resources/qml/Root.qml
+3
-2
3 additions, 2 deletions
resources/qml/Root.qml
with
26 additions
and
44 deletions
resources/qml/ChatPage.qml
+
1
−
1
View file @
7f4656d3
...
...
@@ -31,8 +31,8 @@ Rectangle {
TimelineView
{
id
:
timeline
room
:
Rooms
.
currentRoom
room
:
Rooms
.
currentRoom
SplitView.fillWidth
:
true
SplitView.minimumWidth
:
400
}
...
...
This diff is collapsed.
Click to expand it.
resources/qml/RoomList.qml
+
22
−
41
View file @
7f4656d3
...
...
@@ -4,6 +4,7 @@
import
"
./dialogs
"
import
Qt
.
labs
.
platform
1.1
as
Platform
import
QtQml
2.13
import
QtQuick
2.13
import
QtQuick
.
Controls
2.13
import
QtQuick
.
Layouts
1.3
...
...
@@ -37,19 +38,12 @@ Page {
property
string
roomid
property
var
tags
property
var
allTags
function
show
(
roomid_
,
tags_
)
{
roomid
=
roomid_
;
tags
=
tags_
;
roomContextMenu
.
clear
();
roomContextMenu
.
addItem
(
leaveOpt
.
createObject
(
roomContextMenu
));
roomContextMenu
.
addItem
(
separatorOpt
.
createObject
(
roomContextMenu
));
for
(
let
tag
of
Rooms
.
tags
())
{
roomContextMenu
.
addItem
(
tagDelegate
.
createObject
(
roomContextMenu
,
{
"
t
"
:
tag
}));
}
roomContextMenu
.
addItem
(
newTagOpt
.
createObject
(
roomContextMenu
));
allTags
=
Rooms
.
tags
();
open
();
}
...
...
@@ -63,30 +57,22 @@ Page {
}
}
Component
{
id
:
leaveOpt
Platform.MenuItem
{
text
:
qsTr
(
"
Leave room
"
)
onTriggered
:
Rooms
.
leave
(
roomContextMenu
.
roomid
)
}
Platform.MenuItem
{
text
:
qsTr
(
"
Leave room
"
)
onTriggered
:
Rooms
.
leave
(
roomContextMenu
.
roomid
)
}
Component
{
id
:
separatorOpt
Platform.MenuSeparator
{
text
:
qsTr
(
"
Tag room as:
"
)
}
Platform.MenuSeparator
{
text
:
qsTr
(
"
Tag room as:
"
)
}
Component
{
id
:
tagDelegate
Instantiator
{
model
:
roomContextMenu
.
allTags
onObjectAdded
:
roomContextMenu
.
insertItem
(
index
+
2
,
object
)
onObjectRemoved
:
roomContextMenu
.
removeItem
(
object
)
Platform.MenuItem
{
property
string
t
delegate
:
Platform.MenuItem
{
property
string
t
:
modelData
text
:
{
switch
(
t
)
{
...
...
@@ -107,14 +93,9 @@ Page {
}
Component
{
id
:
newTagOpt
Platform.MenuItem
{
text
:
qsTr
(
"
Create new tag...
"
)
onTriggered
:
newTag
.
show
()
}
Platform.MenuItem
{
text
:
qsTr
(
"
Create new tag...
"
)
onTriggered
:
newTag
.
show
()
}
}
...
...
@@ -166,9 +147,9 @@ Page {
TapHandler
{
acceptedButtons
:
Qt
.
RightButton
onSingleTapped
:
{
if
(
!
TimelineManager
.
isInvite
)
{
if
(
!
TimelineManager
.
isInvite
)
roomContextMenu
.
show
(
model
.
roomId
,
model
.
tags
);
}
}
gesturePolicy
:
TapHandler
.
ReleaseWithinBounds
}
...
...
@@ -176,9 +157,9 @@ Page {
TapHandler
{
onSingleTapped
:
Rooms
.
setCurrentRoom
(
model
.
roomId
)
onLongPressed
:
{
if
(
!
TimelineManager
.
isInvite
)
{
if
(
!
TimelineManager
.
isInvite
)
roomContextMenu
.
show
(
model
.
roomId
,
model
.
tags
);
}
}
}
...
...
@@ -524,7 +505,6 @@ Page {
ToolTip.visible
:
hovered
ToolTip.text
:
qsTr
(
"
Start a new chat
"
)
Layout.margins
:
Nheko
.
paddingMedium
onClicked
:
roomJoinCreateMenu
.
open
(
parent
)
Platform.Menu
{
...
...
@@ -541,6 +521,7 @@ Page {
}
}
}
ImageButton
{
...
...
This diff is collapsed.
Click to expand it.
resources/qml/Root.qml
+
3
−
2
View file @
7f4656d3
...
...
@@ -74,11 +74,12 @@ Page {
Shortcut
{
sequence
:
"
Ctrl+Down
"
onActivated
:
Rooms
.
nextRoom
()
;
onActivated
:
Rooms
.
nextRoom
()
}
Shortcut
{
sequence
:
"
Ctrl+Up
"
onActivated
:
Rooms
.
previousRoom
()
;
onActivated
:
Rooms
.
previousRoom
()
}
Component
{
...
...
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