Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-client-qt
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
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
savoirfairelinux
jami-client-qt
Commits
ddc793e3
Commit
ddc793e3
authored
3 years ago
by
Ming Rui Zhang
Browse files
Options
Downloads
Patches
Plain Diff
aboutPopupButton: make the button width grows with text width
Change-Id: I99d5e01dd7438361a6ddafe2f1d97be1536c288b
parent
24a8631c
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/commoncomponents/MaterialButton.qml
+19
-33
19 additions, 33 deletions
src/commoncomponents/MaterialButton.qml
src/constant/JamiTheme.qml
+1
-0
1 addition, 0 deletions
src/constant/JamiTheme.qml
src/mainview/components/WelcomePage.qml
+9
-2
9 additions, 2 deletions
src/mainview/components/WelcomePage.qml
with
29 additions
and
35 deletions
src/commoncomponents/MaterialButton.qml
+
19
−
33
View file @
ddc793e3
...
@@ -41,7 +41,9 @@ Button {
...
@@ -41,7 +41,9 @@ Button {
property
var
iconPreferredHeight
:
18
property
var
iconPreferredHeight
:
18
property
var
iconPreferredWidth
:
18
property
var
iconPreferredWidth
:
18
property
bool
enableElide
:
true
property
int
elide
:
Text
.
ElideRight
property
int
elide
:
Text
.
ElideRight
property
int
textActualWidth
:
buttonTextMetrics
.
boundingRect
.
width
font.kerning
:
true
font.kerning
:
true
font.pointSize
:
JamiTheme
.
textFontSize
font.pointSize
:
JamiTheme
.
textFontSize
...
@@ -71,26 +73,9 @@ Button {
...
@@ -71,26 +73,9 @@ Button {
visible
:
animatedImageSource
.
length
!==
0
visible
:
animatedImageSource
.
length
!==
0
}
}
Image
{
Responsive
Image
{
id
:
buttonImage
id
:
buttonImage
property
real
pixelDensity
:
Screen
.
pixelDensity
property
real
isSvg
:
{
var
match
=
/
[^
.
]
+$/
.
exec
(
source
)
return
match
!==
null
&&
match
[
0
]
===
'
svg
'
}
function
setSourceSize
()
{
if
(
isSvg
)
{
sourceSize
.
width
=
width
sourceSize
.
height
=
height
}
else
sourceSize
=
undefined
}
onPixelDensityChanged
:
setSourceSize
()
Component.onCompleted
:
setSourceSize
()
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
anchors.leftMargin
:
JamiTheme
.
preferredMarginSize
/
2
anchors.leftMargin
:
JamiTheme
.
preferredMarginSize
/
2
...
@@ -99,20 +84,14 @@ Button {
...
@@ -99,20 +84,14 @@ Button {
width
:
iconPreferredWidth
width
:
iconPreferredWidth
visible
:
source
.
toString
().
length
!==
0
visible
:
source
.
toString
().
length
!==
0
layer
{
color
:
{
enabled
:
true
if
(
!
outlined
)
effect
:
ColorOverlay
{
return
"
white
"
id
:
overlay
if
(
hovered
&&
root
.
hoveredColor
)
color
:{
return
root
.
hoveredColor
if
(
!
outlined
)
if
(
checked
&&
root
.
pressedColor
)
return
"
white
"
return
root
.
pressedColor
if
(
hovered
&&
root
.
hoveredColor
)
return
root
.
color
return
root
.
hoveredColor
if
(
checked
&&
root
.
pressedColor
)
return
root
.
pressedColor
return
root
.
color
}
}
}
}
}
}
...
@@ -128,8 +107,15 @@ Button {
...
@@ -128,8 +107,15 @@ Button {
JamiTheme
.
preferredMarginSize
/
2
-
minimumIconTextSpacing
)
*
2
JamiTheme
.
preferredMarginSize
/
2
-
minimumIconTextSpacing
)
*
2
}
}
TextMetrics
{
id
:
buttonTextMetrics
font
:
buttonText
.
font
text
:
buttonText
.
text
}
text
:
root
.
text
text
:
root
.
text
elide
:
root
.
elid
e
elide
:
enableElide
?
root
.
elide
:
Text
.
ElideNon
e
color
:
{
color
:
{
if
(
!
outlined
)
if
(
!
outlined
)
return
"
white
"
return
"
white
"
...
...
This diff is collapsed.
Click to expand it.
src/constant/JamiTheme.qml
+
1
−
0
View file @
ddc793e3
...
@@ -196,6 +196,7 @@ Item {
...
@@ -196,6 +196,7 @@ Item {
property
real
smartListItemHeight
:
64
property
real
smartListItemHeight
:
64
property
real
smartListAvatarSize
:
52
property
real
smartListAvatarSize
:
52
property
real
avatarSizeInCall
:
130
property
real
avatarSizeInCall
:
130
property
real
aboutButtonPreferredWidth
:
150
property
real
callButtonPreferredSize
:
50
property
real
callButtonPreferredSize
:
50
property
real
contextMenuItemTextPreferredWidth
:
142
property
real
contextMenuItemTextPreferredWidth
:
142
property
real
contextMenuItemTextMaxWidth
:
182
property
real
contextMenuItemTextMaxWidth
:
182
...
...
This diff is collapsed.
Click to expand it.
src/mainview/components/WelcomePage.qml
+
9
−
2
View file @
ddc793e3
...
@@ -159,14 +159,21 @@ Rectangle {
...
@@ -159,14 +159,21 @@ Rectangle {
Layout.alignment
:
Qt
.
AlignBottom
|
Qt
.
AlignHCenter
Layout.alignment
:
Qt
.
AlignBottom
|
Qt
.
AlignHCenter
Layout.bottomMargin
:
JamiTheme
.
preferredMarginSize
Layout.bottomMargin
:
JamiTheme
.
preferredMarginSize
Layout.preferredWidth
:
150
Layout.preferredWidth
:
JamiTheme
.
aboutButtonPreferredWidth
Layout.preferredHeight
:
30
Layout.preferredHeight
:
preferredHeight
color
:
JamiTheme
.
buttonTintedBlack
color
:
JamiTheme
.
buttonTintedBlack
enableElide
:
false
hoveredColor
:
JamiTheme
.
buttonTintedBlackHovered
hoveredColor
:
JamiTheme
.
buttonTintedBlackHovered
pressedColor
:
JamiTheme
.
buttonTintedBlackPressed
pressedColor
:
JamiTheme
.
buttonTintedBlackPressed
outlined
:
true
outlined
:
true
onTextActualWidthChanged
:
{
if
(
textActualWidth
>
btnAboutPopUp
.
Layout
.
preferredWidth
)
btnAboutPopUp
.
Layout
.
preferredWidth
=
textActualWidth
+
JamiTheme
.
preferredMarginSize
*
2
}
text
:
JamiStrings
.
aboutJami
text
:
JamiStrings
.
aboutJami
onClicked
:
aboutPopUpDialog
.
open
()
onClicked
:
aboutPopUpDialog
.
open
()
...
...
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