Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add more window actions #1525

Closed
wants to merge 0 commits into from
Closed

add more window actions #1525

wants to merge 0 commits into from

Conversation

n1ght-hunter
Copy link
Contributor

@n1ght-hunter n1ght-hunter commented Nov 11, 2022

users should be able to with window::Actions:

  • toggle decorations live
  • toggle always on top i.e. for pinning a window
  • change icon live to show changes in app state etc

There may be a better way to handle the type for the Icon enum but you cant import winit into iced_native due to cyclic package dependency's. feel free to say a better way then i have done.

Also what do people think the Action::Fullscreen should do? currently it full screens on primary monitor but IMO i think it should full screen on current monitor.

And should it be an option to full screen exclusive. currently you can only full screen windowed borderless

native/src/window/action.rs Outdated Show resolved Hide resolved
@n1ght-hunter
Copy link
Contributor Author

n1ght-hunter commented Nov 23, 2022

@tarkah I'm trying to add

iced/src/window/icon.rs

Lines 28 to 33 in b4aedce

#[cfg(feature = "image_rs")]
pub fn from_file<P: AsRef<Path>>(icon_path: P) -> Result<Self, Error> {
let icon = image_rs::io::Reader::open(icon_path)?.decode()?.to_rgba8();
Self::from_rgba(icon.to_vec(), icon.width(), icon.height())
}

iced/src/window/icon.rs

Lines 40 to 56 in b4aedce

pub fn from_file_data(
data: &[u8],
explicit_format: Option<image_rs::ImageFormat>,
) -> Result<Self, Error> {
let mut icon = image_rs::io::Reader::new(std::io::Cursor::new(data));
let icon_with_format = match explicit_format {
Some(format) => {
icon.set_format(format);
icon
}
None => icon.with_guessed_format()?,
};
let pixels = icon_with_format.decode()?.to_rgba8();
Self::from_rgba(pixels.to_vec(), pixels.width(), pixels.height())
}

to the my iced native icon https://github.com/Night-Hunter-NF/iced/blob/master/native/src/window/icon.rs
but iced_native doesn't have image as a dep.
just wondering what you thoughts are on this

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.

I feel we are tackling multiple use cases here and some of the actions seem quite straightforward while some others may need further discussion.

Since there is not an RFC for these changes, I feel we should at least split this PR into smaller ones; one for each new action.

@hecrj hecrj added feature New feature or request shell labels Nov 29, 2022
@n1ght-hunter
Copy link
Contributor Author

ok yup will work on splitting them up into different PRs

@n1ght-hunter
Copy link
Contributor Author

split into prs above

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

Successfully merging this pull request may close these issues.

3 participants