mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
drop data renamed to drop empty
This commit is contained in:
parent
0ff2f9efdd
commit
da3214fafe
2 changed files with 52 additions and 34 deletions
|
|
@ -1,34 +0,0 @@
|
|||
import os
|
||||
import logging
|
||||
import clique
|
||||
from . import QtWidgets, QtCore, QtGui
|
||||
|
||||
|
||||
class DropDataWidget(QtWidgets.QWidget):
|
||||
|
||||
def __init__(self, parent):
|
||||
'''Initialise DataDropZone widget.'''
|
||||
super().__init__(parent)
|
||||
|
||||
layout = QtWidgets.QVBoxLayout(self)
|
||||
|
||||
CenterAlignment = QtCore.Qt.AlignVCenter | QtCore.Qt.AlignHCenter
|
||||
|
||||
self._label = QtWidgets.QLabel('Drop files here')
|
||||
layout.addWidget(
|
||||
self._label,
|
||||
alignment=CenterAlignment
|
||||
)
|
||||
|
||||
def paintEvent(self, event):
|
||||
super().paintEvent(event)
|
||||
painter = QtGui.QPainter(self)
|
||||
pen = QtGui.QPen()
|
||||
pen.setWidth(1);
|
||||
pen.setBrush(QtCore.Qt.darkGray);
|
||||
pen.setStyle(QtCore.Qt.DashLine);
|
||||
painter.setPen(pen)
|
||||
painter.drawRect(
|
||||
10, 10,
|
||||
self.rect().width()-15, self.rect().height()-15
|
||||
)
|
||||
52
pype/tools/standalonepublish/widgets/widget_drop_empty.py
Normal file
52
pype/tools/standalonepublish/widgets/widget_drop_empty.py
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
import os
|
||||
import logging
|
||||
import clique
|
||||
from . import QtWidgets, QtCore, QtGui
|
||||
|
||||
|
||||
class DropEmpty(QtWidgets.QWidget):
|
||||
|
||||
def __init__(self, parent):
|
||||
'''Initialise DataDropZone widget.'''
|
||||
super().__init__(parent)
|
||||
|
||||
layout = QtWidgets.QVBoxLayout(self)
|
||||
|
||||
BottomCenterAlignment = QtCore.Qt.AlignBottom | QtCore.Qt.AlignHCenter
|
||||
TopCenterAlignment = QtCore.Qt.AlignTop | QtCore.Qt.AlignHCenter
|
||||
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("DejaVu Sans Condensed")
|
||||
font.setPointSize(26)
|
||||
font.setBold(True)
|
||||
font.setWeight(50)
|
||||
font.setKerning(True)
|
||||
|
||||
self._label = QtWidgets.QLabel('Drag & Drop')
|
||||
self._label.setFont(font)
|
||||
self._label.setStyleSheet(
|
||||
'background-color: rgb(255, 255, 255, 0);'
|
||||
)
|
||||
|
||||
font.setPointSize(12)
|
||||
self._sub_label = QtWidgets.QLabel('(drop files here)')
|
||||
self._sub_label.setFont(font)
|
||||
self._sub_label.setStyleSheet(
|
||||
'background-color: rgb(255, 255, 255, 0);'
|
||||
)
|
||||
|
||||
layout.addWidget(self._label, alignment=BottomCenterAlignment)
|
||||
layout.addWidget(self._sub_label, alignment=TopCenterAlignment)
|
||||
|
||||
def paintEvent(self, event):
|
||||
super().paintEvent(event)
|
||||
painter = QtGui.QPainter(self)
|
||||
pen = QtGui.QPen()
|
||||
pen.setWidth(1);
|
||||
pen.setBrush(QtCore.Qt.darkGray);
|
||||
pen.setStyle(QtCore.Qt.DashLine);
|
||||
painter.setPen(pen)
|
||||
painter.drawRect(
|
||||
10, 10,
|
||||
self.rect().width()-15, self.rect().height()-15
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue