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

Ported Action Bar in Rust #554

Merged
merged 8 commits into from
Aug 30, 2023
Merged

Conversation

itsAdee
Copy link
Contributor

@itsAdee itsAdee commented Aug 29, 2023

Please check the implementation :) . and let me know of any anomalies.

Copy link
Contributor

@Hofer-Julian Hofer-Julian left a comment

Choose a reason for hiding this comment

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

Apart from the one comment, it looks good

let start_widget: gtk::Button = workbench::builder().object("start_widget").unwrap();
let end_widget: gtk::Button = workbench::builder().object("end_widget").unwrap();

button.connect_clicked(move |button| {
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@itsAdee itsAdee Aug 30, 2023

Choose a reason for hiding this comment

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

You should use this function https://gtk-rs.org/gtk-rs-core/stable/0.18/docs/glib/object/trait.ObjectExt.html#tymethod.connect_notify_local with parameter "active" instead

Made the changes :) and also added my name in the contributors list.

@itsAdee itsAdee requested a review from sonnyp as a code owner August 30, 2023 04:43
Comment on lines 10 to 12
button.connect_notify_local(Some("active"), move |button, _| {
action_bar.set_revealed(!button.is_active());
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Please make sure to always run the formatter before submitting your PRs.

Copy link
Contributor Author

@itsAdee itsAdee Aug 30, 2023

Choose a reason for hiding this comment

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

Please make sure to always run the formatter before submitting your PRs.

can you tell more about the formatter , i am a beginner and do not know about it , help will be much appreciated :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Workbench formats your snippets every time you run them.
All you have to do is run them once, and then copy the formatted code into src/Library/demos/Action Bar/code.rs :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Workbench formats your snippets every time you run them. All you have to do is run them once, and then copy the formatted code into src/Library/demos/Action Bar/code.rs :)

i copied the exact code from the builder after running it , maybe a problem on my side, i will look into it and manually format it till i figure it out :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Screen recording
So you don't get this behavior?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Screen recording So you don't get this behavior?

i build the development configuration again hopefully it will be resolved , i remember it formatted my poorly written checkbox code yesterday :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the formatter works correctly now, i formatted the code and thank you very much of reminding me about this feature and for helping me :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Are you sure? Line 10 still looks off.

Copy link
Contributor Author

@itsAdee itsAdee Aug 30, 2023

Choose a reason for hiding this comment

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

Are you sure? Line 10 still looks off.

image
Directly copied the formatted code for the mentioned method from the workbench :)

Copy link
Contributor

@Hofer-Julian Hofer-Julian left a comment

Choose a reason for hiding this comment

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

Not sure why it didn't work out on your side, but I now formatted it myself.

@Hofer-Julian Hofer-Julian merged commit c7409f3 into workbenchdev:main Aug 30, 2023
1 check passed
@itsAdee itsAdee deleted the ActionImpl branch September 25, 2023 05:14
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