Skip to content

✨ Add Maximize Height#584

Closed
Ender-Wang wants to merge 5 commits into
mrkai77:developfrom
Ender-Wang:develop
Closed

✨ Add Maximize Height#584
Ender-Wang wants to merge 5 commits into
mrkai77:developfrom
Ender-Wang:develop

Conversation

@Ender-Wang

Copy link
Copy Markdown
  • As discussed in ✨ Max Height without Modifying Width #503
  • I see it's not that easy, since all window resizing actions are matched to screen x&y coordinates and with width&height proportional to it, not sure if what I did here is enough, or if I need to handle the nil value in .init somewhere else.
  • Feel free to leave some suggestions & comments, as I did not really know swift, but had a look on ✨ Add horizontal/vertical center half #577

@Ender-Wang Ender-Wang changed the title add Maximize Height ✨ add Maximize Height Oct 1, 2024
@mrkai77

mrkai77 commented Oct 15, 2024

Copy link
Copy Markdown
Owner

Hey sorry for the late response! I actually don't think that you can put a nil inside a CGRect. Either way, I believe that the best approach to this would be to manually handle it inside WindowAction's calculateTargetFrame(). Let me know if you'd like help with that :)

@Ender-Wang

Copy link
Copy Markdown
Author

@mrkai77 Hi, thanks for the update, I added a function to get the max height and set it in the calculateTargetFrame() func, but I am not sure what window.size refers to, is it the application's window size or the current display resolution? bounds seems to be ratio not application window size in pixels.

@mrkai77

mrkai77 commented Oct 17, 2024

Copy link
Copy Markdown
Owner

window.size refers to the selected window's size, bounds will refer to the screen size or just a 1x1 frame depending on the context. The 1x1 frame will be used for the little icons in the keybinds tab.

@Ender-Wang

Copy link
Copy Markdown
Author

@mrkai77 Got err when trying to build with cmd + R: /Loop/Loop/Window Management/WindowAction+Image.swift:90:39 Cannot find 'LuminareConstants' in scope, any hints?

@SenpaiHunters

Copy link
Copy Markdown
Collaborator

This has to do with Luminare, it needs to conform to Luminares package requirements of constants. Ensure all packages are up-to-date, and you're working on the newest branch.

@SenpaiHunters SenpaiHunters changed the title ✨ add Maximize Height ✨ Add Maximize Height Oct 19, 2024
@Ender-Wang

Ender-Wang commented Oct 19, 2024

Copy link
Copy Markdown
Author

@mrkai77 Thanks, I got the idea of .init(x: 0.5 / 10.0, y: 0.5 / 10.0, width: 9.0 / 10.0, height: 1), but seems i can only set the target window position and size, is there a way to set the origin to be the window.origin instead of x:0.5 / 10, y: 0.5/10? So I can set the window height to be 1.0 and keep the window x unchanged.

Edit: Seems even in calculateCustomFrame(), the resulting frame is also positioned using ratio, seems we need to write from scratch if we wanna change only the height to 1.0 without changing the width.

@Ender-Wang Ender-Wang closed this Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants