Skip to content

feat: add configurable vertical position setting - #1

Open
MdTanjeemHaider wants to merge 1 commit into
YashvardhanG:mainfrom
MdTanjeemHaider:feat/configurable-window-vertical-position
Open

feat: add configurable vertical position setting#1
MdTanjeemHaider wants to merge 1 commit into
YashvardhanG:mainfrom
MdTanjeemHaider:feat/configurable-window-vertical-position

Conversation

@MdTanjeemHaider

Copy link
Copy Markdown

What

The launcher window was always placed at a hardcoded physical y=100 regardless
of screen resolution. Monitors with different resolution put the window in odd locations at times.

This PR replaces the hardcoded value with a user-configurable "Vertical Position" setting (default: 30% from top, range: 5–85%).

Changes

  • src-tauri/src/main.rs

    • Added WINDOW_Y_PERCENT static (default 30).
    • Added compute_window_y_phys(). This calculates physical pixel offset from monitor height × percentage.
    • Added get_window_y_percent Tauri command.
    • Added set_window_y_percent Tauri command. The setter saves to settings.json and immediately repositions the window for live preview.
    • show_main_window and reset_window both use compute_window_y_phys against the monitor the cursor is currently on.
  • src/index.html

    • New settings row with a range slider.
  • src/main.js

    • Loads saved value at startup, live-updates on drag, resets to 30% when "Reset Settings" is clicked.

Tested on

  • 1920x1080
  • 1920x1200 (Set to vertical mode)

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.

1 participant