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
2e5aad06
Commit
2e5aad06
authored
Jul 06, 2010
by
Dan Pascu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed about panel aspect ratio
parent
403cced6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
12 deletions
+8
-12
aboutpanel.py
blink/aboutpanel.py
+6
-4
about_panel.ui
resources/about_panel.ui
+2
-8
No files found.
blink/aboutpanel.py
View file @
2e5aad06
...
@@ -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.QtCore
import
QSize
from
PyQt4.QtGui
import
QFontMetrics
from
PyQt4.QtGui
import
QFontMetrics
from
blink
import
__date__
,
__version__
from
blink
import
__date__
,
__version__
...
@@ -50,14 +49,17 @@ class AboutPanel(base_class, ui_class):
...
@@ -50,14 +49,17 @@ 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
=
QFontMetrics
(
self
.
credits_text
.
currentFont
())
.
width
(
"NLNET Foundation"
+
"http://sipsimpleclient.com"
)
+
40
self
.
credits_text
.
set
Minimum
Width
(
credits_width
)
self
.
credits_text
.
set
Fixed
Width
(
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
)
def
_credits_size_changed
(
self
,
size
):
def
_credits_size_changed
(
self
,
size
):
size
.
setHeight
(
max
(
size
.
height
(),
168
))
self
.
credits_text
.
document
()
.
documentLayout
()
.
documentSizeChanged
.
disconnect
(
self
.
_credits_size_changed
)
self
.
credits_text
.
document
()
.
documentLayout
()
.
documentSizeChanged
.
disconnect
(
self
.
_credits_size_changed
)
self
.
credits_text
.
setFixedSize
(
size
.
toSize
()
+
QSize
(
6
,
6
))
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
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
:
self
.
setFixedHeight
(
self
.
height
()
-
(
self
.
credits_text
.
height
()
-
max_credits_height
))
del
ui_class
,
base_class
del
ui_class
,
base_class
resources/about_panel.ui
View file @
2e5aad06
...
@@ -6,8 +6,8 @@
...
@@ -6,8 +6,8 @@
<rect>
<rect>
<x>
0
</x>
<x>
0
</x>
<y>
0
</y>
<y>
0
</y>
<width>
30
0
</width>
<width>
27
0
</width>
<height>
451
</height>
<height>
380
</height>
</rect>
</rect>
</property>
</property>
<property
name=
"windowTitle"
>
<property
name=
"windowTitle"
>
...
@@ -113,12 +113,6 @@ July 5, 2010</string>
...
@@ -113,12 +113,6 @@ July 5, 2010</string>
</item>
</item>
<item>
<item>
<widget
class=
"QTextBrowser"
name=
"credits_text"
>
<widget
class=
"QTextBrowser"
name=
"credits_text"
>
<property
name=
"minimumSize"
>
<size>
<width>
294
</width>
<height>
194
</height>
</size>
</property>
<property
name=
"html"
>
<property
name=
"html"
>
<string>
<
!DOCTYPE HTML PUBLIC
"
-//W3C//DTD HTML 4.0//EN
"
"
http://www.w3.org/TR/REC-html40/strict.dtd
">
<string>
<
!DOCTYPE HTML PUBLIC
"
-//W3C//DTD HTML 4.0//EN
"
"
http://www.w3.org/TR/REC-html40/strict.dtd
">
<
html
><
head
><
meta name=
"
qrichtext
"
content=
"
1
"
/
><
style type=
"
text/css
">
<
html
><
head
><
meta name=
"
qrichtext
"
content=
"
1
"
/
><
style type=
"
text/css
">
...
...
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