Skip to content

Commit a63e313

Browse files
committed
button icons and new cmap icon fix
1 parent 0879d8c commit a63e313

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

plotpy/widgets/colormap/manager.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,13 @@ def __init__(
144144
self._cmap_choice.setIconSize(QC.QSize(LARGE_ICON_WIDTH, LARGE_ICON_HEIGHT))
145145
self._cmap_choice.setCurrentText(active_colormap)
146146

147-
new_btn = QW.QPushButton(_("Create new colormap") + "...")
147+
new_btn = QW.QPushButton(
148+
get_icon("edit_add.png"), _("Create new colormap") + "..."
149+
)
148150
new_btn.clicked.connect(self.new_colormap)
149-
self._del_btn = QW.QPushButton(_("Delete colormap") + "...")
151+
self._del_btn = QW.QPushButton(
152+
get_icon("delete.png"), _("Delete colormap") + "..."
153+
)
150154
is_custom_cmap = cmap_exists(active_colormap, CUSTOM_COLORMAPS)
151155
self._del_btn.setEnabled(is_custom_cmap)
152156
self._del_btn.clicked.connect(self.delete_colormap)
@@ -158,9 +162,7 @@ def __init__(
158162
select_gbox_layout.addWidget(self._cmap_choice)
159163
select_gbox_layout.addSpacing(10)
160164
select_gbox_layout.addWidget(new_btn)
161-
select_gbox_layout.addStretch(1)
162165
select_gbox_layout.addWidget(self._del_btn)
163-
select_gbox_layout.addStretch(1)
164166
select_gbox.setLayout(select_gbox_layout)
165167

166168
# Edit the selected colormap
@@ -368,7 +370,9 @@ def save_colormap(self, cmap: EditableColormap | None = None) -> bool:
368370
cmap.name = new_name
369371
add_cmap(cmap)
370372

371-
icon = build_icon_from_cmap(cmap)
373+
icon = build_icon_from_cmap(
374+
cmap, LARGE_ICON_WIDTH, LARGE_ICON_HEIGHT, LARGE_ICON_ORIENTATION, 1
375+
)
372376
if is_existing_custom_cmap:
373377
self._cmap_choice.setCurrentText(new_name)
374378
current_index = self._cmap_choice.currentIndex()

0 commit comments

Comments
 (0)