Skip to content

Add "Center Two Thirds" action#1617

Merged
rxhanson merged 3 commits intorxhanson:mainfrom
savin000:add-center-two-thirds-action
Jul 15, 2025
Merged

Add "Center Two Thirds" action#1617
rxhanson merged 3 commits intorxhanson:mainfrom
savin000:add-center-two-thirds-action

Conversation

@savin000
Copy link
Contributor

@savin000 savin000 commented Jul 14, 2025

Hi! I use a 34-inch ultrawide monitor (HUAWEI MateView GT ZQE-CBA), and having a shortcut to limit the screen space like working on a 27-inch display helps me stay focused. In the expanding world of ultrawide monitors, this kind of mode is quickly becoming a must-have.

@savin000 savin000 changed the title Add center two thirds action Add "Center Two Thirds" action Jul 14, 2025
@savin000
Copy link
Contributor Author

savin000 commented Jul 14, 2025

Edited UI Layout:

image image

@rxhanson
Copy link
Owner

Thanks for contributing! This looks great; the only thing that I have hesitation on is automatically adding a default shortcut, despite it being an obvious choice. There's potential for frustration for people that have configured that shortcut to something else prior to updating Rectangle. In scenarios like this in my other apps, I would typically make it a default for new installs of the app, but not updates. Here in Rectangle, there's not already a great mechanism in place for this scenario. I'm fine going ahead and merging this in and making the change myself to do this, or you can add it if desired and I'll hold off on merging if you want to make it part of this PR.

@savin000
Copy link
Contributor Author

I will try to implement this

@savin000
Copy link
Contributor Author

savin000 commented Jul 15, 2025

Since you already have a similar mechanism in other apps, it might be easier for you to implement this on your side. The only approach I’ve come up with is checking the version using something like this:

private func isNewInstall() -> Bool {
        let defaults = UserDefaults.standard
        let versionKey = "app_version"
        let currentVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String

        if defaults.string(forKey: versionKey) == nil || defaults.string(forKey: versionKey) != currentVersion {
            defaults.set(currentVersion, forKey: versionKey)
            return true
        }

        return false
    }

But to me, it feels a bit clunky. I’m not quite sure how to integrate this with the shortcut logic, as I don’t have much experience with macOS development.

@rxhanson
Copy link
Owner

Thanks for taking a look at implementing it. I'll plan on adding the new install check :)

@rxhanson rxhanson merged commit 8ae72a2 into rxhanson:main Jul 15, 2025
1 check passed
liangyuetian added a commit to liangyuetian/Rectangle.For.Windows that referenced this pull request Mar 19, 2026
* feature: add "Center Two Thirds" action

* feature: add en, en-GB, ru localizations for "Center Two Thirds" action

* feature: add icon for "Center Two Thirds" action
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