Changeset View
Changeset View
Standalone View
Standalone View
plugins/extensions/pykrita/plugin/plugins/colorspace/uicolorspace.py
1 | from colorspace import colorspacedialog | 1 | from colorspace import colorspacedialog | ||
---|---|---|---|---|---|
2 | from colorspace.components import colormodelcombobox, colordepthcombobox, colorprofilecombobox | 2 | from colorspace.components import colormodelcombobox, colordepthcombobox, colorprofilecombobox | ||
3 | from PyQt5.QtCore import Qt | 3 | from PyQt5.QtCore import Qt | ||
4 | from PyQt5.QtWidgets import (QFormLayout, QListWidget, QListWidgetItem, | 4 | from PyQt5.QtWidgets import (QFormLayout, QListWidget, QListWidgetItem, | ||
5 | QAbstractItemView, QComboBox, QDialogButtonBox, | 5 | QAbstractItemView, QComboBox, QDialogButtonBox, | ||
6 | QVBoxLayout, QFrame, QMessageBox, QPushButton, | 6 | QVBoxLayout, QFrame, QMessageBox, QPushButton, | ||
7 | QHBoxLayout) | 7 | QHBoxLayout, QAbstractScrollArea) | ||
8 | from PyQt5.QtGui import QIcon | 8 | from PyQt5.QtGui import QIcon | ||
9 | import krita | 9 | import krita | ||
10 | from colorspace import resources_rc | 10 | from colorspace import resources_rc | ||
11 | 11 | | |||
12 | 12 | | |||
13 | class UIColorSpace(object): | 13 | class UIColorSpace(object): | ||
14 | | ||||
14 | def __init__(self): | 15 | def __init__(self): | ||
15 | self.mainDialog = colorspacedialog.ColorSpaceDialog() | 16 | self.mainDialog = colorspacedialog.ColorSpaceDialog() | ||
16 | self.mainLayout = QVBoxLayout(self.mainDialog) | 17 | self.mainLayout = QVBoxLayout(self.mainDialog) | ||
17 | self.formLayout = QFormLayout() | 18 | self.formLayout = QFormLayout() | ||
18 | self.documentLayout = QVBoxLayout() | 19 | self.documentLayout = QVBoxLayout() | ||
19 | self.refreshButton = QPushButton(QIcon(':/icons/refresh.svg'), "Refresh") | 20 | self.refreshButton = QPushButton(QIcon(':/icons/refresh.svg'), "Refresh") | ||
20 | self.widgetDocuments = QListWidget() | 21 | self.widgetDocuments = QListWidget() | ||
21 | self.colorModelComboBox = colormodelcombobox.ColorModelComboBox(self) | 22 | self.colorModelComboBox = colormodelcombobox.ColorModelComboBox(self) | ||
22 | self.colorDepthComboBox = colordepthcombobox.ColorDepthComboBox(self) | 23 | self.colorDepthComboBox = colordepthcombobox.ColorDepthComboBox(self) | ||
23 | self.colorProfileComboBox = colorprofilecombobox.ColorProfileComboBox(self) | 24 | self.colorProfileComboBox = colorprofilecombobox.ColorProfileComboBox(self) | ||
24 | self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel) | 25 | self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel) | ||
25 | 26 | | |||
26 | self.kritaInstance = krita.Krita.instance() | 27 | self.kritaInstance = krita.Krita.instance() | ||
27 | self.documentsList = [] | 28 | self.documentsList = [] | ||
28 | self.colorModelsList = [] | 29 | self.colorModelsList = [] | ||
29 | self.colorDepthsList = [] | 30 | self.colorDepthsList = [] | ||
30 | self.colorProfilesList = [] | 31 | self.colorProfilesList = [] | ||
31 | 32 | | |||
32 | self.refreshButton.clicked.connect(self.refreshButtonClicked) | 33 | self.refreshButton.clicked.connect(self.refreshButtonClicked) | ||
33 | self.buttonBox.accepted.connect(self.confirmButton) | 34 | self.buttonBox.accepted.connect(self.confirmButton) | ||
34 | self.buttonBox.rejected.connect(self.mainDialog.close) | 35 | self.buttonBox.rejected.connect(self.mainDialog.close) | ||
35 | 36 | | |||
36 | self.mainDialog.setWindowModality(Qt.NonModal) | 37 | self.mainDialog.setWindowModality(Qt.NonModal) | ||
37 | self.widgetDocuments.setSelectionMode(QAbstractItemView.MultiSelection) | 38 | self.widgetDocuments.setSelectionMode(QAbstractItemView.MultiSelection) | ||
39 | self.widgetDocuments.setSizeAdjustPolicy(QAbstractScrollArea.AdjustToContents) | ||||
38 | 40 | | |||
39 | def initialize(self): | 41 | def initialize(self): | ||
40 | self.loadDocuments() | 42 | self.loadDocuments() | ||
41 | self.loadColorModels() | 43 | self.loadColorModels() | ||
42 | self.loadColorDepths() | 44 | self.loadColorDepths() | ||
43 | self.loadColorProfiles() | 45 | self.loadColorProfiles() | ||
44 | 46 | | |||
45 | self.documentLayout.addWidget(self.widgetDocuments) | 47 | self.documentLayout.addWidget(self.widgetDocuments) | ||
▲ Show 20 Lines • Show All 72 Lines • Show Last 20 Lines |