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
Merge requests
!14
Features 2603
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Features 2603
features-2603
into
develop
Overview
0
Commits
9
Pipelines
0
Changes
3
Merged
tatiana.novikova
requested to merge
features-2603
into
develop
5 years ago
Overview
0
Commits
9
Pipelines
0
Changes
2
Expand
[*] Update calculating and deleting the unnecessary part of text at comboBox
👍
0
👎
0
Merge request reports
Viewing commit
acf63490
Prev
Next
Show latest version
2 files
+
11
−
11
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
acf63490
[*] Update calculating and deleting the unnecessary part of text at comboBox
· acf63490
tatiana.novikova
authored
5 years ago
widgets/DapComboBox.qml
+
11
−
10
Options
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,22 @@ 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
""
;
}
}
Loading