Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
Quick Tiled View
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
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
Yuya Nishihara
Quick Tiled View
Commits
f50a401a
Commit
f50a401a
authored
3 years ago
by
Yuya Nishihara
Browse files
Options
Downloads
Patches
Plain Diff
implement major splitter handle
parent
15e732dc
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
TileView.qml
+63
-0
63 additions, 0 deletions
TileView.qml
with
63 additions
and
0 deletions
TileView.qml
+
63
−
0
View file @
f50a401a
import
QtQuick
2.15
import
QtQuick
.
Controls
2.15
import
QtQml
2.15
// Binding.restoreMode
Control
{
id
:
root
...
...
@@ -91,5 +92,67 @@ Control {
}
}
}
Item
{
anchors.fill
:
parent
Repeater
{
model
:
root
.
majorCount
Rectangle
{
id
:
majorHandle
required
property
int
index
// TODO: race on majorOrientation changed
anchors.left
:
root
.
majorOrientation
!==
Qt
.
Horizontal
?
parent
.
left
:
undefined
anchors.right
:
root
.
majorOrientation
!==
Qt
.
Horizontal
?
parent
.
right
:
undefined
anchors.top
:
root
.
majorOrientation
===
Qt
.
Horizontal
?
parent
.
top
:
undefined
anchors.bottom
:
root
.
majorOrientation
===
Qt
.
Horizontal
?
parent
.
bottom
:
undefined
width
:
5
height
:
5
visible
:
index
>
0
color
:
"
gray
"
onXChanged
:
{
if
(
root
.
majorOrientation
!==
Qt
.
Horizontal
||
!
majorDragHandler
.
active
)
return
;
let
positions
=
root
.
_majorPositions
;
positions
[
index
]
=
x
/
contentArea
.
width
;
root
.
_majorPositions
=
positions
;
}
onYChanged
:
{
if
(
root
.
majorOrientation
===
Qt
.
Horizontal
||
!
majorDragHandler
.
active
)
return
;
let
positions
=
root
.
_majorPositions
;
positions
[
index
]
=
y
/
contentArea
.
height
;
root
.
_majorPositions
=
positions
;
}
Binding
on
x
{
when
:
root
.
majorOrientation
===
Qt
.
Horizontal
&&
!
majorDragHandler
.
active
value
:
contentArea
.
width
*
root
.
_majorPositions
[
majorHandle
.
index
]
restoreMode
:
Binding
.
RestoreNone
}
Binding
on
y
{
when
:
root
.
majorOrientation
!==
Qt
.
Horizontal
&&
!
majorDragHandler
.
active
value
:
contentArea
.
height
*
root
.
_majorPositions
[
majorHandle
.
index
]
restoreMode
:
Binding
.
RestoreNone
}
HoverHandler
{
cursorShape
:
root
.
majorOrientation
===
Qt
.
Horizontal
?
Qt
.
SplitHCursor
:
Qt
.
SplitVCursor
}
DragHandler
{
id
:
majorDragHandler
xAxis.enabled
:
root
.
majorOrientation
===
Qt
.
Horizontal
yAxis.enabled
:
root
.
majorOrientation
!==
Qt
.
Horizontal
// TODO: minimum/maximum
}
}
}
}
}
}
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