Skip to content

Commit

Permalink
Control type styling moved to css. Device icon changed to black
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexeh committed Feb 29, 2024
1 parent 5772b06 commit 2af5c78
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 deletions.
19 changes: 6 additions & 13 deletions joystick_diagrams/ui/configure_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def __init__(self, *args, **kwargs):
# Icons
self.device_icon = qta.icon(
"fa5s.gamepad",
color="white",
color="#120303",
)

self.initialise_available_profiles()
Expand Down Expand Up @@ -120,33 +120,26 @@ def initialise_customise_binds(self):
def create_control_type_widget(self, control: Axis | Button | Hat | AxisSlider):
if isinstance(control, Axis):
ctrl = QLabel("Axis")
ctrl.setStyleSheet(
"background:#2980b9;color:white;max-width:100px;max-height:20px"
)
ctrl.setProperty("class", "device-control-pill axis")
return ctrl

if isinstance(control, Button):
ctrl = QLabel("Button")
ctrl.setStyleSheet(
"background:#16a085;color:white;max-width:100px;max-height:20px"
)
ctrl.setProperty("class", "device-control-pill button")
return ctrl

if isinstance(control, Hat):
ctrl = QLabel("Hat")
ctrl.setStyleSheet(
"background:#2c3e50;color:white;max-width:100px;max-height:20px"
)
ctrl.setProperty("class", "device-control-pill hat")
return ctrl

if isinstance(control, AxisSlider):
ctrl = QLabel("Slider")
ctrl.setStyleSheet(
"background:#2980b9;color:white;max-width:100px;max-height:20px"
)
ctrl.setProperty("class", "device-control-pill axis")
return ctrl

ctrl = QLabel("UNKNOWN")
ctrl.setProperty("class", "device-control-pill")
ctrl.setStyleSheet("background:orange;max-width:30px")
return ctrl

Expand Down
18 changes: 18 additions & 0 deletions theme/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,24 @@ QTreeWidget.view-binds-tree QHeaderView::section {{
background-color: #D8DBE2;
}}

QLabel.device-control-pill {{

}}

QLabel.device-control-pill.button {{
background:#16a085;
}}

QLabel.device-control-pill.hat {{
background:#2c3e50;
}}

QLabel.device-control-pill.axis {{
background:#2980b9;
}}




/* Export Styling */

Expand Down

0 comments on commit 2af5c78

Please sign in to comment.