Changed to central asset organization.

This commit is contained in:
jupfi 2023-08-16 13:51:16 +02:00
parent 81d7982280
commit 00d70decb0
8 changed files with 9 additions and 12 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 286 B

View file

@ -7,6 +7,7 @@ from PyQt6.QtGui import QIcon
from PyQt6.QtWidgets import QMessageBox, QGroupBox, QFormLayout, QTableWidget, QVBoxLayout, QPushButton, QHBoxLayout, QLabel, QDialog, QLineEdit, QDialogButtonBox, QWidget, QCheckBox, QToolButton, QFileDialog, QSizePolicy from PyQt6.QtWidgets import QMessageBox, QGroupBox, QFormLayout, QTableWidget, QVBoxLayout, QPushButton, QHBoxLayout, QLabel, QDialog, QLineEdit, QDialogButtonBox, QWidget, QCheckBox, QToolButton, QFileDialog, QSizePolicy
from PyQt6.QtCore import pyqtSlot, pyqtSignal from PyQt6.QtCore import pyqtSlot, pyqtSignal
from nqrduck.module.module_view import ModuleView from nqrduck.module.module_view import ModuleView
from nqrduck.assets.icons import Logos
from nqrduck_spectrometer.pulseparameters import BooleanOption, NumericOption, FunctionOption from nqrduck_spectrometer.pulseparameters import BooleanOption, NumericOption, FunctionOption
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -43,8 +44,7 @@ class PulseProgrammerView(ModuleView):
# Add button for new event # Add button for new event
self.new_event_button = QPushButton("New event") self.new_event_button = QPushButton("New event")
# Add the New Icon to the button # Add the New Icon to the button
self_path = Path(__file__).parent icon = Logos.New16x16()
icon = QIcon(str(self_path / "resources/New_16x16.png"))
self.new_event_button.setIconSize(icon.availableSizes()[0]) self.new_event_button.setIconSize(icon.availableSizes()[0])
self.new_event_button.setIcon(icon) self.new_event_button.setIcon(icon)
self.new_event_button.clicked.connect(self.on_new_event_button_clicked) self.new_event_button.clicked.connect(self.on_new_event_button_clicked)
@ -54,8 +54,7 @@ class PulseProgrammerView(ModuleView):
self.save_pulse_sequence_button = QPushButton("Save pulse sequence") self.save_pulse_sequence_button = QPushButton("Save pulse sequence")
self.save_pulse_sequence_button.setSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed) self.save_pulse_sequence_button.setSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed)
# Add the Save Icon to the button # Add the Save Icon to the button
self_path = Path(__file__).parent icon = Logos.Save16x16()
icon = QIcon(str(self_path / "resources/Save_16x16.png"))
self.save_pulse_sequence_button.setIconSize(icon.availableSizes()[0]) self.save_pulse_sequence_button.setIconSize(icon.availableSizes()[0])
self.save_pulse_sequence_button.setIcon(icon) self.save_pulse_sequence_button.setIcon(icon)
self.save_pulse_sequence_button.clicked.connect(self.on_save_button_clicked) self.save_pulse_sequence_button.clicked.connect(self.on_save_button_clicked)
@ -64,7 +63,7 @@ class PulseProgrammerView(ModuleView):
# Add button for load pulse sequence # Add button for load pulse sequence
self.load_pulse_sequence_button = QPushButton("Load pulse sequence") self.load_pulse_sequence_button = QPushButton("Load pulse sequence")
# Add the Load Icon to the button # Add the Load Icon to the button
icon = QIcon(str(self_path / "resources/Load_16x16.png")) icon = Logos.Load16x16()
self.load_pulse_sequence_button.setIconSize(icon.availableSizes()[0]) self.load_pulse_sequence_button.setIconSize(icon.availableSizes()[0])
self.load_pulse_sequence_button.setIcon(icon) self.load_pulse_sequence_button.setIcon(icon)
self.load_pulse_sequence_button.clicked.connect(self.on_load_button_clicked) self.load_pulse_sequence_button.clicked.connect(self.on_load_button_clicked)
@ -160,7 +159,7 @@ class PulseProgrammerView(ModuleView):
logger.debug("Adding button for event %s and parameter %s", event, parameter) logger.debug("Adding button for event %s and parameter %s", event, parameter)
logger.debug("Parameter object id: %s", id(event.parameters[parameter])) logger.debug("Parameter object id: %s", id(event.parameters[parameter]))
button = QPushButton() button = QPushButton()
icon = QIcon(event.parameters[parameter].get_pixmap()) icon = event.parameters[parameter].get_pixmap()
logger.debug("Icon size: %s", icon.availableSizes()) logger.debug("Icon size: %s", icon.availableSizes())
button.setIcon(icon) button.setIcon(icon)
button.setIconSize(icon.availableSizes()[0]) button.setIconSize(icon.availableSizes()[0])
@ -222,13 +221,11 @@ class EventOptionsWidget(QWidget):
super().__init__() super().__init__()
self.event = event self.event = event
self_path = Path(__file__).parent
layout = QVBoxLayout() layout = QVBoxLayout()
upper_layout = QHBoxLayout() upper_layout = QHBoxLayout()
# Edit button # Edit button
self.edit_button = QToolButton() self.edit_button = QToolButton()
icon = QIcon(str(self_path / "resources/Pen_12x12.png")) icon = Logos.Pen12x12()
self.edit_button.setIcon(icon) self.edit_button.setIcon(icon)
self.edit_button.setIconSize(icon.availableSizes()[0]) self.edit_button.setIconSize(icon.availableSizes()[0])
self.edit_button.setFixedSize(icon.availableSizes()[0]) self.edit_button.setFixedSize(icon.availableSizes()[0])
@ -236,7 +233,7 @@ class EventOptionsWidget(QWidget):
# Delete button # Delete button
self.delete_button = QToolButton() self.delete_button = QToolButton()
icon = QIcon(str(self_path / "resources/Garbage_12x12.png")) icon = Logos.Garbage12x12()
self.delete_button.setIcon(icon) self.delete_button.setIcon(icon)
self.delete_button.setIconSize(icon.availableSizes()[0]) self.delete_button.setIconSize(icon.availableSizes()[0])
self.delete_button.setFixedSize(icon.availableSizes()[0]) self.delete_button.setFixedSize(icon.availableSizes()[0])
@ -248,7 +245,7 @@ class EventOptionsWidget(QWidget):
lower_layout = QHBoxLayout() lower_layout = QHBoxLayout()
# Move left button # Move left button
self.move_left_button = QToolButton() self.move_left_button = QToolButton()
icon = QIcon(str(self_path / "resources/ArrowLeft_12x12.png")) icon = Logos.ArrowLeft12x12()
self.move_left_button.setIcon(icon) self.move_left_button.setIcon(icon)
self.move_left_button.setIconSize(icon.availableSizes()[0]) self.move_left_button.setIconSize(icon.availableSizes()[0])
self.move_left_button.setFixedSize(icon.availableSizes()[0]) self.move_left_button.setFixedSize(icon.availableSizes()[0])
@ -256,7 +253,7 @@ class EventOptionsWidget(QWidget):
# Move right button # Move right button
self.move_right_button = QToolButton() self.move_right_button = QToolButton()
icon = QIcon(str(self_path / "resources/ArrowRight_12x12.png")) icon = Logos.ArrowRight12x12()
self.move_right_button.setIcon(icon) self.move_right_button.setIcon(icon)
self.move_right_button.setIconSize(icon.availableSizes()[0]) self.move_right_button.setIconSize(icon.availableSizes()[0])
self.move_right_button.setFixedSize(icon.availableSizes()[0]) self.move_right_button.setFixedSize(icon.availableSizes()[0])