Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libdap-qt-ui-qml
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
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
cellframe
libdap-qt-ui-qml
Commits
b1d2addd
Commit
b1d2addd
authored
5 years ago
by
Ksard
Browse files
Options
Downloads
Patches
Plain Diff
[*] Update calculating and deleting the unnecessary part of text at comboBox
parent
d1852d4b
No related branches found
Branches containing commit
No related tags found
1 merge request
!14
Features 2603
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
widgets/DapComboBox.qml
+12
-10
12 additions, 10 deletions
widgets/DapComboBox.qml
widgets/DapComboBoxForm.ui.qml
+1
-1
1 addition, 1 deletion
widgets/DapComboBoxForm.ui.qml
with
13 additions
and
11 deletions
widgets/DapComboBox.qml
+
12
−
10
View file @
b1d2addd
import
QtQuick
2.
7
import
QtQuick
2.
4
import
QtQuick
.
Controls
2.0
DapComboBoxForm
{
id
:
dapComboBox
//temporary variable for the calculating unnecessary part of text
property
int
stringSize
delegate
:
ItemDelegate
{
...
...
@@ -33,6 +30,7 @@ DapComboBoxForm
anchors.fill
:
parent
anchors.topMargin
:
paddingTopItemDelegate
anchors.leftMargin
:
popup
.
visible
?
sidePaddingActive
:
sidePaddingNormal
anchors.rightMargin
:
popup
.
visible
?
sidePaddingActive
:
sidePaddingNormal
font
:
dapComboBox
.
font
//Calculates various properties of a given string of text for a particular font
TextMetrics
...
...
@@ -40,19 +38,23 @@ DapComboBoxForm
id
:
tm
font
:
dapComboBox
.
font
elide
:
Text
.
ElideRight
elideWidth
:
parent
.
width
-
(
popup
.
visible
?
sidePaddingActive
:
sidePaddingNormal
)
*
2
-
8
*
pt
text
:
modelData
elideWidth
:
{
if
(
index
!=
currentIndex
)
return
widthPopupComboBoxActive
-
2
*
sidePaddingActive
;
else
return
widthPopupComboBoxNormal
-
indicatorWidth
;
}
}
text
:
{
if
(
index
!=
currentIndex
)
return
modelData
;
return
tm
.
elidedText
.
replace
(
'
…
'
,
'
..
'
)
;
else
{
stringSize
=
tm
.
elidedText
.
length
;
if
(
stringSize
<
modelData
.
length
)
mainLineText
=
tm
.
elidedText
.
substring
(
0
,
stringSize
-
3
)
+
'
..
'
;
else
mainLineText
=
modelData
;
mainLineText
=
tm
.
elidedText
.
replace
(
'
…
'
,
'
..
'
);
return
""
;
}
}
...
...
This diff is collapsed.
Click to expand it.
widgets/DapComboBoxForm.ui.qml
+
1
−
1
View file @
b1d2addd
...
...
@@ -102,7 +102,7 @@ ComboBox
Text
{
id
:
textTopComboBox
anchors.
fill
:
parent
anchors.
left
:
parent
.
left
anchors.leftMargin
:
popup
.
visible
?
sidePaddingActive
:
sidePaddingNormal
text
:
mainLineText
font
:
parent
.
font
...
...
This diff is collapsed.
Click to expand it.
tatiana.novikova
@tatiana.novikova
mentioned in commit
e09a02f5
·
5 years ago
mentioned in commit
e09a02f5
mentioned in commit e09a02f5722353288692d52d5caf2d15c1c176f6
Toggle commit list
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