Skip to content

Commit

Permalink
Style button
Browse files Browse the repository at this point in the history
  • Loading branch information
goanpeca committed Aug 9, 2024
1 parent d020ebc commit f577d1e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
17 changes: 7 additions & 10 deletions napari_plugin_manager/qt_plugin_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -1193,31 +1193,28 @@ def _setup_ui(self):
self.direct_entry_edit.returnPressed.connect(self._install_packages)
self.direct_entry_edit.setVisible(visibility_direct_entry)
self.direct_entry_btn = QToolButton(self)
self.direct_entry_btn.setIcon(
QColoredSVGIcon.from_resources('logo_silhouette')
)
# self.direct_entry_btn = QPushButton(trans._("Install"), self)
self.direct_entry_btn.setVisible(visibility_direct_entry)
self.direct_entry_btn.clicked.connect(self._install_packages)
self.direct_entry_btn.setText(trans._("Install"))
self.direct_entry_btn.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)

if True:
# if IS_NAPARI_CONDA_INSTALLED:
self._menu = QMenu(self)
if IS_NAPARI_CONDA_INSTALLED:
self._action_conda = QAction(trans._('Conda'), self)
self._action_conda.setCheckable(True)
self._action_conda.setChecked(True)

self._action_pypi = QAction(trans._('PyPI'), self)
self._action_pypi.setCheckable(True)
self._action_conda.setChecked(True)
self._menu.addAction(self._action_conda)
self._menu.addAction(self._action_pypi)

self._action_group = QActionGroup(self)
self._action_group.addAction(self._action_pypi)
self._action_group.addAction(self._action_conda)
self._action_group.setExclusive(True)

self._menu = QMenu(self)
self._menu.addAction(self._action_conda)
self._menu.addAction(self._action_pypi)

self.direct_entry_btn.setMenu(self._menu)

self.show_status_btn = QPushButton(trans._("Show Status"), self)
Expand Down
11 changes: 11 additions & 0 deletions napari_plugin_manager/styles.qss
Original file line number Diff line number Diff line change
Expand Up @@ -350,3 +350,14 @@ QtLayerList::indicator:checked {
min-height: 36px;
min-width: 36px;
}

QToolButton {
background-color: {{ darken(foreground, 20) }};
color: {{ darken(text, 15) }};
padding: 4 15px;
font: 12px;
}

QToolButton:hover {
background-color: {{ lighten(foreground, 10) }}
}

0 comments on commit f577d1e

Please sign in to comment.