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
94c53baa
Commit
94c53baa
authored
Jun 04, 2010
by
Dan Pascu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved the way sessions are painted
parent
8d66279e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
6 deletions
+34
-6
sessions.py
blink/sessions.py
+34
-6
No files found.
blink/sessions.py
View file @
94c53baa
...
...
@@ -9,7 +9,7 @@ import cPickle as pickle
from
PyQt4
import
uic
from
PyQt4.QtCore
import
Qt
,
QAbstractListModel
,
QByteArray
,
QMimeData
,
QModelIndex
,
QSize
,
QStringList
,
QTimer
,
pyqtSignal
from
PyQt4.QtGui
import
QAction
,
QBrush
,
QColor
,
QListView
,
QMenu
,
QPainter
,
QPen
,
QPixmap
,
QStyle
,
QStyledItemDelegate
from
PyQt4.QtGui
import
QAction
,
QBrush
,
QColor
,
QLi
nearGradient
,
QLi
stView
,
QMenu
,
QPainter
,
QPen
,
QPixmap
,
QStyle
,
QStyledItemDelegate
from
application.python.util
import
Null
...
...
@@ -165,6 +165,10 @@ class SessionWidget(base_class, ui_class):
super
(
SessionWidget
,
self
)
.
__init__
(
parent
)
with
Resources
.
directory
:
self
.
setupUi
(
self
)
# add a left margin for the colored band
self
.
address_layout
.
setContentsMargins
(
8
,
-
1
,
-
1
,
-
1
)
self
.
stream_layout
.
setContentsMargins
(
8
,
-
1
,
-
1
,
-
1
)
self
.
bottom_layout
.
setContentsMargins
(
8
,
-
1
,
-
1
,
-
1
)
font
=
self
.
latency_label
.
font
()
font
.
setPointSizeF
(
self
.
status_label
.
fontInfo
()
.
pointSizeF
()
-
1
)
self
.
latency_label
.
setFont
(
font
)
...
...
@@ -258,16 +262,40 @@ class SessionWidget(base_class, ui_class):
# draw inner rect and border
#
if
self
.
selected
:
painter
.
setBrush
(
QBrush
(
QColor
(
'#d3dcff'
)))
# c3c9ff, d3d9ff/d3dcff, e3e9ff
background
=
QLinearGradient
(
0
,
0
,
10
,
0
)
background
.
setColorAt
(
0.00
,
QColor
(
'#75c0ff'
))
background
.
setColorAt
(
0.99
,
QColor
(
'#75c0ff'
))
background
.
setColorAt
(
1.00
,
QColor
(
'#ffffff'
))
painter
.
setBrush
(
QBrush
(
background
))
painter
.
setPen
(
QPen
(
QBrush
(
QColor
(
'#606060'
if
self
.
conference_position
is
None
else
'#b0b0b0'
)),
2.0
))
elif
self
.
conference_position
is
not
None
:
painter
.
setBrush
(
QBrush
(
QColor
(
'#d3ffdc'
)))
background
=
QLinearGradient
(
0
,
0
,
10
,
0
)
background
.
setColorAt
(
0.00
,
QColor
(
'#95ff95'
))
background
.
setColorAt
(
0.99
,
QColor
(
'#95ff95'
))
background
.
setColorAt
(
1.00
,
QColor
(
'#ffffff'
))
painter
.
setBrush
(
QBrush
(
background
))
painter
.
setPen
(
QPen
(
QBrush
(
QColor
(
'#b0b0b0'
)),
2.0
))
else
:
painter
.
setBrush
(
Qt
.
NoBrush
)
background
=
QLinearGradient
(
0
,
0
,
10
,
0
)
background
.
setColorAt
(
0.00
,
QColor
(
'#d0d0d0'
))
background
.
setColorAt
(
0.99
,
QColor
(
'#d0d0d0'
))
background
.
setColorAt
(
1.00
,
QColor
(
'#ffffff'
))
painter
.
setBrush
(
QBrush
(
background
))
painter
.
setPen
(
QPen
(
QBrush
(
QColor
(
'#b0b0b0'
)),
2.0
))
painter
.
drawRoundedRect
(
rect
.
adjusted
(
2
,
2
,
-
2
,
-
2
),
3
,
3
)
# for conferences extend the left marker over the whole conference
#
if
self
.
conference_position
is
not
None
:
painter
.
setPen
(
Qt
.
NoPen
)
left_rect
=
rect
.
adjusted
(
0
,
0
,
10
-
rect
.
width
(),
0
)
if
self
.
conference_position
is
Top
:
painter
.
drawRect
(
left_rect
.
adjusted
(
2
,
5
,
0
,
5
))
elif
self
.
conference_position
is
Middle
:
painter
.
drawRect
(
left_rect
.
adjusted
(
2
,
-
5
,
0
,
5
))
elif
self
.
conference_position
is
Bottom
:
painter
.
drawRect
(
left_rect
.
adjusted
(
2
,
-
5
,
0
,
-
5
))
# draw outer border
#
if
self
.
selected
or
self
.
drop_indicator
:
...
...
@@ -275,7 +303,7 @@ class SessionWidget(base_class, ui_class):
if
self
.
drop_indicator
:
painter
.
setPen
(
QPen
(
QBrush
(
QColor
(
'#dc3169'
)),
2.0
))
elif
self
.
selected
:
painter
.
setPen
(
QPen
(
QBrush
(
QColor
(
'#
606060'
)),
2.0
))
painter
.
setPen
(
QPen
(
QBrush
(
QColor
(
'#
3075c0'
)),
2.0
))
# or #2070c0 (next best look) or gray: #606060
if
self
.
conference_position
is
Top
:
painter
.
drawRoundedRect
(
rect
.
adjusted
(
2
,
2
,
-
2
,
5
),
3
,
3
)
...
...
@@ -291,7 +319,7 @@ class SessionWidget(base_class, ui_class):
painter
.
drawRoundedRect
(
rect
.
adjusted
(
1
,
1
,
-
1
,
-
1
),
3
,
3
)
elif
self
.
conference_position
is
not
None
:
painter
.
setBrush
(
Qt
.
NoBrush
)
painter
.
setPen
(
QPen
(
QBrush
(
QColor
(
'#
237523'
)),
2.0
))
# or 257a25
painter
.
setPen
(
QPen
(
QBrush
(
QColor
(
'#
309030'
)),
2.0
))
# or 237523, #2b8f2b
if
self
.
conference_position
is
Top
:
painter
.
drawRoundedRect
(
rect
.
adjusted
(
2
,
2
,
-
2
,
5
),
3
,
3
)
elif
self
.
conference_position
is
Middle
:
...
...
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