Skip to content

Commit

Permalink
Merge branch 'LinuxCNC:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
ElectronicsArchiver authored May 4, 2022
2 parents f76528c + f826bc6 commit 16242ba
Show file tree
Hide file tree
Showing 4 changed files with 820 additions and 408 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,42 @@
from PyQt5.QtCore import Qt
import popplerqt5

class PDFView(QtWidgets.QScrollArea):
def __init__(self, parent=None):
super(PDFView, self).__init__(parent)
self.setWidgetResizable(True)

self.widget = QtWidgets.QWidget()
self.setWidget(self.widget)
self.vbox = QtWidgets.QVBoxLayout()
self.widget.setLayout(self.vbox)


def loadView(self, path):
filename = os.path.expanduser(path)
if not os.path.exists(filename):
print('No path:',filename)

doc = popplerqt5.Poppler.Document.load(filename)
doc.setRenderHint(popplerqt5.Poppler.Document.Antialiasing)
doc.setRenderHint(popplerqt5.Poppler.Document.TextAntialiasing)

# clear layout of pages
for i in reversed(range(self.vbox.count())):
self.vbox.itemAt(i).widget().setParent(None)

# convert pages to images in a label
for i in range(0,doc.numPages()):
label = QtWidgets.QLabel()
label.setScaledContents(True)

page = doc.page(i)
image = page.renderToImage()

label.setPixmap(QtGui.QPixmap.fromImage(image))
self.vbox.addWidget(label)


def pdf_view(filename):
"""Return a Scrollarea showing the pages of the specified PDF file."""
filename = os.path.expanduser(filename)
Expand Down
321 changes: 321 additions & 0 deletions share/qtvcp/screens/qtdragon/brushed_metal_color.qss
Original file line number Diff line number Diff line change
@@ -0,0 +1,321 @@
QMainWindow {
background-image: url(:/images/images/brushed_metal.png);
}

QPushButton,
ActionButton,
SystemToolButton,
AxisToolButton {
border: 2px solid black;
border-radius: 4px;
font: 10pt "Lato Heavy";
background: rgb(140, 140, 140,120);
}

QPushButton:checked,
QPushButton:pressed {
border-color: blue;
color: #0000FF;
}


QPushButton:hover,
ActionButton:hover,
SystemToolButton:hover,
AxisToolButton:hover {
border: 2px solid blue;

}

QPushButton:disabled,
ActionButton:disabled {
color: gray;
}

ActionButton#action_machine_on {
color: #FF0000;
}

ActionButton#x_plus_jogbutton,
ActionButton#x_minus_jogbutton {
border-radius: 4px;
background: rgb(80, 255, 80,120);

}

ActionButton#y_plus_jogbutton,
ActionButton#y_minus_jogbutton {
border-radius: 4px;
background: rgb(255, 80, 80,120);

}
ActionButton#z_plus_jogbutton,
ActionButton#z_minus_jogbutton {
border-radius: 4px;
background: rgb(80, 80, 255,120);

}
ActionButton#a_plus_jogbutton,
ActionButton#a_minus_jogbutton {
border-radius: 4px;
background: rgb(60, 60, 60,120);

}
ActionButton#action_machine_on[isStateOn=true] {
color: #00FF00;
}

ActionButton#action_estop {
color: #00FF00;
}

ActionButton#action_estop:checked {
color: #FF0000;
}

QLabel {
font: 10pt "Lato Heavy";
color: black;
}

QLabel#lbl_jog_angular{
font: 18pt "Lato Heavy";
color: black;
}

QLabel#label_axis_x {
border: 2px solid black;
border-radius: 4px;
font: 20pt "Lato Heavy";
color: rgb(80, 255, 80);
background: rgb(150, 150, 150,120);
}

QLabel#label_axis_y {
border: 2px solid black;
border-radius: 4px;
font: 20pt "Lato Heavy";
color: rgb(255, 80, 80);
background: rgb(150, 150, 150,120);
}

QLabel#label_axis_z {
border: 2px solid black;
border-radius: 4px;
font: 20pt "Lato Heavy";
color: rgb(80, 80, 255);
background: rgb(150, 150, 150,120);
}

QLabel#label_axis_a {
border: 2px solid black;
border-radius: 4px;
font: 20pt "Lato Heavy";
color: rgb(60, 60, 60);
background: rgb(150, 150, 150,120);
}


QLabel#lbl_cycle_start,
QLabel#lbl_home_all {
font: 10pt "Lato Heavy";
}

StatusLabel,
StateLabel {
background: rgb(250, 250, 250);
border: 1px solid;
border-left-color: black;
border-top-color: black;
border-right-color: white;
border-bottom-color: white;
font: 10pt "Lato Heavy";
color: black;
border-radius: 3px;
}

StatusLabel#status_rpm,
Label {
background: rgb(250, 250, 250);
border: 1px solid;
border-left-color: black;
border-top-color: black;
border-right-color: white;
border-bottom-color: white;
font: 20pt "Lato Heavy";
color: black;
border-radius: 3px;
}

DROLabel {
background: #202020;
border: 1px solid black;
border-radius: 4px;
font: 20pt "Lato Heavy";
color: #00FF00;
}

DROLabel[isHomed=false] {
color: red;
}

QLineEdit {
background: rgb(250, 250, 250);
border: 1px solid;
border-left-color: black;
border-top-color: black;
border-right-color: white;
border-bottom-color: white;
font: 10pt "Lato Heavy";
border-radius: 4px;
}

QTextEdit {
background: rgb(250,250,250);
font: 10pt "Lato";
border-radius: 4px;
}

QCheckBox {
font: 10pt "Lato Heavy";
}


QCheckBox::indicator {
width: 12px;
height: 12px;
}

QComboBox {
border: 1px solid black;
min-width: 120px;
font: 10pt "Lato Heavy";
color: black;
}

QGroupBox {
border: 1px solid black;
border-radius: 4px;
margin-top: 16px;
font: 10pt "Lato Heavy";
}

QGroupBox::title {
subcontrol-origin: margin;
padding: 0 3px;
color: black;
}

QProgressBar {
background-color: rgb(250, 250, 250);
border: 1px solid black;
border-radius: 4px;
font: 9 pt "Lato Heavy";
}

QProgressBar::chunk {
background: qlineargradient(x1: 0, y1: 0.2, x2: 1, y2: 1,
stop: 0 #bbf, stop: 1 #55f);
}

.QFrame {
}

QFrame#frame_cycle_start,
QFrame#frame_home_all {
border: 2px solid black;
border-radius:4px;
font: 10pt "Lato Heavy";
}

QFrame#frame_cycle_start:hover,
QFrame#frame_home_all:hover {
border: 2px solid blue;
}

QHeaderView {
background-color: #B0B0D0;
border: 0px transparent #32414B;
padding: 0px;
margin: 0px;
border-radius: 0px;
font: 10pt "Lato Heavy";
}

QHeaderView::section::vertical::first,
QHeaderView::section::vertical::only-one {
width: 60px;
}

OriginOffsetView, ToolOffsetView {
font: 10pt "Lato Heavy";
}

QSlider::groove:horizontal {
border: 1px black;
height: 12px;
}

QSlider::groove:vertical {
border: 1px black;
width: 12px;
}

QSlider::sub-page:horizontal {
background: qlineargradient(x1: 0, y1: 0.8, x2: 1, y2: 1,
stop: 0 #bbf stop: 1 #55f);
border: 1px solid #777;
border-radius: 3px;
height: 12px;
}

QSlider::add-page:horizontal {
background-color: rgb(120, 120, 120);
border: 1px solid #777;
border-radius: 3px;
width: 12px;
}

QSlider::add-page:vertical {
background: qlineargradient(x1: 0, y: 0.8, x2: 1, y2: 1,
stop: 0 #bbf, stop: 1 #55f);
border: 1px solid #777;
border-radius: 3px;
height: 12px;
}

QSlider::sub-page:vertical {
background-color: rgb(120, 120, 120);
border: 1px solid #777;
border-radius: 3px;
width: 12px;
}

QSlider::handle:horizontal {
background: lightgray;
border: 1px solid black;
width: 14px;
margin-top: -4px;
margin-bottom: -4px;
border-radius: 2px;
}

QSlider::handle:vertical {
background: lightgray;
border: 1px solid black;
height: 14px;
margin-left: -4px;
margin-right: -4px;
border-radius: 2px;
}
QDialog{
background-image: url(:/images/images/brushed_metal.png);
}
ToolDialog QPushButton{
width: 100px;
height: 40px;
}
EntryDialog QPushButton, CloseDialog QPushButton{
width: 80px;
height: 40px;
}
Loading

0 comments on commit 16242ba

Please sign in to comment.