Skip to content

Commit

Permalink
Merge pull request #124 from dynobo/dev
Browse files Browse the repository at this point in the history
Switch to icon for settings
  • Loading branch information
dynobo authored Jul 15, 2021
2 parents 88047ad + 4563cc6 commit 167031f
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 21 deletions.
63 changes: 63 additions & 0 deletions assets/icons/settings.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 4 additions & 19 deletions src/normcap/gui/settings_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,33 +181,18 @@ def create_button(window: QtWidgets.QMainWindow) -> QtWidgets.QToolButton:

button = QtWidgets.QToolButton(window.ui.top_right_frame)
button.setFixedSize(38, 38)
button.setToolButtonStyle(QtCore.Qt.ToolButtonTextOnly)
button.setStyleSheet(
"""
QToolButton::menu-indicator {
image: none;
}
QToolButton {
text-align: center;
color: red;
padding-top: 2px;
}
"""
)
button.setToolButtonStyle(QtCore.Qt.ToolButtonIconOnly)

# Move Button down on macOS as workaround for not being
# visible behind the menu bar
if window.system_info.platform == Platform.MACOS:
button.move(0, 20)

font = QtGui.QFont()
font.setPixelSize(32)
font.setBold(True)
button.setFont(font)
button.setText("⚙")

button.setIcon(window.get_icon("settings.png"))
button.setIconSize(QtCore.QSize(24, 24))
button.setPopupMode(QtWidgets.QToolButton.InstantPopup)
button.setCursor(QtCore.Qt.ArrowCursor)

return button


Expand Down
2 changes: 1 addition & 1 deletion src/normcap/resources/base_window.ui
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
<property name="minimumSize">
<size>
<width>38</width>
<height>68</height>
<height>72</height>
</size>
</property>
<property name="styleSheet">
Expand Down
Binary file added src/normcap/resources/settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/normcap/window_base_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def setupUi(self, BaseWindow):

self.top_right_frame = QFrame(self.frame)
self.top_right_frame.setObjectName(u"top_right_frame")
self.top_right_frame.setMinimumSize(QSize(38, 68))
self.top_right_frame.setMinimumSize(QSize(38, 72))
self.top_right_frame.setStyleSheet(u"border:none;")
self.top_right_frame.setFrameShape(QFrame.StyledPanel)
self.top_right_frame.setFrameShadow(QFrame.Raised)
Expand Down

0 comments on commit 167031f

Please sign in to comment.