Skip to content

Add window::monitor_size task#2754

Merged
hecrj merged 2 commits intoiced-rs:masterfrom
rhysd:get-monitor-size
Nov 20, 2025
Merged

Add window::monitor_size task#2754
hecrj merged 2 commits intoiced-rs:masterfrom
rhysd:get-monitor-size

Conversation

@rhysd
Copy link
Contributor

@rhysd rhysd commented Jan 26, 2025

This PR adds iced::window::get_monitor_size function to create a task to get the logical size of current monitor.

This function is useful to determine the size of window when resizing it. In my case, I want to resize a window to fit to its content. When the content is big, the window can overflow off the monitor. By calculating the window size based on the monitor size, I can prevent the overflow.

@hecrj hecrj changed the title Add iced::window::get_monitor_size to get the logical size of the current monitor Add window::monitor_size task Nov 20, 2025
@hecrj hecrj added this to the 0.14 milestone Nov 20, 2025
@hecrj hecrj added feature New feature or request shell addition labels Nov 20, 2025
Copy link
Member

@hecrj hecrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

I made the monitor logical dimensions depend on the scale factor of the window for consistency.

@hecrj hecrj enabled auto-merge November 20, 2025 00:51
@hecrj hecrj merged commit 5db93d9 into iced-rs:master Nov 20, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

addition feature New feature or request shell

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants