feat: Add alignment property to labels and implement touch bar background by designgears · Pull Request #510 · StreamController/StreamController · GitHub
Skip to content

feat: Add alignment property to labels and implement touch bar background#510

Merged
Core447 merged 2 commits into
StreamController:mainfrom
designgears:enhancements
Dec 30, 2025
Merged

feat: Add alignment property to labels and implement touch bar background#510
Core447 merged 2 commits into
StreamController:mainfrom
designgears:enhancements

Conversation

@designgears

@designgears designgears commented Dec 29, 2025

Copy link
Copy Markdown
Contributor

Pull Request: Add Label Alignment & Touchbar Background Image Support

🎯 Summary

This PR introduces two key features:

  1. Label Alignment Control - Users can now align key/dial labels to left, center, or right
  2. Touchbar Background Images - Full support for custom background images on Stream Deck Plus touchbars

✨ Features

Label Alignment Property

Adds horizontal text alignment options for key labels, giving users more control over label positioning.

Changes:

  • Added alignment field to KeyLabel dataclass with values: "left", "center", "right"
  • New AlignmentButtons widget in the Label Editor with intuitive toggle buttons
  • Text rendering now respects alignment when positioning labels
  • Alignment is composable (page → action) and supports reset to default

UI:

Component Description
Left button format-justify-left-symbolic icon
Center button format-justify-center-symbolic icon
Right button format-justify-right-symbolic icon

Touchbar Background Image Handling

Enables users to set custom background images for the Stream Deck Plus touchbar/touchscreen.

Changes:

  • New ImageRow in BackgroundEditor for touchscreen inputs
  • Image selection via asset chooser with preview thumbnail
  • Background images are resized to exact touchscreen dimensions
  • Supports layering: background image → background color overlay → dial images
  • Clear button to remove background image

📁 Files Changed

File Changes
src/backend/DeckManagement/Subclasses/KeyLabel.py Added alignment property
src/backend/DeckManagement/DeckController.py Label alignment rendering, touchscreen background image loading
src/backend/PageManagement/Page.py Added set_label_alignment(), get_background_image(), set_background_image()
src/windows/mainWindow/elements/Sidebar/elements/LabelEditor.py New AlignmentButtons widget and handlers
src/windows/mainWindow/elements/Sidebar/elements/BackgroundEditor.py New ImageRow for touchscreen backgrounds
src/windows/mainWindow/elements/Sidebar/elements/ScreenEditor.py Added BackgroundEditor to touchscreen sidebar

🔧 Technical Details

Label Alignment Logic:

  • Alignment affects both text anchor point and x-position calculation
  • Left alignment uses padding from left edge
  • Right alignment uses padding from right edge
  • Center alignment (default) centers text horizontally

Background Image Compositing Order:

  1. Load background image (if set) → resize to touchscreen dimensions
  2. Apply background color overlay (if alpha > 0)
  3. Composite dial images on top

🧪 Testing

  • Test label alignment on keys (left/center/right)
  • Test label alignment on dials
  • Test alignment persistence across page reloads
  • Test alignment reset button functionality
  • Test touchbar background image selection
  • Test touchbar background image with color overlay
  • Test touchbar background image clear functionality
  • Test that ImageRow only appears for touchscreen inputs

📝 Notes

  • Default alignment is "center" (backwards compatible)
  • Alignment UI is hidden when label text is empty
  • Background image support is exclusive to touchscreen inputs (Stream Deck Plus)

image image image image image image

…es in DeckController and BackgroundVideoCache
@ImDevinC

Copy link
Copy Markdown
Contributor

This looks good to me, but I'm not super familiar with this area of the code, so hopefully @Core447 can chime in

@Core447

Core447 commented Dec 30, 2025

Copy link
Copy Markdown
Member

@Core447 Core447 merged commit c43c715 into StreamController:main Dec 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants