Skip to content

Conversation

dmperdue
Copy link
Contributor

Added the option for the bar to be right aligned. For anyone else like me who might use the bar at smaller width percentages and wanted the option to left, center, or right align it.

  • Updated BAR_DEFAULTS to use alignment: ['left', 'center', 'right']
  • Modified BAR_SCHEMA to validate the new alignment field
  • Refactored bar_pos() to calculate x-position for left/center/right
  • Added example config snippet to README demonstrating right alignment

Manually tested on Windows 11 Home
Version 23H2 (OS Build 22631.5335)
Screenshot 2025-05-27 180833

@amnweb
Copy link
Owner

amnweb commented May 28, 2025

This PR would break the config for all users and themes in Gallery. To avoid that, we need to keep center under alignment in the validation file. While we can consider removing it in a future version. Additionally, bar.py should still include support for center as I've seen many themes on Reddit using center: true

So validation should be like

'alignment': {
    'position': 'top',
    'center': False, # Deprecated
    'alignment': 'center'
},

@dmperdue
Copy link
Contributor Author

I totally forgot about backwards compatibility. Should hopefully not break anything now.

@amnweb
Copy link
Owner

amnweb commented May 29, 2025

OK cool, just please make sure everything is properly formatted before we merge this

        'alignment': {
        'position': 'top',
        'center':    False, # DEPRECATED
        'alignment': 'center'
    },

to

    'alignment': {
        'position': 'top',
        'center':    False, # DEPRECATED
        'alignment': 'center'
    },

Additionally, please update the documentation with the new options so we can include everything in this single PR.
Also, the default config file doesn't need to include both options, you can safely remove center: false from config.yaml. Since the new configuration format will support it, there’s no need to display deprecated entries.

Note:
Clean up the commit history, and then we can merge this into the main.

Added the option for the status bar to be right aligned. For anyone else like me who might use the bar at smaller width percentages and wanted the option to left, center, or right align it.

- Updated `BAR_DEFAULTS` to use `alignment: ['left', 'center', 'right']`
- Modified `BAR_SCHEMA` to validate the new `alignment` field
- Refactored `bar_pos()` to calculate x-position for left/center/right
- Deprecated "center" so older themes won't break
- Added new "alignment" description and notes to Configuration.md

Manually tested on Windows 11 Home
Version 23H2 (OS Build 22631.5335)
@dmperdue dmperdue force-pushed the add-right-alignment branch from 3abd9c8 to 3c7af70 Compare June 1, 2025 01:36
@amnweb amnweb merged commit 2b94486 into amnweb:main Jun 2, 2025
@amnweb
Copy link
Owner

amnweb commented Jun 2, 2025

I've reverted the changes — there are way too many issues with bar position in this PR, especially when there are multiple bars on multiple screens

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants