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
6ad4f421
Commit
6ad4f421
authored
Mar 04, 2014
by
Dan Pascu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved how session icons are displayed over all backgrounds
parent
41d51203
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
143 additions
and
27 deletions
+143
-27
sessions.py
blink/sessions.py
+49
-4
chat_session.ui
resources/chat_session.ui
+77
-6
composing12.svg
resources/icons/composing12.svg
+4
-4
paused12.svg
resources/icons/paused12.svg
+2
-2
composing12.svg
resources/icons/work/composing12.svg
+9
-9
paused12.svg
resources/icons/work/paused12.svg
+2
-2
No files found.
blink/sessions.py
View file @
6ad4f421
...
...
@@ -17,7 +17,8 @@ from operator import attrgetter
from
PyQt4
import
uic
from
PyQt4.QtCore
import
Qt
,
QAbstractListModel
,
QByteArray
,
QEasingCurve
,
QEvent
,
QMimeData
,
QModelIndex
,
QObject
,
QPointF
,
QPropertyAnimation
,
QRect
,
QSize
,
QTimer
,
pyqtSignal
from
PyQt4.QtGui
import
QApplication
,
QBrush
,
QColor
,
QDrag
,
QLinearGradient
,
QListView
,
QMenu
,
QPainter
,
QPalette
,
QPen
,
QPixmap
,
QPolygonF
,
QShortcut
,
QStyle
,
QStyledItemDelegate
from
PyQt4.QtGui
import
QApplication
,
QBrush
,
QColor
,
QDrag
,
QIcon
,
QLabel
,
QLinearGradient
,
QListView
,
QMenu
,
QPainter
,
QPalette
,
QPen
,
QPixmap
,
QPolygonF
,
QShortcut
from
PyQt4.QtGui
import
QStyle
,
QStyledItemDelegate
,
QStyleOption
from
application.notification
import
IObserver
,
NotificationCenter
,
NotificationData
,
ObserverWeakrefProxy
from
application.python
import
Null
,
limit
...
...
@@ -39,7 +40,7 @@ from blink.util import call_later, run_in_gui_thread
from
blink.widgets.buttons
import
LeftSegment
,
MiddleSegment
,
RightSegment
from
blink.widgets.labels
import
Status
from
blink.widgets.color
import
ColorHelperMixin
from
blink.widgets.util
import
ContextMenuActions
from
blink.widgets.util
import
ContextMenuActions
,
QtDynamicProperty
class
RTPStreamInfo
(
object
):
...
...
@@ -2417,8 +2418,52 @@ class AudioSessionListView(QListView):
# Chat sessions
#
class
Palettes
(
object
):
pass
class
Container
(
object
):
pass
class
Palettes
(
Container
):
pass
class
PixmapContainer
(
Container
):
pass
class
ChatSessionIconLabel
(
QLabel
):
icon
=
QtDynamicProperty
(
'icon'
,
type
=
QIcon
)
selectedCompositionColor
=
QtDynamicProperty
(
'selectedCompositionColor'
,
type
=
QColor
)
def
__init__
(
self
,
parent
=
None
):
super
(
ChatSessionIconLabel
,
self
)
.
__init__
(
parent
)
self
.
pixmaps
=
PixmapContainer
()
self
.
icon_size
=
12
self
.
selectedCompositionColor
=
Qt
.
transparent
self
.
icon
=
None
def
event
(
self
,
event
):
if
event
.
type
()
==
QEvent
.
DynamicPropertyChange
and
event
.
propertyName
()
in
(
'icon'
,
'selectedCompositionColor'
)
and
getattr
(
self
,
'icon'
,
None
)
is
not
None
:
self
.
pixmaps
.
standard
=
self
.
icon
.
pixmap
(
self
.
icon_size
)
self
.
pixmaps
.
selected
=
QPixmap
(
self
.
pixmaps
.
standard
)
painter
=
QPainter
(
self
.
pixmaps
.
selected
)
painter
.
setRenderHint
(
QPainter
.
Antialiasing
,
True
)
painter
.
setCompositionMode
(
QPainter
.
CompositionMode_SourceAtop
)
painter
.
fillRect
(
self
.
pixmaps
.
selected
.
rect
(),
self
.
selectedCompositionColor
)
painter
.
end
()
return
super
(
ChatSessionIconLabel
,
self
)
.
event
(
event
)
def
paintEvent
(
self
,
event
):
if
self
.
icon
is
None
or
self
.
icon
.
isNull
():
return
session_widget
=
self
.
parent
()
.
parent
()
style
=
self
.
style
()
painter
=
QPainter
(
self
)
margin
=
self
.
margin
()
rect
=
self
.
contentsRect
()
.
adjusted
(
margin
,
margin
,
-
margin
,
-
margin
)
if
not
self
.
isEnabled
():
option
=
QStyleOption
()
option
.
initFrom
(
self
)
pixmap
=
style
.
generatedIconPixmap
(
QIcon
.
Disabled
,
self
.
pixmaps
.
standard
,
option
)
elif
session_widget
.
display_mode
is
session_widget
.
SelectedDisplayMode
:
pixmap
=
self
.
pixmaps
.
selected
else
:
pixmap
=
self
.
pixmaps
.
standard
align
=
style
.
visualAlignment
(
self
.
layoutDirection
(),
self
.
alignment
())
style
.
drawItemPixmap
(
painter
,
rect
,
align
,
pixmap
)
ui_class
,
base_class
=
uic
.
loadUiType
(
Resources
.
get
(
'chat_session.ui'
))
...
...
resources/chat_session.ui
View file @
6ad4f421
...
...
@@ -184,7 +184,7 @@
<number>
0
</number>
</property>
<item>
<widget
class=
"
Q
Label"
name=
"composing_icon"
>
<widget
class=
"
ChatSessionIcon
Label"
name=
"composing_icon"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Fixed"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch>
...
...
@@ -200,10 +200,21 @@
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
</property>
<property
name=
"icon"
stdset=
"0"
>
<iconset>
<normaloff>
icons/composing12.svg
</normaloff>
icons/composing12.svg
</iconset>
</property>
<property
name=
"selectedCompositionColor"
stdset=
"0"
>
<color>
<red>
0
</red>
<green>
255
</green>
<blue>
0
</blue>
</color>
</property>
</widget>
</item>
<item>
<widget
class=
"
Q
Label"
name=
"hold_icon"
>
<widget
class=
"
ChatSessionIcon
Label"
name=
"hold_icon"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Fixed"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch>
...
...
@@ -219,6 +230,17 @@
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
</property>
<property
name=
"icon"
stdset=
"0"
>
<iconset>
<normaloff>
icons/paused12.svg
</normaloff>
icons/paused12.svg
</iconset>
</property>
<property
name=
"selectedCompositionColor"
stdset=
"0"
>
<color
alpha=
"90"
>
<red>
138
</red>
<green>
192
</green>
<blue>
255
</blue>
</color>
</property>
</widget>
</item>
</layout>
...
...
@@ -269,7 +291,7 @@
<number>
0
</number>
</property>
<item>
<widget
class=
"
Q
Label"
name=
"screen_sharing_icon"
>
<widget
class=
"
ChatSessionIcon
Label"
name=
"screen_sharing_icon"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Fixed"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch>
...
...
@@ -285,10 +307,21 @@
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
</property>
<property
name=
"icon"
stdset=
"0"
>
<iconset>
<normaloff>
icons/screen12.svg
</normaloff>
icons/screen12.svg
</iconset>
</property>
<property
name=
"selectedCompositionColor"
stdset=
"0"
>
<color
alpha=
"90"
>
<red>
0
</red>
<green>
0
</green>
<blue>
0
</blue>
</color>
</property>
</widget>
</item>
<item>
<widget
class=
"
Q
Label"
name=
"video_icon"
>
<widget
class=
"
ChatSessionIcon
Label"
name=
"video_icon"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Fixed"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch>
...
...
@@ -304,10 +337,21 @@
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
</property>
<property
name=
"icon"
stdset=
"0"
>
<iconset>
<normaloff>
icons/camera12.svg
</normaloff>
icons/camera12.svg
</iconset>
</property>
<property
name=
"selectedCompositionColor"
stdset=
"0"
>
<color
alpha=
"90"
>
<red>
0
</red>
<green>
0
</green>
<blue>
0
</blue>
</color>
</property>
</widget>
</item>
<item>
<widget
class=
"
Q
Label"
name=
"audio_icon"
>
<widget
class=
"
ChatSessionIcon
Label"
name=
"audio_icon"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Fixed"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch>
...
...
@@ -323,10 +367,21 @@
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
</property>
<property
name=
"icon"
stdset=
"0"
>
<iconset>
<normaloff>
icons/speaker12.svg
</normaloff>
icons/speaker12.svg
</iconset>
</property>
<property
name=
"selectedCompositionColor"
stdset=
"0"
>
<color
alpha=
"90"
>
<red>
0
</red>
<green>
0
</green>
<blue>
0
</blue>
</color>
</property>
</widget>
</item>
<item>
<widget
class=
"
Q
Label"
name=
"chat_icon"
>
<widget
class=
"
ChatSessionIcon
Label"
name=
"chat_icon"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Fixed"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch>
...
...
@@ -342,6 +397,17 @@
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
</property>
<property
name=
"icon"
stdset=
"0"
>
<iconset>
<normaloff>
icons/chat12.svg
</normaloff>
icons/chat12.svg
</iconset>
</property>
<property
name=
"selectedCompositionColor"
stdset=
"0"
>
<color
alpha=
"90"
>
<red>
0
</red>
<green>
0
</green>
<blue>
0
</blue>
</color>
</property>
</widget>
</item>
</layout>
...
...
@@ -386,6 +452,11 @@
<extends>
QLabel
</extends>
<header>
blink.widgets.labels
</header>
</customwidget>
<customwidget>
<class>
ChatSessionIconLabel
</class>
<extends>
QLabel
</extends>
<header>
blink.sessions
</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
...
...
resources/icons/composing12.svg
View file @
6ad4f421
...
...
@@ -50,7 +50,7 @@
inkscape:pageopacity=
"0.0"
inkscape:pageshadow=
"2"
inkscape:zoom=
"68.916667"
inkscape:cx=
"6
.0665502
"
inkscape:cx=
"6"
inkscape:cy=
"6"
inkscape:current-layer=
"g4482"
showgrid=
"true"
...
...
@@ -101,7 +101,7 @@
sodipodi:cy=
"4.0193472"
sodipodi:cx=
"2.7279322"
id=
"path4484"
style=
"fill:#
55d4
00;fill-opacity:1;fill-rule:nonzero;stroke:none"
style=
"fill:#
00cc
00;fill-opacity:1;fill-rule:nonzero;stroke:none"
sodipodi:type=
"arc"
/>
<path
sodipodi:end=
"10.995574"
...
...
@@ -113,7 +113,7 @@
sodipodi:cy=
"4.0193472"
sodipodi:cx=
"2.7279322"
id=
"path4486"
style=
"fill:#
55d4
00;fill-opacity:1;fill-rule:nonzero;stroke:none"
style=
"fill:#
00cc
00;fill-opacity:1;fill-rule:nonzero;stroke:none"
sodipodi:type=
"arc"
/>
<path
sodipodi:end=
"10.995574"
...
...
@@ -125,7 +125,7 @@
sodipodi:cy=
"4.0193472"
sodipodi:cx=
"2.7279322"
id=
"path4488"
style=
"fill:#
55d4
00;fill-opacity:1;fill-rule:nonzero;stroke:none"
style=
"fill:#
00cc
00;fill-opacity:1;fill-rule:nonzero;stroke:none"
sodipodi:type=
"arc"
/>
</g>
</svg>
resources/icons/paused12.svg
View file @
6ad4f421
...
...
@@ -66,7 +66,7 @@
inkscape:label=
"Paused"
id=
"g8675"
>
<rect
style=
"fill:#
3d7fcb;fill-opacity:1;stroke:#69afff;stroke-width:0.75
;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;display:inline"
style=
"fill:#
4080cc;fill-opacity:1;stroke:#70b0ff;stroke-width:0.75000000000000000
;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;display:inline"
id=
"rect8681"
width=
"2.0000002"
height=
"9.25"
...
...
@@ -75,7 +75,7 @@
ry=
"1.1011904"
rx=
"1.0000001"
/>
<rect
style=
"fill:#
3d7fcb;fill-opacity:1;stroke:#69afff;stroke-width:0.75
;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;display:inline"
style=
"fill:#
4080cc;fill-opacity:1;stroke:#70b0ff;stroke-width:0.75000000000000000
;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;display:inline"
id=
"rect8681-6"
width=
"2.0000002"
height=
"9.25"
...
...
resources/icons/work/composing12.svg
View file @
6ad4f421
...
...
@@ -50,10 +50,10 @@
inkscape:pageopacity=
"0.0"
inkscape:pageshadow=
"2"
inkscape:zoom=
"68.916667"
inkscape:cx=
"6
.0665502
"
inkscape:cx=
"6"
inkscape:cy=
"6"
inkscape:current-layer=
"g4482"
showgrid=
"
fals
e"
showgrid=
"
tru
e"
inkscape:grid-bbox=
"true"
inkscape:document-units=
"px"
showguides=
"true"
...
...
@@ -108,7 +108,7 @@
transform=
"translate(0,-4)"
style=
"display:none"
>
<path
style=
"fill:none;stroke:#
55d4
00;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:1.6;marker-mid:none"
style=
"fill:none;stroke:#
00cc
00;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:1.6;marker-mid:none"
d=
"m 10.5,8.8435585 c 0,0.1790482 -0.03148,0.3538582 -0.09142,0.5226927 -0.05994,0.168835 -0.148352,0.331694 -0.262209,0.486837 C 10.032515,10.008233 9.8932114,10.155664 9.7314751,10.293641 9.5697382,10.431621 9.3855695,10.560146 9.1819845,10.677481 8.9783956,10.794818 8.7553943,10.900962 8.5159928,10.994179 8.2765912,11.087395 8.0207893,11.167683 7.751603,11.233302 7.1619031,11.390385 4.761985,13.753789 4.2,13.749995 3.7184914,13.746743 4.8054231,11.338988 4.248397,11.233302 3.9792106,11.167683 3.7234088,11.087395 3.4840073,10.994179 3.2446057,10.900962 3.0216044,10.794818 2.8180195,10.677481 2.6144345,10.560146 2.4302658,10.431621 2.2685294,10.293641 2.1067929,10.155664 1.9674885,10.008233 1.8536323,9.8530882 1.7397761,9.6979452 1.651368,9.5350862 1.591424,9.3662512 1.53148,9.1974167 1.5,9.0226067 1.5,8.8435585 1.5,8.6645117 1.53148,8.4897004 1.591424,8.3208658 1.651368,8.1520313 1.7397761,7.9891736 1.8536323,7.8340289 1.9674885,7.6788843 2.1067929,7.5314538 2.2685294,7.3934756 2.4302658,7.2554974 2.6144345,7.1269716 2.8180195,7.009636 3.0216044,6.8923005 3.2446057,6.7861555 3.4840073,6.6929394 3.7234088,6.5997231 3.9792106,6.5194356 4.248397,6.453815 4.5175832,6.3881943 4.8001539,6.3372406 5.093093,6.3026922 5.3860322,6.2681436 5.6893398,6.2500003 6,6.2500003 c 0.3106602,0 0.6139678,0.018143 0.906907,0.052691 0.2929391,0.034549 0.5755098,0.085501 0.844696,0.1511228 0.2691863,0.065621 0.5249882,0.1459083 0.7643898,0.2391245 0.2394015,0.093217 0.4624028,0.1993612 0.6659877,0.3166967 0.203585,0.1173354 0.3877537,0.2458613 0.5494906,0.3838396 0.1617363,0.1379781 0.3010399,0.2854086 0.4148969,0.440553 0.113856,0.1551457 0.202264,0.3180034 0.262208,0.4868379 C 10.46852,8.4897004 10.5,8.6645117 10.5,8.8435585 z"
id=
"path5518"
inkscape:connector-curvature=
"0"
...
...
@@ -130,7 +130,7 @@
sodipodi:cy=
"4.0193472"
sodipodi:cx=
"2.7279322"
id=
"path3855"
style=
"fill:#008
c3
0;fill-opacity:1;fill-rule:nonzero;stroke:none"
style=
"fill:#008
00
0;fill-opacity:1;fill-rule:nonzero;stroke:none"
sodipodi:type=
"arc"
/>
<path
sodipodi:end=
"10.995574"
...
...
@@ -142,7 +142,7 @@
sodipodi:cy=
"4.0193472"
sodipodi:cx=
"2.7279322"
id=
"path3857"
style=
"fill:#008
c3
0;fill-opacity:1;fill-rule:nonzero;stroke:none"
style=
"fill:#008
00
0;fill-opacity:1;fill-rule:nonzero;stroke:none"
sodipodi:type=
"arc"
/>
<path
sodipodi:end=
"10.995574"
...
...
@@ -154,7 +154,7 @@
sodipodi:cy=
"4.0193472"
sodipodi:cx=
"2.7279322"
id=
"path3859"
style=
"fill:#008
c3
0;fill-opacity:1;fill-rule:nonzero;stroke:none"
style=
"fill:#008
00
0;fill-opacity:1;fill-rule:nonzero;stroke:none"
sodipodi:type=
"arc"
/>
</g>
<g
...
...
@@ -173,7 +173,7 @@
sodipodi:cy=
"4.0193472"
sodipodi:cx=
"2.7279322"
id=
"path4484"
style=
"fill:#
55d4
00;fill-opacity:1;fill-rule:nonzero;stroke:none"
style=
"fill:#
00cc
00;fill-opacity:1;fill-rule:nonzero;stroke:none"
sodipodi:type=
"arc"
/>
<path
sodipodi:end=
"10.995574"
...
...
@@ -185,7 +185,7 @@
sodipodi:cy=
"4.0193472"
sodipodi:cx=
"2.7279322"
id=
"path4486"
style=
"fill:#
55d4
00;fill-opacity:1;fill-rule:nonzero;stroke:none"
style=
"fill:#
00cc
00;fill-opacity:1;fill-rule:nonzero;stroke:none"
sodipodi:type=
"arc"
/>
<path
sodipodi:end=
"10.995574"
...
...
@@ -197,7 +197,7 @@
sodipodi:cy=
"4.0193472"
sodipodi:cx=
"2.7279322"
id=
"path4488"
style=
"fill:#
55d4
00;fill-opacity:1;fill-rule:nonzero;stroke:none"
style=
"fill:#
00cc
00;fill-opacity:1;fill-rule:nonzero;stroke:none"
sodipodi:type=
"arc"
/>
</g>
</svg>
resources/icons/work/paused12.svg
View file @
6ad4f421
...
...
@@ -82,7 +82,7 @@
inkscape:label=
"Paused"
id=
"g8675"
>
<rect
style=
"fill:#
3d7fcb;fill-opacity:1;stroke:#69afff;stroke-width:0.75
;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;display:inline"
style=
"fill:#
4080cc;fill-opacity:1;stroke:#70b0ff;stroke-width:0.75000000000000000
;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;display:inline"
id=
"rect8681"
width=
"2.0000002"
height=
"9.25"
...
...
@@ -91,7 +91,7 @@
ry=
"1.1011904"
rx=
"1.0000001"
/>
<rect
style=
"fill:#
3d7fcb;fill-opacity:1;stroke:#69afff;stroke-width:0.75
;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;display:inline"
style=
"fill:#
4080cc;fill-opacity:1;stroke:#70b0ff;stroke-width:0.75000000000000000
;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;display:inline"
id=
"rect8681-6"
width=
"2.0000002"
height=
"9.25"
...
...
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