Skip to content

Commit

Permalink
Tool bar button styling
Browse files Browse the repository at this point in the history
  • Loading branch information
sam210723 committed Mar 2, 2024
1 parent 6d0eb2b commit 0e2c88d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions wavebin/interface/toolbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,28 +72,28 @@ def __init__(self, app: QApplication) -> None:
}

# Build tool bar
for t in self.items:
for i in self.items:
# Insert toolbar separators
if self.items[t] == None:
if self.items[i] == None:
self.insertSeparator(None)
continue

# Get icon from Font Awesome
icon = qta.icon(
f"fa5s.{self.items[t][1]}",
f"fa5s.{self.items[i][1]}",
color="#FFF",
color_active="#AAA"
color_active="#444"
)

# Build action object
action = QAction(self)
action.setIcon(icon)
action.setText(self.items[t][0])
action.triggered.connect(eval(f"self.button_{t}"))
action.setText(self.items[i][0])
action.triggered.connect(eval(f"self.button_{i}"))
self.addAction(action)

# Replace list in dict with QAction instance
self.items[t] = action
self.items[i] = action

# Set default button states
self.items['export'].setEnabled(False)
Expand Down

0 comments on commit 0e2c88d

Please sign in to comment.