Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vmj-qt
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
vmj-qt
Commits
62066c58
Commit
62066c58
authored
Jul 07, 2010
by
Dan Pascu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplified about panel code
parent
12a047fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
aboutpanel.py
blink/aboutpanel.py
+2
-3
No files found.
blink/aboutpanel.py
View file @
62066c58
...
@@ -6,7 +6,6 @@ from __future__ import with_statement
...
@@ -6,7 +6,6 @@ from __future__ import with_statement
__all__
=
[
'AboutPanel'
]
__all__
=
[
'AboutPanel'
]
from
PyQt4
import
uic
from
PyQt4
import
uic
from
PyQt4.QtGui
import
QFontMetrics
from
blink
import
__date__
,
__version__
from
blink
import
__date__
,
__version__
from
blink.resources
import
Resources
from
blink.resources
import
Resources
...
@@ -48,7 +47,7 @@ class AboutPanel(base_class, ui_class):
...
@@ -48,7 +47,7 @@ class AboutPanel(base_class, ui_class):
self
.
version
.
setText
(
u'Version
%
s
\n
%
s'
%
(
__version__
,
__date__
))
self
.
version
.
setText
(
u'Version
%
s
\n
%
s'
%
(
__version__
,
__date__
))
credits_width
=
QFontMetrics
(
self
.
credits_text
.
currentFont
()
)
.
width
(
"NLNET Foundation"
+
"http://sipsimpleclient.com"
)
+
40
credits_width
=
self
.
credits_text
.
fontMetrics
(
)
.
width
(
"NLNET Foundation"
+
"http://sipsimpleclient.com"
)
+
40
self
.
credits_text
.
setFixedWidth
(
credits_width
)
self
.
credits_text
.
setFixedWidth
(
credits_width
)
self
.
credits_text
.
document
()
.
documentLayout
()
.
documentSizeChanged
.
connect
(
self
.
_credits_size_changed
)
self
.
credits_text
.
document
()
.
documentLayout
()
.
documentSizeChanged
.
connect
(
self
.
_credits_size_changed
)
self
.
credits_text
.
setHtml
(
credits_text
)
self
.
credits_text
.
setHtml
(
credits_text
)
...
@@ -56,7 +55,7 @@ class AboutPanel(base_class, ui_class):
...
@@ -56,7 +55,7 @@ class AboutPanel(base_class, ui_class):
def
_credits_size_changed
(
self
,
size
):
def
_credits_size_changed
(
self
,
size
):
self
.
credits_text
.
document
()
.
documentLayout
()
.
documentSizeChanged
.
disconnect
(
self
.
_credits_size_changed
)
self
.
credits_text
.
document
()
.
documentLayout
()
.
documentSizeChanged
.
disconnect
(
self
.
_credits_size_changed
)
self
.
setFixedSize
(
self
.
minimumSize
()
.
width
(),
self
.
minimumSize
()
.
width
()
*
1.40
)
# set a fixed aspect ratio
self
.
setFixedSize
(
self
.
minimumSize
()
.
width
(),
self
.
minimumSize
()
.
width
()
*
1.40
)
# set a fixed aspect ratio
row_height
=
QFontMetrics
(
self
.
credits_text
.
currentFont
()
)
.
height
()
+
2
# +2 for cellspacing
row_height
=
self
.
credits_text
.
fontMetrics
(
)
.
height
()
+
2
# +2 for cellspacing
max_credits_height
=
8
*
row_height
+
2
+
14
# allow for maximum 8 rows; +2 for cellspacing and +14 for top/bottom margins
max_credits_height
=
8
*
row_height
+
2
+
14
# allow for maximum 8 rows; +2 for cellspacing and +14 for top/bottom margins
if
self
.
credits_text
.
height
()
>
max_credits_height
:
if
self
.
credits_text
.
height
()
>
max_credits_height
:
self
.
setFixedHeight
(
self
.
height
()
-
(
self
.
credits_text
.
height
()
-
max_credits_height
))
self
.
setFixedHeight
(
self
.
height
()
-
(
self
.
credits_text
.
height
()
-
max_credits_height
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment