Skip to content

Commit e8ed303

Browse files
authored
Update PhononVideoPlayer.py
removed unused modules, better slider integration
1 parent b47363b commit e8ed303

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

PhononVideoPlayer.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
#!/usr/bin/python
2+
# -*- coding: utf-8 -*-
13
from PyQt4 import QtGui, QtCore
2-
from PyQt4.QtGui import QSizePolicy, QListWidget, QListWidgetItem, \
3-
QMenu, QTableWidget, QFileDialog, QAction, QCursor
4+
from PyQt4.QtGui import QSizePolicy, QMenu, QFileDialog, QAction, QCursor
45
from PyQt4.phonon import Phonon
5-
from PyQt4.Qt import QSize, QString, Qt, QStatusBar, QIcon, QImage, QGraphicsOpacityEffect, QMessageBox
6-
from PyQt4.QtCore import QPoint
6+
from PyQt4.Qt import QSize, QString, Qt, QIcon, QMessageBox
77

88
class Window(QtGui.QWidget):
99
def __init__(self):
@@ -39,10 +39,9 @@ def __init__(self):
3939
layout = QtGui.QGridLayout(self)
4040
layout.setMargin(1)
4141
layout.addWidget(self.video, 0, 0, 1, 1)
42-
layout.addWidget(self.slider, 0, 0, 1, 1)
43-
layout.setColumnStretch (0, 1)
44-
layout.setRowStretch (0, 0)
45-
layout.setHorizontalSpacing(6)
42+
layout.addWidget(self.slider, 1, 0, 1, 1)
43+
44+
self.setStyleSheet(stylesheet(self))
4645

4746
#self.createPopup()
4847

@@ -90,6 +89,7 @@ def popup2(self, pos):
9089
contextmenu.addAction("Load Video (o)", self.handleButton)
9190
contextmenu.addAction("Toggle Slider (s)", self.toggleSlider)
9291
contextmenu.addSeparator()
92+
contextmenu.addAction("Fullscreen (f)", self.handleFullscreen)
9393
contextmenu.addAction("Information (i)", self.handleInfo)
9494
contextmenu.addSeparator()
9595
contextmenu.addAction("Exit (q)", self.handleQuit)
@@ -100,7 +100,7 @@ def toggleSlider(self):
100100
self.slider.hide()
101101
else:
102102
self.slider.show()
103-
self.slider.setGeometry(10, self.frameGeometry().height() - 20, self.frameGeometry().width() - 20, 14)
103+
# self.slider.setGeometry(10, self.frameGeometry().height() - 10, self.frameGeometry().width() - 20, 10)
104104
self.slider.setFocus()
105105

106106
def handleInfo(self):
@@ -135,27 +135,28 @@ def loadFile(self):
135135
def mouseMoveEvent(self, event):
136136
if event.buttons() == Qt.LeftButton:
137137
self.move(event.globalPos() \
138-
- QPoint(self.frameGeometry().width() / 2, \
138+
- QtCore.QPoint(self.frameGeometry().width() / 2, \
139139
self.frameGeometry().height() / 2))
140140
event.accept()
141141

142142
def stylesheet(self):
143143
return """
144-
144+
QWidget
145+
{
146+
background: black;
147+
}
145148
Phonon--SeekSlider > QSlider::groove:horizontal
146149
{
147150
background: black;
148151
border: 1px solid #565656;
149-
height: 4px;
150-
border-radius: 0px;
152+
height: 6px;
151153
}
152154
153155
Phonon--SeekSlider > QSlider::sub-page:horizontal
154156
{
155157
background: blue;
156158
border: 1px solid #565656;
157-
height: 2px;
158-
border-radius: 0px;
159+
height: 3px;
159160
}
160161
"""
161162

0 commit comments

Comments
 (0)