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
e09a02f5
Commit
e09a02f5
authored
5 years ago
by
tatiana.novikova
Browse files
Options
Downloads
Patches
Plain Diff
Revert "[*] Update calculating and deleting the unnecessary part of text at comboBox"
This reverts commit
b1d2addd
parent
b1d2addd
No related branches found
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
+10
-12
10 additions, 12 deletions
widgets/DapComboBox.qml
widgets/DapComboBoxForm.ui.qml
+1
-1
1 addition, 1 deletion
widgets/DapComboBoxForm.ui.qml
with
11 additions
and
13 deletions
widgets/DapComboBox.qml
+
10
−
12
View file @
e09a02f5
import
QtQuick
2.
4
import
QtQuick
2.
7
import
QtQuick
.
Controls
2.0
import
QtQuick
.
Controls
2.0
DapComboBoxForm
DapComboBoxForm
{
{
id
:
dapComboBox
id
:
dapComboBox
//temporary variable for the calculating unnecessary part of text
property
int
stringSize
delegate
:
ItemDelegate
delegate
:
ItemDelegate
{
{
...
@@ -30,7 +33,6 @@ DapComboBoxForm
...
@@ -30,7 +33,6 @@ DapComboBoxForm
anchors.fill
:
parent
anchors.fill
:
parent
anchors.topMargin
:
paddingTopItemDelegate
anchors.topMargin
:
paddingTopItemDelegate
anchors.leftMargin
:
popup
.
visible
?
sidePaddingActive
:
sidePaddingNormal
anchors.leftMargin
:
popup
.
visible
?
sidePaddingActive
:
sidePaddingNormal
anchors.rightMargin
:
popup
.
visible
?
sidePaddingActive
:
sidePaddingNormal
font
:
dapComboBox
.
font
font
:
dapComboBox
.
font
//Calculates various properties of a given string of text for a particular font
//Calculates various properties of a given string of text for a particular font
TextMetrics
TextMetrics
...
@@ -38,23 +40,19 @@ DapComboBoxForm
...
@@ -38,23 +40,19 @@ DapComboBoxForm
id
:
tm
id
:
tm
font
:
dapComboBox
.
font
font
:
dapComboBox
.
font
elide
:
Text
.
ElideRight
elide
:
Text
.
ElideRight
elideWidth
:
parent
.
width
-
(
popup
.
visible
?
sidePaddingActive
:
sidePaddingNormal
)
*
2
-
8
*
pt
text
:
modelData
text
:
modelData
elideWidth
:
{
if
(
index
!=
currentIndex
)
return
widthPopupComboBoxActive
-
2
*
sidePaddingActive
;
else
return
widthPopupComboBoxNormal
-
indicatorWidth
;
}
}
}
text
:
text
:
{
{
if
(
index
!=
currentIndex
)
if
(
index
!=
currentIndex
)
return
tm
.
elidedText
.
replace
(
'
…
'
,
'
..
'
)
;
return
modelData
;
else
else
{
{
mainLineText
=
tm
.
elidedText
.
replace
(
'
…
'
,
'
..
'
);
stringSize
=
tm
.
elidedText
.
length
;
if
(
stringSize
<
modelData
.
length
)
mainLineText
=
tm
.
elidedText
.
substring
(
0
,
stringSize
-
3
)
+
'
..
'
;
else
mainLineText
=
modelData
;
return
""
;
return
""
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
widgets/DapComboBoxForm.ui.qml
+
1
−
1
View file @
e09a02f5
...
@@ -102,7 +102,7 @@ ComboBox
...
@@ -102,7 +102,7 @@ ComboBox
Text
Text
{
{
id
:
textTopComboBox
id
:
textTopComboBox
anchors.
left
:
parent
.
left
anchors.
fill
:
parent
anchors.leftMargin
:
popup
.
visible
?
sidePaddingActive
:
sidePaddingNormal
anchors.leftMargin
:
popup
.
visible
?
sidePaddingActive
:
sidePaddingNormal
text
:
mainLineText
text
:
mainLineText
font
:
parent
.
font
font
:
parent
.
font
...
...
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